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 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
-
id
-
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
-
hashCode
-
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
-