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
Nested Classes Modifier and Type Interface Description static interface
CustomValue.CvArray
Represents anCustomValue.CvType.ARRAY
value.static interface
CustomValue.CvObject
Represents anCustomValue.CvType.OBJECT
value.static class
CustomValue.CvType
The possible types of a custom value. -
Method Summary
Modifier and Type Method Description CustomValue.CvArray
getAsArray()
Returns this value as anCustomValue.CvType.ARRAY
.boolean
getAsBoolean()
Returns this value as aCustomValue.CvType.BOOLEAN
.Number
getAsNumber()
Returns this value as aCustomValue.CvType.NUMBER
.CustomValue.CvObject
getAsObject()
Returns this value as anCustomValue.CvType.OBJECT
.String
getAsString()
Returns this value as aCustomValue.CvType.STRING
.CustomValue.CvType
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
-