Case classes in Scala

GPTKB entity

Statements (23)
Predicate Object
gptkbp:instanceOf language feature
gptkbp:compatibleWith be abstract
be extended by other case classes
gptkbp:defaultIn serializable
constructor parameters are public and val
copy method for shallow copy
structural equality
gptkbp:distinctFrom regular classes: more boilerplate-free
gptkbp:feature apply and unapply methods
automatic companion object
automatic copy method
automatic equals and hashCode
automatic toString
pattern matching support
gptkbp:hasSyntax case class Person(name: String, age: Int)
https://www.w3.org/2000/01/rdf-schema#label Case classes in Scala
gptkbp:introducedIn gptkb:Scala
gptkbp:purpose model immutable data
gptkbp:usedFor algebraic data types
pattern matching
immutable data modeling
gptkbp:bfsParent gptkb:Records_(since_Java_16)
gptkbp:bfsLayer 8