java-language
/java-language
Stosuje standardy języka Java 21+: Records, Pattern Matching i Virtual Threads, także przy aktualizacjach kodu Java do nowszych wersji.
- Autor
- HoangNguyen0403 ↗
- Repozytorium
- agent-skills-standard ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 22.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 3
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 22.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Stosuje standardy języka Java 21+: Records, Pattern Matching i Virtual Threads, także przy aktualizacjach kodu Java do nowszych wersji.
Oryginalny opis (EN)
Modern Java 21+ language standards including Records, Pattern Matching, and Virtual Threads. Use for Java language constructs or Java-to-Java upgrades; defer Kotlin, tests, formatting/build tools, CompletableFuture, builder patterns, and isolated null-handling questions.
Jak działa
- Priority: P0 (CRITICAL)
- Implementation Guidelines
- Anti-Patterns
- References
- Canonical response anchors
Podgląd SKILL.md
---
name: java-language
description: Modern Java 21+ language standards including Records, Pattern Matching, and Virtual Threads. Use for Java language constructs or Java-to-Java upgrades; defer Kotlin, tests, formatting/build tools, CompletableFuture, builder patterns, and isolated null-handling questions.
metadata:
triggers:
files:
- '**/*.java'
- 'pom.xml'
- 'build.gradle'
keywords:
- record
- sealed
- switch
- var
- Optional
- stream
- VirtualThread
- instanceof
- text block
---
# Java Language Patterns
## **Priority: P0 (CRITICAL)**
## Implementation Guidelines
- **Records**: Use record for immutable DTOs/Value Objects. Records auto-generate equals, hashCode, toString. Avoid Lombok @Data on Pojos.
- **Local Variables**: Use **`var`** for inferred types. Explicitly type interface variables.
- **Switch**: Use Switch Expressions (->) and Pattern Matching over complex if/else chains.
- **Text Blocks**: Use **`"" (Text Blocks)`** for JSON, SQL, or multi-line strings.
- **Pattern Matching**: Use **`instanceof`** with pattern binding: `if (obj instanceof String s)`.
- **Sealed Classes**: Use sealed interface/class with permits clause for domain-driven restricted hierarchies. Switch expressions then exhaustive switch (compiler-verified).
- **Collections**: Use **`List.of()`**, **`Map.of()`**, and **`Set.of()`** for immutable collections.
- **Streams**: Use **`stream()`** pipelines for functional transformations. Use **`.toList()`** (Java 16+).
- **Optional**: Utilize **`Optional<T>`** for return types. Use **`.ifPresentOrElse()`** or **`.orElseThrow()`**.
- **Virtual Threads**: Favor **`Executors.newVirtualThreadPerTaskExecutor()`** for I/O-heavy workloads.
## Anti-Patterns
- **No Nulls**: Return Optional or empty collections; avoid null parameters.
- **No Raw Types**: Always use generics; never use raw List or Map.
- **No Old Switch**: Use switch expressions (->); avoid fall-through.
- **No Manual get/set**: Use Records or value objects instead.
- **No synchronized blocks**: Use java.util.concurrent or Virtual Threads instead.
## References
- [Records, Pattern Matching & Virtual Threads](references/example.md)
## Canonical response anchors
When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:
- DTOs/Value Objects
- Lombok
- exhaustive switch
- if/else chains
- sealed interface/class
Pliki w paczce (3)
- SKILL.md 2 KB
- evals/evals.json 3 KB
- references/example.md 2 KB
Wersje
W bazie nie ma innych skilli o nazwie java-language.
Migawka bazy z 13.11.2026 · wersja paczki 10436f7d97b1 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 90modernize-java
Aktualizuje kod Java do nowoczesnych funkcji języka: records, switch expressions, pattern matching, virtual threads, sealed classes, text blocks i współczesne idiomy kolekcji. - 100java-concurrency
Wdraża nowoczesną współbieżność w Javie: Virtual Threads, Structured Concurrency ze StructuredTaskScope, potoki CompletableFuture i debugowanie wyścigów. - 100java-expert
Dostarcza wiedzę o funkcjach Javy 25: virtual threads, pattern matching, records, sealed classes, value types oraz Project Loom i Valhalla, przy współbieżności i optymalizacji wydajności. - 100java-modern-features-virtual-threads
Pomaga budować skalowalne aplikacje Java z wirtualnymi wątkami Project Loom, dopasowywaniem wzorców i rekordami. - 100java-upgrade
Podnosi projekt Java do nowszego JDK, czyli 11 do 17, 17 do 21 albo 21 do 25, i wdraża nowe funkcje języka. - 100java-modern
Stosuje funkcje Javy 21+ w Quarkus: rekordy, sealed classes, dopasowanie wzorców, wątki wirtualne i bloki tekstowe, także przy modernizacji istniejącego kodu.