Package me.hsgamer.hscore.action.builder
Interface ActionInput
public interface ActionInput
The input for the
ActionBuilder-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ActionInputCreate an instance ofActionInputfrom the input.static ActionInputCreate an instance ofActionInputGet the optionGet the option as a list.getOptionAsList(String separator) Get the option as a listGet the option as a map.getOptionAsMap(String separator) Get the option as a map.Get the option as a stream.getOptionStream(String separator) Get the option as a streamgetType()Get the typegetValue()Get the value
-
Field Details
-
PATTERN
The pattern to parse the input from the string. The format is:<type>(<option>): <value>. Note that the<option>and<value>are optional. Also, the allowed characters of the<type>are alphanumeric,_,-and$. To get the<type>,<option>and<value>, useMatcher.group(int)with the index 1, 3 and 5 respectively.
-
-
Method Details
-
create
Create an instance ofActionInput- Parameters:
type- the typeoption- the optionvalue- the value- Returns:
- the instance
-
create
Create an instance ofActionInputfrom the input. It will use thePATTERNto parse the input. If the input doesn't match the pattern, it will use the input as the value.- Parameters:
input- the input- Returns:
- the instance
- See Also:
-
getType
String getType()Get the type- Returns:
- the type
-
getOption
String getOption()Get the option- Returns:
- the option
-
getValue
String getValue()Get the value- Returns:
- the value
-
getOptionStream
Get the option as a stream- Parameters:
separator- the separator- Returns:
- the list
-
getOptionStream
Get the option as a stream. The format isvalue,value- Returns:
- the list
- See Also:
-
getOptionAsList
Get the option as a list- Parameters:
separator- the separator- Returns:
- the list
- See Also:
-
getOptionAsList
Get the option as a list. The format isvalue,value- Returns:
- the list
- See Also:
-
getOptionAsMap
Get the option as a map. The map format iskey=value- Parameters:
separator- the separator- Returns:
- the map
- See Also:
-
getOptionAsMap
Get the option as a map. The format iskey=value,key=value- Returns:
- the map
- See Also:
-