Record Class Holder.CustomHolder<T>
java.lang.Object
java.lang.Record
org.geysermc.mcprotocollib.protocol.data.game.Holder.CustomHolder<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()ifId(IntConsumer action) booleanisCustom()booleanisId()object()Returns the value of theobjectrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CustomHolder
Creates an instance of aCustomHolderrecord class.- Parameters:
object- the value for theobjectrecord component
-
-
Method Details
-
isId
public boolean isId() -
id
public int id() -
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 withObjects::equals(Object,Object). -
object
Returns the value of theobjectrecord component.- Returns:
- the value of the
objectrecord component
-