Record Type

Noun · Development

Definitions

  1. A named, typically immutable composite data type whose identity is defined by its field values rather than by reference — two records with identical fields are considered equal. Java 16+ records, C# records, Kotlin data classes, and TypeScript's Record<K,V> utility type all express this concept, automatically generating equals, hashCode, and toString based on the declared fields.

    In plain English: A lightweight data container whose equality is based on what it holds, not where it lives in memory — think of it as a labeled tuple with named fields.

    Example: "We replaced the 50-line POJO with a one-line Java record — it gives us the constructor, getters, equals, and hashCode for free."

Related Terms