Record Class DataComponentComparator
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.integration.rei.DataComponentComparator
- All Implemented Interfaces:
me.shedaniel.rei.api.common.entry.comparison.EntryComparator<net.minecraft.core.component.DataComponentHolder>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDataComponentComparator(List<net.minecraft.core.component.DataComponentType<?>> components) Creates an instance of aDataComponentComparatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.core.component.DataComponentType<?>> Returns the value of thecomponentsrecord component.final booleanIndicates whether some other object is "equal to" this one.longhash(me.shedaniel.rei.api.common.entry.comparison.ComparisonContext context, net.minecraft.core.component.DataComponentHolder holder) final inthashCode()Returns a hash code value for this object.static DataComponentComparatorfinal 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 me.shedaniel.rei.api.common.entry.comparison.EntryComparator
onlyExact, then
-
Field Details
-
EMPTY
-
-
Constructor Details
-
DataComponentComparator
Creates an instance of aDataComponentComparatorrecord class.- Parameters:
components- the value for thecomponentsrecord component
-
-
Method Details
-
of
public static DataComponentComparator of(List<net.minecraft.core.component.DataComponentType<?>> components) -
hash
public long hash(me.shedaniel.rei.api.common.entry.comparison.ComparisonContext context, net.minecraft.core.component.DataComponentHolder holder) - Specified by:
hashin interfaceme.shedaniel.rei.api.common.entry.comparison.EntryComparator<net.minecraft.core.component.DataComponentHolder>
-
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). -
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-