-
- All Superinterfaces:
NlsArgumentsKeys
public interface NlsArguments extends NlsArgumentsKeys
A simple container forargument
s used asdynamic arguments
of aNlsMessage
. It is similar toMap
but 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
key
ornull
if 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:
true
if empty (size
is0
).
-
with
NlsArguments with(String key, Object value)
- Parameters:
key
- the key of the argument.value
- thevalue
of the argument.- Returns:
- the new
NlsArguments
extended with the given argument.
-
of
static NlsArguments of()
- Returns:
- an empty instance of
NlsArguments
.
-
of
static NlsArguments of(Map<String,Object> map)
- Parameters:
map
- theMap
with the arguments to wrap.- Returns:
- an instance of
NlsArguments
that delegates to the givenMap
.
-
of
static NlsArguments of(String key, Object value)
- Parameters:
key
- the key of the argument.value
- thevalue
of the argument.- Returns:
- an instance of
NlsArguments
containing 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
- thevalue
of the first argument.key2
- the key of the second argument.value2
- thevalue
of the second argument.- Returns:
- an instance of
NlsArguments
containing 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
- thevalue
of the first argument.key2
- the key of the second argument.value2
- thevalue
of the second argument.key3
- the key of the third argument.value3
- thevalue
of the third argument.- Returns:
- an instance of
NlsArguments
containing the single specified arguments.
-
ofValue
static NlsArguments ofValue(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_VALUE
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofObject
static NlsArguments ofObject(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_OBJECT
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofArgument
static NlsArguments ofArgument(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_ARGUMENT
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofDefault
static NlsArguments ofDefault(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_DEFAULT
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofDate
static NlsArguments ofDate(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_DATE
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofFile
static NlsArguments ofFile(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_FILE
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofName
static NlsArguments ofName(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_NAME
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofType
static NlsArguments ofType(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_TYPE
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofFormat
static NlsArguments ofFormat(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_FORMAT
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofKey
static NlsArguments ofKey(Object value)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_KEY
.- Returns:
- an instance of
NlsArguments
containing the single specified argument.
-
ofKeyValue
static NlsArguments ofKeyValue(Object key, Object value)
- Parameters:
key
- thevalue
forNlsArgumentsKeys.KEY_KEY
.value
- thevalue
forNlsArgumentsKeys.KEY_VALUE
.- Returns:
- an instance of
NlsArguments
containing the single specified arguments.
-
ofObjectKey
static NlsArguments ofObjectKey(Object object, Object key)
- Parameters:
object
- thevalue
forNlsArgumentsKeys.KEY_OBJECT
.key
- thevalue
forNlsArgumentsKeys.KEY_KEY
.- Returns:
- an instance of
NlsArguments
containing the single specified arguments.
-
ofMinMax
static NlsArguments ofMinMax(Object min, Object max)
- Parameters:
min
- thevalue
forNlsArgumentsKeys.KEY_MIN
.max
- thevalue
forNlsArgumentsKeys.KEY_MAX
.- Returns:
- an instance of
NlsArguments
containing the single specified arguments.
-
ofValueMinMax
static NlsArguments ofValueMinMax(Object value, Object min, Object max)
- Parameters:
value
- thevalue
forNlsArgumentsKeys.KEY_VALUE
.min
- thevalue
forNlsArgumentsKeys.KEY_MIN
.max
- thevalue
forNlsArgumentsKeys.KEY_MAX
.- Returns:
- an instance of
NlsArguments
containing the single specified arguments.
-
-