Class DynamicCommandMetadata (0.6.0)

public class DynamicCommandMetadata

DynamicCommandMetadata is a simple POJO for extracting commands which are user-definable and generated at run-time from a user-defined JSON. This class concerns with the population of those JSON objects onto more accessible formats for easier internal handling.

Inheritance

java.lang.Object > DynamicCommandMetadata

Static Methods

fromJSON(JSONObject jsonObject)

public static List<DynamicCommandMetadata> fromJSON(JSONObject jsonObject)

Takes a JSON object and returns a list of metadata objects holding the desired information.

Parameter
NameDescription
jsonObjectorg.json.simple.JSONObject

Input JSON object in the format {"commands": [{"input_pattern": "", "output_pattern": "", "matcher_array": [number1, ...]}, ...]}

Returns
TypeDescription
List<DynamicCommandMetadata>

A list of constructed metadata objects in the format understood by DynamicCommands

Methods

getInputPattern()

public String getInputPattern()
Returns
TypeDescription
String

getMatcherOrder()

public List<String> getMatcherOrder()
Returns
TypeDescription
List<String>

getOutputPattern()

public String getOutputPattern()
Returns
TypeDescription
String