Record Class InteractionConditionType<A extends InteractionCondition>
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.npc.interaction.condition.InteractionConditionType<A>
public record InteractionConditionType<A extends InteractionCondition>(com.mojang.serialization.MapCodec<A extends InteractionCondition> codec, Supplier<A extends InteractionCondition> defaultSupplier)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionInteractionConditionType
(com.mojang.serialization.MapCodec<A> codec) InteractionConditionType
(com.mojang.serialization.MapCodec<A> codec, A defaultValue) InteractionConditionType
(com.mojang.serialization.MapCodec<A> codec, Supplier<A> defaultSupplier) Creates an instance of aInteractionConditionType
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<A> codec()
Returns the value of thecodec
record component.Returns the value of thedefaultSupplier
record component.boolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.static <A extends com.mojang.serialization.MapCodec<B>,
B extends InteractionCondition>
InteractionConditionType<B> final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
InteractionConditionType
-
InteractionConditionType
-
InteractionConditionType
public InteractionConditionType(com.mojang.serialization.MapCodec<A> codec, Supplier<A> defaultSupplier) Creates an instance of aInteractionConditionType
record class.- Parameters:
codec
- the value for thecodec
record componentdefaultSupplier
- the value for thedefaultSupplier
record component
-
-
Method Details
-
of
public static <A extends com.mojang.serialization.MapCodec<B>,B extends InteractionCondition> InteractionConditionType<B> of(A codec, Supplier<B> defaultValue) -
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)
. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
codec
Returns the value of thecodec
record component.- Returns:
- the value of the
codec
record component
-
defaultSupplier
Returns the value of thedefaultSupplier
record component.- Returns:
- the value of the
defaultSupplier
record component
-