Package dev.omnist.schema
Record Class Field
java.lang.Object
java.lang.Record
dev.omnist.schema.Field
- Record Components:
label- the field label; must not benulltype- the field type; must not benullmin- the minimum occurrence count; must be >= 0max- the maximum occurrence count;nullmeans unbounded; if non-null, must be >=min
An immutable field declaration within a
Record definition (omnist-spec ยง5.4).
A field captures:
- a
labelโ the JSON/OML key name as a quoted string in OSD - a
typeโ a scalar type, aType.Refto another record, orType.Any - cardinality bounds
[min, max]โ minimum and maximum occurrence count per node;max == nullmeans unbounded
[1, 1] (exactly one occurrence).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.max()Returns the value of themaxrecord component.intmin()Returns the value of theminrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Field
Compact constructor that enforces label/type non-null and cardinality invariants.- Throws:
NullPointerException- iflabelortypeisnullIllegalArgumentException- ifminis negative, or ifmaxis non-nulland less thanmin
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
min
public int min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-