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 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
-
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 with thecomparemethod from their corresponding wrapper classes. -
id
-