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 T
The field for thepredicate
record component.private final DataComponentPredicate.Type
<T> The field for thetype
record component. -
Constructor Summary
ConstructorsConstructorDescriptionSingle
(DataComponentPredicate.Type<T> type, T predicate) Creates an instance of aSingle
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.private static <T extends DataComponentPredicate>
DataComponentPredicate.Single<T> fromEntry
(Map.Entry<DataComponentPredicate.Type<?>, T> p_411082_) final int
hashCode()
Returns a hash code value for this object.Returns the value of thepredicate
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Field Details
-
type
The field for thetype
record component. -
predicate
The field for thepredicate
record component.
-
-
Constructor Details
-
Single
Creates an instance of aSingle
record class.- Parameters:
type
- the value for thetype
record componentpredicate
- the value for thepredicate
record component
-
-
Method Details
-
fromEntry
private static <T extends DataComponentPredicate> DataComponentPredicate.Single<T> fromEntry(Map.Entry<DataComponentPredicate.Type<?>, T> p_411082_) -
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 thetype
record component.- Returns:
- the value of the
type
record component
-
predicate
Returns the value of thepredicate
record component.- Returns:
- the value of the
predicate
record component
-