Record Class ComponentPredicateSet
java.lang.Object
java.lang.Record
net.minestom.server.instance.block.predicate.ComponentPredicateSet
- All Implemented Interfaces:
Predicate<DataComponent.Holder>
public record ComponentPredicateSet(List<DataComponentPredicate> predicates)
extends Record
implements Predicate<DataComponent.Holder>
A list of
DataComponentPredicates.
Note: instances of this class are immutable. Calling add(DataComponentPredicate) or remove(DataComponentPredicate)
will return a new instance of this class with the element added or removed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<ComponentPredicateSet> static final ComponentPredicateSetstatic final NetworkBuffer.Type<ComponentPredicateSet> -
Constructor Summary
ConstructorsConstructorDescriptionComponentPredicateSet(List<DataComponentPredicate> predicates) Creates an instance of aComponentPredicateSetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionadd(DataComponentPredicate predicate) booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.booleanisEmpty()Returns the value of thepredicatesrecord component.remove(DataComponentPredicate predicate) booleantest(DataComponent.Holder holder) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
CODEC
-
NETWORK_TYPE
-
-
Constructor Details
-
ComponentPredicateSet
Creates an instance of aComponentPredicateSetrecord class.- Parameters:
predicates- the value for thepredicatesrecord component
-
-
Method Details
-
add
-
remove
-
isEmpty
public boolean isEmpty() -
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
-
test
- Specified by:
testin interfacePredicate<DataComponent.Holder>
-
toString
-
predicates
Returns the value of thepredicatesrecord component.- Returns:
- the value of the
predicatesrecord component
-