Package net.fabricmc.loader.api.metadata
Interface CustomValue
- All Known Subinterfaces:
CustomValue.CvArray
,CustomValue.CvObject
public interface CustomValue
Represents a custom value in the
fabric.mod.json
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents anCustomValue.CvType.ARRAY
value.static interface
Represents anCustomValue.CvType.OBJECT
value.static enum
The possible types of a custom value. -
Method Summary
Modifier and TypeMethodDescriptionReturns this value as anCustomValue.CvType.ARRAY
.boolean
Returns this value as aCustomValue.CvType.BOOLEAN
.Returns this value as aCustomValue.CvType.NUMBER
.Returns this value as anCustomValue.CvType.OBJECT
.Returns this value as aCustomValue.CvType.STRING
.getType()
Returns the type of the value.
-
Method Details
-
getType
CustomValue.CvType getType()Returns the type of the value. -
getAsObject
CustomValue.CvObject getAsObject()Returns this value as anCustomValue.CvType.OBJECT
.- Returns:
- this value
- Throws:
ClassCastException
- if this value is not an object
-
getAsArray
CustomValue.CvArray getAsArray()Returns this value as anCustomValue.CvType.ARRAY
.- Returns:
- this value
- Throws:
ClassCastException
- if this value is not an array
-
getAsString
String getAsString()Returns this value as aCustomValue.CvType.STRING
.- Returns:
- this value
- Throws:
ClassCastException
- if this value is not a string
-
getAsNumber
Number getAsNumber()Returns this value as aCustomValue.CvType.NUMBER
.- Returns:
- this value
- Throws:
ClassCastException
- if this value is not a number
-
getAsBoolean
boolean getAsBoolean()Returns this value as aCustomValue.CvType.BOOLEAN
.- Returns:
- this value
- Throws:
ClassCastException
- if this value is not a boolean
-