Package net.minestom.server.entity
Record Class MetadataDef.Entry.Index<T>
java.lang.Object
java.lang.Record
net.minestom.server.entity.MetadataDef.Entry.Index<T>
- All Implemented Interfaces:
MetadataDef.Entry<T>
- Enclosing interface:
MetadataDef.Entry<T>
public static record MetadataDef.Entry.Index<T>(int index, Function<T,Metadata.Entry<T>> function, T defaultValue)
extends Record
implements MetadataDef.Entry<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minestom.server.entity.MetadataDef.Entry
MetadataDef.Entry.BitMask, MetadataDef.Entry.ByteMask, MetadataDef.Entry.Index<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedefaultValue
record component.final boolean
Indicates whether some other object is "equal to" this one.function()
Returns the value of thefunction
record component.final int
hashCode()
Returns a hash code value for this object.int
index()
Returns the value of theindex
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Index
Creates an instance of aIndex
record class.- Parameters:
index
- the value for theindex
record componentfunction
- the value for thefunction
record componentdefaultValue
- the value for thedefaultValue
record 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 '=='. -
index
public int index()Returns the value of theindex
record component.- Specified by:
index
in interfaceMetadataDef.Entry<T>
- Returns:
- the value of the
index
record component
-
function
Returns the value of thefunction
record component.- Returns:
- the value of the
function
record component
-
defaultValue
Returns the value of thedefaultValue
record component.- Specified by:
defaultValue
in interfaceMetadataDef.Entry<T>
- Returns:
- the value of the
defaultValue
record component
-