Statements (29)
Predicate | Object |
---|---|
gptkbp:instanceOf |
Java language feature
|
gptkbp:canBe |
implement interfaces
|
gptkbp:compatibleWith |
be abstract
define mutable fields extend other classes define instance fields other than those in the header |
gptkbp:documentation |
https://docs.oracle.com/en/java/javase/16/language/records.html
|
gptkbp:feature |
automatically generates equals()
automatically generates hashCode() automatically generates toString() compact constructor support component-based API deconstruction pattern support fields are final fields are private provides canonical constructor serializable by default |
gptkbp:hasSyntax |
record Point(int x, int y) {}
|
https://www.w3.org/2000/01/rdf-schema#label |
records (from Java 14)
|
gptkbp:introducedIn |
gptkb:Java_14
|
gptkbp:partOf |
gptkb:Project_Amber
|
gptkbp:purpose |
to provide a compact syntax for declaring classes which are transparent holders for shallowly immutable data
|
gptkbp:relatedTo |
case classes in Scala
data classes in Kotlin records in C# |
gptkbp:status |
preview feature in Java 14
standard feature in Java 16 |
gptkbp:bfsParent |
gptkb:Java_6_and_above
|
gptkbp:bfsLayer |
7
|