Record Class DataComponentPredicate.Single<T extends DataComponentPredicate>
java.lang.Object
java.lang.Record
net.minecraft.core.component.predicates.DataComponentPredicate.Single<T>
- Enclosing interface:
DataComponentPredicate
public static record DataComponentPredicate.Single<T extends DataComponentPredicate>(DataComponentPredicate.Type<T extends DataComponentPredicate> type, T extends DataComponentPredicate predicate)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TThe field for thepredicaterecord component.private final DataComponentPredicate.Type<T> The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSingle(DataComponentPredicate.Type<T> type, T predicate) Creates an instance of aSinglerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.private static <T extends DataComponentPredicate>
DataComponentPredicate.Single<T> fromEntry(Map.Entry<DataComponentPredicate.Type<?>, T> pEntry) final inthashCode()Returns a hash code value for this object.Returns the value of thepredicaterecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
type
The field for thetyperecord component. -
predicate
The field for thepredicaterecord component.
-
-
Constructor Details
-
Single
Creates an instance of aSinglerecord class.- Parameters:
type- the value for thetyperecord componentpredicate- the value for thepredicaterecord component
-
-
Method Details
-
fromEntry
private static <T extends DataComponentPredicate> DataComponentPredicate.Single<T> fromEntry(Map.Entry<DataComponentPredicate.Type<?>, T> pEntry) -
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-