Record Class CustomObjectRecipeComponent.Value
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.recipe.component.CustomObjectRecipeComponent.Value
- All Implemented Interfaces:
Comparable<CustomObjectRecipeComponent.Value>,Map.Entry<CustomObjectRecipeComponent.Key,Object>
- Enclosing class:
CustomObjectRecipeComponent
public static record CustomObjectRecipeComponent.Value(CustomObjectRecipeComponent.Key key, int index, Object value)
extends Record
implements Map.Entry<CustomObjectRecipeComponent.Key,Object>, Comparable<CustomObjectRecipeComponent.Value>
-
Constructor Summary
ConstructorsConstructorDescriptionValue(CustomObjectRecipeComponent.Key key, int index, Object value) Creates an instance of aValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.getKey()getValue()final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.key()Returns the value of thekeyrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Value
Creates an instance of aValuerecord class.- Parameters:
key- the value for thekeyrecord componentindex- the value for theindexrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
getKey
- Specified by:
getKeyin interfaceMap.Entry<CustomObjectRecipeComponent.Key,Object>
-
getValue
- Specified by:
getValuein interfaceMap.Entry<CustomObjectRecipeComponent.Key,Object>
-
setValue
- Specified by:
setValuein interfaceMap.Entry<CustomObjectRecipeComponent.Key,Object>
-
compareTo
- Specified by:
compareToin interfaceComparable<CustomObjectRecipeComponent.Value>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-