Record Class Holder.IdHolder<T>
java.lang.Object
java.lang.Record
org.geysermc.mcprotocollib.protocol.data.game.Holder.IdHolder<T>
- All Implemented Interfaces:
Holder<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.geysermc.mcprotocollib.protocol.data.game.Holder
Holder.CustomHolder<T>, Holder.IdHolder<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncustom()final booleanIndicates whether some other object is "equal to" this one.getOrCompute(IntFunction<T> supplier) Returns the holder as an object, or else looks up the item in the registry.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.ifId(IntConsumer action) booleanisCustom()booleanisId()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
IdHolder
public IdHolder(int id) Creates an instance of aIdHolderrecord class.- Parameters:
id- the value for theidrecord component
-
-
Method Details
-
isId
public boolean isId() -
isCustom
public boolean isCustom() -
custom
-
ifId
-
ifCustom
-
getOrCompute
Description copied from interface:HolderReturns the holder as an object, or else looks up the item in the registry.- Specified by:
getOrComputein interfaceHolder<T>
-
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 '=='. -
id
public int id()Returns the value of theidrecord component.
-