Record Class CollectionPredicate<T,P extends Predicate<T>>
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.CollectionPredicate<T,P>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Optional
<CollectionContentsPredicate<T, P>> The field for thecontains
record component.private final Optional
<CollectionCountsPredicate<T, P>> The field for thecounts
record component.private final Optional
<MinMaxBounds.Ints> The field for thesize
record component. -
Constructor Summary
ConstructorDescriptionCollectionPredicate
(Optional<CollectionContentsPredicate<T, P>> contains, Optional<CollectionCountsPredicate<T, P>> counts, Optional<MinMaxBounds.Ints> size) Creates an instance of aCollectionPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
P extends Predicate<T>>
com.mojang.serialization.Codec<CollectionPredicate<T, P>> codec
(com.mojang.serialization.Codec<P> p_340851_) contains()
Returns the value of thecontains
record component.counts()
Returns the value of thecounts
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.size()
Returns the value of thesize
record component.boolean
final String
toString()
Returns a string representation of this record class.
-
Field Details
-
contains
The field for thecontains
record component. -
counts
The field for thecounts
record component. -
size
The field for thesize
record component.
-
-
Constructor Details
-
CollectionPredicate
public CollectionPredicate(Optional<CollectionContentsPredicate<T, P>> contains, Optional<CollectionCountsPredicate<T, P>> counts, Optional<MinMaxBounds.Ints> size) Creates an instance of aCollectionPredicate
record class.- Parameters:
contains
- the value for thecontains
record componentcounts
- the value for thecounts
record componentsize
- the value for thesize
record component
-
-
Method Details
-
codec
public static <T,P extends Predicate<T>> com.mojang.serialization.Codec<CollectionPredicate<T,P>> codec(com.mojang.serialization.Codec<P> p_340851_) -
test
-
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)
. -
contains
Returns the value of thecontains
record component.- Returns:
- the value of the
contains
record component
-
counts
Returns the value of thecounts
record component.- Returns:
- the value of the
counts
record component
-
size
Returns the value of thesize
record component.- Returns:
- the value of the
size
record component
-