Record Class IdentityMappings
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.data.IdentityMappings
- All Implemented Interfaces:
Mappings
-
Constructor Summary
ConstructorsConstructorDescriptionIdentityMappings(int size, int mappedSize) Creates an instance of aIdentityMappingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intgetNewId(int id) Returns the mapped id from the given id, or -1 if invalid/out of bounds.final inthashCode()Returns a hash code value for this object.inverse()Mappings with keys and values swapped.intReturns the value of themappedSizerecord component.voidsetNewId(int id, int mappedId) Manually maps a specific id.intsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.viaversion.viaversion.api.data.Mappings
contains, getNewIdOrDefault
-
Constructor Details
-
IdentityMappings
public IdentityMappings(int size, int mappedSize) Creates an instance of aIdentityMappingsrecord class.- Parameters:
size- the value for thesizerecord componentmappedSize- the value for themappedSizerecord component
-
-
Method Details
-
getNewId
public int getNewId(int id) Description copied from interface:MappingsReturns the mapped id from the given id, or -1 if invalid/out of bounds. -
setNewId
public void setNewId(int id, int mappedId) Description copied from interface:MappingsManually maps a specific id. -
inverse
Description copied from interface:MappingsMappings with keys and values swapped. -
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 with '=='. -
size
public int size()Returns the value of thesizerecord component. -
mappedSize
public int mappedSize()Returns the value of themappedSizerecord component.- Specified by:
mappedSizein interfaceMappings- Returns:
- the value of the
mappedSizerecord component
-