-
- All Superinterfaces:
NlsArgumentsKeys
public interface NlsArguments extends NlsArgumentsKeys
A simple container forarguments used asdynamic argumentsof aNlsMessage. It is similar toMapbut with less overhead in case there are only up to two arguments.
This interface provides many staticof*methods to create instances ofNlsArguments.- See Also:
NlsMessage.getArgument(String),NlsVariable
-
-
Field Summary
-
Fields inherited from interface io.github.mmm.nls.argument.NlsArgumentsKeys
KEY_ANNOTATION, KEY_ARGUMENT, KEY_CAPACITY, KEY_CONTAINER, KEY_DATE, KEY_DEFAULT, KEY_DIRECTORY, KEY_ERROR, KEY_EXISTING, KEY_EXPECTED, KEY_FILE, KEY_FORMAT, KEY_FUNCTION, KEY_ID, KEY_KEY, KEY_LOCATION, KEY_MAX, KEY_MIN, KEY_MODE, KEY_NAME, KEY_OBJECT, KEY_OPERATION, KEY_OPTION, KEY_PATH, KEY_PROPERTY, KEY_QUERY, KEY_RESOURCE, KEY_SIZE, KEY_SOURCE, KEY_TARGET_TYPE, KEY_TITLE, KEY_TYPE, KEY_URI, KEY_USER, KEY_VALUE
-
-
Method Summary
-
-
-
Method Detail
-
get
Object get(String key)
- Parameters:
key- the key of the argument to get. Please prefer one of theKEY_*constants such asNlsArgumentsKeys.KEY_VALUE.- Returns:
- the value of the argument with the given
keyornullif no such argument exists. - See Also:
Map.get(Object)
-
getKey
String getKey(int index)
-
size
int size()
- Returns:
- the number of arguments.
-
isEmpty
default boolean isEmpty()
- Returns:
trueif empty (sizeis0).
-
with
NlsArguments with(String key, Object value)
- Parameters:
key- the key of the argument.value- thevalueof the argument.- Returns:
- the new
NlsArgumentsextended with the given argument.
-
of
static NlsArguments of()
- Returns:
- an empty instance of
NlsArguments.
-
of
static NlsArguments of(Map<String,Object> map)
- Parameters:
map- theMapwith the arguments to wrap.- Returns:
- an instance of
NlsArgumentsthat delegates to the givenMap.
-
of
static NlsArguments of(String key, Object value)
- Parameters:
key- the key of the argument.value- thevalueof the argument.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
of
static NlsArguments of(String key1, Object value1, String key2, Object value2)
- Parameters:
key1- the key of the first argument.value1- thevalueof the first argument.key2- the key of the second argument.value2- thevalueof the second argument.- Returns:
- an instance of
NlsArgumentscontaining the single specified arguments.
-
of
static NlsArguments of(String key1, Object value1, String key2, Object value2, String key3, Object value3)
- Parameters:
key1- the key of the first argument.value1- thevalueof the first argument.key2- the key of the second argument.value2- thevalueof the second argument.key3- the key of the third argument.value3- thevalueof the third argument.- Returns:
- an instance of
NlsArgumentscontaining the single specified arguments.
-
ofValue
static NlsArguments ofValue(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_VALUE.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofObject
static NlsArguments ofObject(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_OBJECT.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofArgument
static NlsArguments ofArgument(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_ARGUMENT.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofDefault
static NlsArguments ofDefault(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_DEFAULT.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofDate
static NlsArguments ofDate(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_DATE.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofFile
static NlsArguments ofFile(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_FILE.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofName
static NlsArguments ofName(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_NAME.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofType
static NlsArguments ofType(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_TYPE.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofFormat
static NlsArguments ofFormat(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_FORMAT.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofKey
static NlsArguments ofKey(Object value)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_KEY.- Returns:
- an instance of
NlsArgumentscontaining the single specified argument.
-
ofKeyValue
static NlsArguments ofKeyValue(Object key, Object value)
- Parameters:
key- thevalueforNlsArgumentsKeys.KEY_KEY.value- thevalueforNlsArgumentsKeys.KEY_VALUE.- Returns:
- an instance of
NlsArgumentscontaining the single specified arguments.
-
ofObjectKey
static NlsArguments ofObjectKey(Object object, Object key)
- Parameters:
object- thevalueforNlsArgumentsKeys.KEY_OBJECT.key- thevalueforNlsArgumentsKeys.KEY_KEY.- Returns:
- an instance of
NlsArgumentscontaining the single specified arguments.
-
ofMinMax
static NlsArguments ofMinMax(Object min, Object max)
- Parameters:
min- thevalueforNlsArgumentsKeys.KEY_MIN.max- thevalueforNlsArgumentsKeys.KEY_MAX.- Returns:
- an instance of
NlsArgumentscontaining the single specified arguments.
-
ofValueMinMax
static NlsArguments ofValueMinMax(Object value, Object min, Object max)
- Parameters:
value- thevalueforNlsArgumentsKeys.KEY_VALUE.min- thevalueforNlsArgumentsKeys.KEY_MIN.max- thevalueforNlsArgumentsKeys.KEY_MAX.- Returns:
- an instance of
NlsArgumentscontaining the single specified arguments.
-
-