- All Known Implementing Classes:
net.foxgenesis.property.lck.impl.BlobMapping,PluginPropertyMapping
public interface PropertyMapping
Interface defining method of parsing a property value into a usable data
type.
- Author:
- Ashley
-
Method Summary
Modifier and TypeMethodDescriptionbooleanParse this property value as a boolean.boolean[]Parse this property value as an array of booleans.byte[]Parse this property value as an array of bytes.doubleParse this property value as a double.double[]Parse this property value as an array of doubles.floatParse this property value as a float.float[]Parse this property value as an array of floats.intgetAsInt()Parse this property value as an integer.int[]Parse this property value as an array of integers.longParse this property value as a long.long[]Parse this property value as an array of longs.Parse this property value as a serialized object.Parse this property as plain text.Parse this property value as a string of text.String[]Parse this property value as an array of strings.longGet the size of this property value.getType()Get storage type of this property.default booleanCheck if this property is stored as plain text.default booleanCheck if this property can be displayed in a user readable format.static <U> Ustatic <U> U[]unjoin(String text, Function<String, U> mapper, IntFunction<U[]> construct) static boolean[]unjoinBoolean(String text) static byte[]unjoinByte(String text) static double[]unjoinDouble(String text) static float[]unjoinFloat(String text) static int[]static long[]unjoinLong(String text)
-
Method Details
-
getAsPlainText
String getAsPlainText()Parse this property as plain text.- Returns:
- Returns the property value as it is inside the configuration
-
getAsObject
Object getAsObject()Parse this property value as a serialized object.- Returns:
- Returns the serialized object
-
getAsString
String getAsString()Parse this property value as a string of text.- Returns:
- Returns the value as a string
-
getAsBoolean
boolean getAsBoolean()Parse this property value as a boolean.- Returns:
- Returns the parsed boolean
-
getAsInt
int getAsInt()Parse this property value as an integer.- Returns:
- Returns the parsed integer
-
getAsFloat
float getAsFloat()Parse this property value as a float.- Returns:
- Returns the parsed float
-
getAsDouble
double getAsDouble()Parse this property value as a double.- Returns:
- Returns the parsed double.
-
getAsLong
long getAsLong()Parse this property value as a long.- Returns:
- Returns the parsed long.
-
getAsStringArray
String[] getAsStringArray()Parse this property value as an array of strings.- Returns:
- Returns the parsed string array
-
getAsBooleanArray
boolean[] getAsBooleanArray()Parse this property value as an array of booleans.- Returns:
- Returns the parsed boolean array
-
getAsByteArray
byte[] getAsByteArray()Parse this property value as an array of bytes.- Returns:
- Returns the parsed byte array
-
getAsIntegerArray
int[] getAsIntegerArray()Parse this property value as an array of integers.- Returns:
- Returns the parsed integer array
-
getAsFloatArray
float[] getAsFloatArray()Parse this property value as an array of floats.- Returns:
- Returns the parsed float array
-
getAsDoubleArray
double[] getAsDoubleArray()Parse this property value as an array of doubles.- Returns:
- Returns the parsed double array
-
getAsLongArray
long[] getAsLongArray()Parse this property value as an array of longs.- Returns:
- Returns the parsed long array
-
getType
PropertyType getType()Get storage type of this property.- Returns:
- Returns a
PropertyTypethat defines how a property should be stored inside the configuration
-
getLength
long getLength()Get the size of this property value.- Returns:
- Returns a long representing how large this property is
-
isUserReadable
default boolean isUserReadable()Check if this property can be displayed in a user readable format.- Returns:
- Returns
trueif this property can be displayed to the user.falseotherwise.
-
isPlainText
default boolean isPlainText()Check if this property is stored as plain text.- Returns:
- Returns
trueif this property is stored without any additional modifications to it
-
unjoinByte
-
unjoinBoolean
-
unjoinInt
-
unjoinFloat
-
unjoinDouble
-
unjoinLong
-
unjoin
-
parse
- Throws:
PropertyException
-