Record Class ConditionalEffect<E extends Enchantment.Effect>
java.lang.Object
java.lang.Record
net.minestom.server.item.enchant.ConditionalEffect<E>
- All Implemented Interfaces:
Enchantment.Effect
public record ConditionalEffect<E extends Enchantment.Effect>(E extends Enchantment.Effect effect, @Nullable DataPredicate requirements)
extends Record
implements Enchantment.Effect
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalEffect
(E effect, @Nullable DataPredicate requirements) Creates an instance of aConditionalEffect
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Enchantment.Effect>
@NotNull Codec<ConditionalEffect<E>> effect()
Returns the value of theeffect
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@Nullable DataPredicate
Returns the value of therequirements
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ConditionalEffect
Creates an instance of aConditionalEffect
record class.- Parameters:
effect
- the value for theeffect
record componentrequirements
- the value for therequirements
record component
-
-
Method Details
-
codec
@NotNull public static <E extends Enchantment.Effect> @NotNull Codec<ConditionalEffect<E>> codec(@NotNull @NotNull Codec<E> effectType) -
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)
. -
effect
Returns the value of theeffect
record component.- Returns:
- the value of the
effect
record component
-
requirements
Returns the value of therequirements
record component.- Returns:
- the value of the
requirements
record component
-