Record Class DataMapTests.SomeObject
java.lang.Object
java.lang.Record
net.neoforged.neoforge.debug.data.DataMapTests.SomeObject
- Enclosing class:
DataMapTests
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DataMapTests.SomeObject> private final intThe field for theintValuerecord component.private final StringThe field for thestringValuerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSomeObject(int intValue, String stringValue) Creates an instance of aSomeObjectrecord class. -
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.intintValue()Returns the value of theintValuerecord component.Returns the value of thestringValuerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
intValue
private final int intValueThe field for theintValuerecord component. -
stringValue
The field for thestringValuerecord component. -
CODEC
-
-
Constructor Details
-
SomeObject
Creates an instance of aSomeObjectrecord class.- Parameters:
intValue- the value for theintValuerecord componentstringValue- the value for thestringValuerecord component
-
-
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 '=='. -
intValue
public int intValue()Returns the value of theintValuerecord component.- Returns:
- the value of the
intValuerecord component
-
stringValue
Returns the value of thestringValuerecord component.- Returns:
- the value of the
stringValuerecord component
-