Package forgottentowns.mod.api
Record Class RegistryAccess.Definition
java.lang.Object
java.lang.Record
forgottentowns.mod.api.RegistryAccess.Definition
- Record Components:
id- stable definition identityvalues- deeply immutable JSON values
- Enclosing interface:
RegistryAccess
One authored definition or generated startup summary, excluding its identity field from the values map.
Values use the documented JSON field names and contain strings, numbers, booleans,
null, lists and string-keyed maps. This is a content snapshot, not a gameplay object.
-
Constructor Summary
ConstructorsConstructorDescriptionDefinition(String id, Map<String, Object> values) Creates a defensive, deeply immutable copy of a definition. -
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.id()Returns the value of theidrecord component.final StringtoString()Returns a string representation of this record class.values()Returns the value of thevaluesrecord component.
-
Constructor Details
-
Definition
Creates a defensive, deeply immutable copy of a definition.- Parameters:
id- nonblank stable identityvalues- JSON field values, without the identity field- Throws:
NullPointerException- if id or values is nullIllegalArgumentException- if id is blank or values contain non-JSON data
-
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-