Package net.minestom.server.registry
Record Class Holder.Lazy<T>
java.lang.Object
java.lang.Record
net.minestom.server.registry.Holder.Lazy<T>
- Type Parameters:
T-
public static record Holder.Lazy<T>(@UnknownNullability Holder<T> holder, @UnknownNullability net.kyori.adventure.key.Key reference)
extends Record
A lazy holder allows for the value to be read as a reference without resolving it against the registry.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.holder()Returns the value of theholderrecord component.@UnknownNullability net.kyori.adventure.key.KeyReturns the value of thereferencerecord component.resolve(@NotNull DynamicRegistry<T> registry) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Lazy
-
Lazy
public Lazy(@NotNull @NotNull net.kyori.adventure.key.Key reference) -
Lazy
public Lazy(@UnknownNullability Holder<T> holder, @UnknownNullability net.kyori.adventure.key.Key reference) Creates an instance of aLazyrecord class.- Parameters:
holder- the value for theholderrecord componentreference- the value for thereferencerecord component
-
-
Method Details
-
resolve
-
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). -
holder
Returns the value of theholderrecord component.- Returns:
- the value of the
holderrecord component
-
reference
public @UnknownNullability net.kyori.adventure.key.Key reference()Returns the value of thereferencerecord component.- Returns:
- the value of the
referencerecord component
-