Record Class DataVersion
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.DataVersion
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDataVersion
(int version, String series) Creates an instance of aDataVersion
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isCompatible
(DataVersion pDataVersion) boolean
series()
Returns the value of theseries
record component.final String
toString()
Returns a string representation of this record class.int
version()
Returns the value of theversion
record component.
-
Field Details
-
version
private final int versionThe field for theversion
record component. -
series
The field for theseries
record component. -
MAIN_SERIES
- See Also:
-
-
Constructor Details
-
DataVersion
Creates an instance of aDataVersion
record class.- Parameters:
version
- the value for theversion
record componentseries
- the value for theseries
record component
-
-
Method Details
-
isSideSeries
public boolean isSideSeries() -
isCompatible
-
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 '=='. -
version
public int version()Returns the value of theversion
record component.- Returns:
- the value of the
version
record component
-
series
Returns the value of theseries
record component.- Returns:
- the value of the
series
record component
-