Record Class NumberComponent.DoubleRange
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.recipe.component.NumberComponent.DoubleRange
- All Implemented Interfaces:
NumberComponent<NumberComponent.DoubleRange,,Double> RecipeComponent<Double>
- Enclosing interface:
NumberComponent<S,T extends Number>
public static record NumberComponent.DoubleRange(@Nullable RecipeComponentType<?> typeOverride, Double min, Double max, com.mojang.serialization.Codec<Double> codec)
extends Record
implements NumberComponent<NumberComponent.DoubleRange,Double>
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.latvian.mods.kubejs.recipe.component.NumberComponent
NumberComponent.DoubleRange, NumberComponent.FloatRange, NumberComponent.IntRange, NumberComponent.LongRange -
Field Summary
Fields inherited from interface dev.latvian.mods.kubejs.recipe.component.NumberComponent
DOUBLE, DOUBLE_TYPE, FLOAT, FLOAT_TYPE, INT, INT_TYPE, LONG, LONG_TYPE, NON_NEGATIVE_DOUBLE, NON_NEGATIVE_FLOAT, NON_NEGATIVE_INT, NON_NEGATIVE_LONG, POSITIVE_DOUBLE, POSITIVE_FLOAT, POSITIVE_INT, POSITIVE_LONG -
Constructor Summary
ConstructorsConstructorDescriptionDoubleRange(@Nullable RecipeComponentType<?> typeOverride, Double min, Double max, com.mojang.serialization.Codec<Double> codec) Creates an instance of aDoubleRangerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<Double> 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.max()Returns the value of themaxrecord component.min()Returns the value of theminrecord component.static NumberComponent.DoubleRangeof(@Nullable RecipeComponentType<?> typeOverride, Double min, Double max) toString()Returns a string representation of this record class.type()dev.latvian.mods.rhino.type.TypeInfotypeInfo()Defines a description for how this component may be constructed.@Nullable RecipeComponentType<?> Returns the value of thetypeOverriderecord component.wrap(RecipeScriptContext cx, Object from) Method to read the value contained within this component from an input object; this may be some arbitrary value passed into aschema'sconstructor(s) or automatically generated builder methods.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.kubejs.recipe.component.NumberComponent
hasPriority, max, min, toStringMethods inherited from interface dev.latvian.mods.kubejs.recipe.component.RecipeComponent
allowEmpty, asConditionalList, asConditionalListOrSelf, asList, asListOrSelf, asMap, asPatternKey, buildUniqueId, createBuilder, inputKey, isEmpty, isIgnored, key, matches, or, orSelf, otherKey, outputKey, readFromJson, replace, spread, toString, validate, withCodec, writeToJson
-
Constructor Details
-
DoubleRange
public DoubleRange(@Nullable @Nullable RecipeComponentType<?> typeOverride, Double min, Double max, com.mojang.serialization.Codec<Double> codec) Creates an instance of aDoubleRangerecord class.- Parameters:
typeOverride- the value for thetypeOverriderecord componentmin- the value for theminrecord componentmax- the value for themaxrecord componentcodec- the value for thecodecrecord component
-
-
Method Details
-
of
public static NumberComponent.DoubleRange of(@Nullable @Nullable RecipeComponentType<?> typeOverride, Double min, Double max) -
type
- Specified by:
typein interfaceRecipeComponent<Double>
-
codec
Returns the value of thecodecrecord component.- Specified by:
codecin interfaceRecipeComponent<Double>- Returns:
- the value of the
codecrecord component
-
typeInfo
public dev.latvian.mods.rhino.type.TypeInfo typeInfo()Description copied from interface:RecipeComponentDefines a description for how this component may be constructed. Type descriptions may be comprised of a primitive type such as a string, number or Java class (which may be useful if that that class has an appropriate type wrapper for it already), an array of fixed or dynamic length, a map / object, or a union of multiple types.Type descriptions are used by addons like ProbeJS to provide typing hints.
- Specified by:
typeInfoin interfaceNumberComponent<NumberComponent.DoubleRange,Double> - Specified by:
typeInfoin interfaceRecipeComponent<Double>- Returns:
- A description of how this component may be constructed
-
wrap
Description copied from interface:RecipeComponentMethod to read the value contained within this component from an input object; this may be some arbitrary value passed into aschema'sconstructor(s) or automatically generated builder methods. By default, it will attempt to type wrap based onRecipeComponent.typeInfo()- Specified by:
wrapin interfaceRecipeComponent<Double>- Parameters:
cx- Script contextfrom- An object to be converted to a value for this component- Returns:
- The value read from the input
-
range
- Specified by:
rangein interfaceNumberComponent<NumberComponent.DoubleRange,Double>
-
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). -
typeOverride
Returns the value of thetypeOverriderecord component.- Returns:
- the value of the
typeOverriderecord component
-
min
Returns the value of theminrecord component.- Specified by:
minin interfaceNumberComponent<NumberComponent.DoubleRange,Double> - Returns:
- the value of the
minrecord component
-
max
Returns the value of themaxrecord component.- Specified by:
maxin interfaceNumberComponent<NumberComponent.DoubleRange,Double> - Returns:
- the value of the
maxrecord component
-