Record Class RecipeComponentWithCodec<T>
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.recipe.component.RecipeComponentWithCodec<T>
- All Implemented Interfaces:
RecipeComponent<T>,RecipeComponentWithParent<T>
public record RecipeComponentWithCodec<T>(RecipeComponent<T> parent, com.mojang.serialization.Codec<T> codec)
extends Record
implements RecipeComponentWithParent<T>
-
Constructor Summary
ConstructorsConstructorDescriptionRecipeComponentWithCodec(RecipeComponent<T> parent, com.mojang.serialization.Codec<T> codec) Creates an instance of aRecipeComponentWithCodecrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<T> codec()Returns the value of thecodecrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.parent()Returns the value of theparentrecord component.toString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.kubejs.recipe.component.RecipeComponent
asConditionalList, asConditionalListOrSelf, asList, asListOrSelf, asMap, asPatternKey, inputKey, isIgnored, key, or, orSelf, otherKey, outputKey, readFromJson, toString, withCodec, writeToJsonMethods inherited from interface dev.latvian.mods.kubejs.recipe.component.RecipeComponentWithParent
allowEmpty, buildUniqueId, createBuilder, hasPriority, isEmpty, matches, replace, spread, typeInfo, validate, wrap
-
Constructor Details
-
RecipeComponentWithCodec
Creates an instance of aRecipeComponentWithCodecrecord class.- Parameters:
parent- the value for theparentrecord componentcodec- the value for thecodecrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceRecipeComponent<T>
-
parentComponent
- Specified by:
parentComponentin interfaceRecipeComponentWithParent<T>
-
codec
Returns the value of thecodecrecord component.- Specified by:
codecin interfaceRecipeComponent<T>- Specified by:
codecin interfaceRecipeComponentWithParent<T>- Returns:
- the value of the
codecrecord component
-
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). -
parent
Returns the value of theparentrecord component.- Returns:
- the value of the
parentrecord component
-