Record Class RecipeSchemaData.RecipeKeyData
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.recipe.schema.RecipeSchemaData.RecipeKeyData
- Enclosing class:
RecipeSchemaData
public static record RecipeSchemaData.RecipeKeyData(String name, ComponentRole role, RecipeComponent<?> type, Optional<com.google.gson.JsonElement> optional, boolean defaultOptional, List<String> alternativeNames, boolean excluded, List<String> functionNames, boolean alwaysWrite)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Function<RecipeTypeRegistryContext, com.mojang.serialization.Codec<RecipeSchemaData.RecipeKeyData>> -
Constructor Summary
ConstructorsConstructorDescriptionRecipeKeyData(String name, ComponentRole role, RecipeComponent<?> type, Optional<com.google.gson.JsonElement> optional, boolean defaultOptional, List<String> alternativeNames, boolean excluded, List<String> functionNames, boolean alwaysWrite) Creates an instance of aRecipeKeyDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealternativeNamesrecord component.booleanReturns the value of thealwaysWriterecord component.booleanReturns the value of thedefaultOptionalrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanexcluded()Returns the value of theexcludedrecord component.Returns the value of thefunctionNamesrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Optional<com.google.gson.JsonElement> optional()Returns the value of theoptionalrecord component.role()Returns the value of therolerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
CODEC
public static Function<RecipeTypeRegistryContext,com.mojang.serialization.Codec<RecipeSchemaData.RecipeKeyData>> CODEC
-
-
Constructor Details
-
RecipeKeyData
public RecipeKeyData(String name, ComponentRole role, RecipeComponent<?> type, Optional<com.google.gson.JsonElement> optional, boolean defaultOptional, List<String> alternativeNames, boolean excluded, List<String> functionNames, boolean alwaysWrite) Creates an instance of aRecipeKeyDatarecord class.- Parameters:
name- the value for thenamerecord componentrole- the value for therolerecord componenttype- the value for thetyperecord componentoptional- the value for theoptionalrecord componentdefaultOptional- the value for thedefaultOptionalrecord componentalternativeNames- the value for thealternativeNamesrecord componentexcluded- the value for theexcludedrecord componentfunctionNames- the value for thefunctionNamesrecord componentalwaysWrite- the value for thealwaysWriterecord component
-
-
Method Details
-
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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
role
Returns the value of therolerecord component.- Returns:
- the value of the
rolerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
optional
Returns the value of theoptionalrecord component.- Returns:
- the value of the
optionalrecord component
-
defaultOptional
public boolean defaultOptional()Returns the value of thedefaultOptionalrecord component.- Returns:
- the value of the
defaultOptionalrecord component
-
alternativeNames
Returns the value of thealternativeNamesrecord component.- Returns:
- the value of the
alternativeNamesrecord component
-
excluded
public boolean excluded()Returns the value of theexcludedrecord component.- Returns:
- the value of the
excludedrecord component
-
functionNames
Returns the value of thefunctionNamesrecord component.- Returns:
- the value of the
functionNamesrecord component
-
alwaysWrite
public boolean alwaysWrite()Returns the value of thealwaysWriterecord component.- Returns:
- the value of the
alwaysWriterecord component
-