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 interfaceCustomValue.CvArrayRepresents anCustomValue.CvType.ARRAYvalue.static interfaceCustomValue.CvObjectRepresents anCustomValue.CvType.OBJECTvalue.static classCustomValue.CvTypeThe possible types of a custom value. -
Method Summary
Modifier and Type Method Description CustomValue.CvArraygetAsArray()Returns this value as anCustomValue.CvType.ARRAY.booleangetAsBoolean()Returns this value as aCustomValue.CvType.BOOLEAN.NumbergetAsNumber()Returns this value as aCustomValue.CvType.NUMBER.CustomValue.CvObjectgetAsObject()Returns this value as anCustomValue.CvType.OBJECT.StringgetAsString()Returns this value as aCustomValue.CvType.STRING.CustomValue.CvTypegetType()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
-