Record Class GeyserHasComponentPredicate
java.lang.Object
java.lang.Record
org.geysermc.geyser.item.custom.impl.predicates.GeyserHasComponentPredicate
- All Implemented Interfaces:
Predicate<org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext>,org.geysermc.geyser.api.predicate.item.HasComponentPredicate,org.geysermc.geyser.api.predicate.MinecraftPredicate<org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext>
public record GeyserHasComponentPredicate(@NonNull org.geysermc.geyser.api.util.Identifier component, boolean negated)
extends Record
implements org.geysermc.geyser.api.predicate.item.HasComponentPredicate
-
Constructor Summary
ConstructorsConstructorDescriptionGeyserHasComponentPredicate(@NonNull org.geysermc.geyser.api.util.Identifier component, boolean negated) Creates an instance of aGeyserHasComponentPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescription@NonNull org.geysermc.geyser.api.util.IdentifierReturns the value of thecomponentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NonNull org.geysermc.geyser.api.predicate.MinecraftPredicate<org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext>negate()booleannegated()Returns the value of thenegatedrecord component.booleantest(org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext context) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.geysermc.geyser.api.predicate.MinecraftPredicate
and, or
-
Constructor Details
-
GeyserHasComponentPredicate
public GeyserHasComponentPredicate(@NonNull org.geysermc.geyser.api.util.Identifier component, boolean negated) Creates an instance of aGeyserHasComponentPredicaterecord class.- Parameters:
component- the value for thecomponentrecord componentnegated- the value for thenegatedrecord component
-
-
Method Details
-
test
public boolean test(org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext context) -
negate
public @NonNull org.geysermc.geyser.api.predicate.MinecraftPredicate<org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext> negate() -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
component
public @NonNull org.geysermc.geyser.api.util.Identifier component()Returns the value of thecomponentrecord component.- Specified by:
componentin interfaceorg.geysermc.geyser.api.predicate.item.HasComponentPredicate- Returns:
- the value of the
componentrecord component
-
negated
public boolean negated()Returns the value of thenegatedrecord component.- Specified by:
negatedin interfaceorg.geysermc.geyser.api.predicate.item.HasComponentPredicate- Returns:
- the value of the
negatedrecord component
-