com.kuka.parameters.user
Interface IUserParameters

All Known Implementing Classes:
UserParameters

public interface IUserParameters

An interface responsible for user parameter collection handling.

All methods of this interface are thread-safe.


Method Summary
 IUserParameter<Boolean> addBooleanParameter(String key, Boolean value)
          Adds a new boolean parameter to the collection.
 IUserParameter<Double> addDoubleParameter(String key, Double value)
          Adds a new double parameter to the collection.
 IUserParameter<Integer> addIntParameter(String key, Integer value)
          Adds a new integer parameter to the collection.
 IUserParameter<Long> addLongParameter(String key, Long value)
          Adds a new long parameter to the collection.
 IUserParameter<String> addStringParameter(String key, String value)
          Adds a new string parameter to the collection.
 Collection<IUserParameter<?>> getAllParameters()
          Returns all parameters from the collection as a read-only snapshot copy.
 IUserParameter<Boolean> getBooleanParameter(String key)
          Returns a boolean parameter from the collection.
 IUserParameter<Double> getDoubleParameter(String key)
          Returns a double parameter from the collection.
 IUserParameter<Integer> getIntParameter(String key)
          Returns an integer parameter from the collection.
 IUserParameter<Long> getLongParameter(String key)
          Returns a long parameter from the collection.
<T> IUserParameter<T>
getParameter(String key, Class<T> type)
          Returns a parameter - an IUserParameter interface implementation instance - identified by the given key.
 IUserParameter<String> getStringParameter(String key)
          Returns a string parameter from the collection.
 IUserParameter<?> removeParameter(String key)
          Removes a parameter from the collection.
 

Method Detail

addIntParameter

IUserParameter<Integer> addIntParameter(String key,
                                        Integer value)
Adds a new integer parameter to the collection.

Parameters:
key - The key of the parameter. Must be unique in the context of this collection.
value - The value of the parameter.
Returns:
The newly added parameter as a IUserParameter implementation instance.
Throws:
IllegalArgumentException - If the key is null or empty. If the key is already exists in the collection.

addLongParameter

IUserParameter<Long> addLongParameter(String key,
                                      Long value)
Adds a new long parameter to the collection.

Parameters:
key - The key of the parameter. Must be unique in the context of this collection.
value - The value of the parameter.
Returns:
The newly added parameter as a IUserParameter implementation instance.
Throws:
IllegalArgumentException - If the key is null or empty. If the key is already exists in the collection.

addDoubleParameter

IUserParameter<Double> addDoubleParameter(String key,
                                          Double value)
Adds a new double parameter to the collection.

Parameters:
key - The key of the parameter. Must be unique in the context of this collection.
value - The value of the parameter.
Returns:
The newly added parameter as a IUserParameter implementation instance.
Throws:
IllegalArgumentException - If the key is null or empty. If the key is already exists in the collection.

addStringParameter

IUserParameter<String> addStringParameter(String key,
                                          String value)
Adds a new string parameter to the collection.

Parameters:
key - The key of the parameter. Must be unique in the context of this collection.
value - The value of the parameter.
Returns:
The newly added parameter as a IUserParameter implementation instance.
Throws:
IllegalArgumentException - If the key is null or empty. If the key is already exists in the collection.

addBooleanParameter

IUserParameter<Boolean> addBooleanParameter(String key,
                                            Boolean value)
Adds a new boolean parameter to the collection.

Parameters:
key - The key of the parameter. Must be unique in the context of this collection.
value - The value of the parameter.
Returns:
The newly added parameter as a IUserParameter implementation instance.
Throws:
IllegalArgumentException - If the key is null or empty. If the key is already exists in the collection.

getIntParameter

IUserParameter<Integer> getIntParameter(String key)
Returns an integer parameter from the collection.

Parameters:
key - The key of the parameter.
Returns:
The parameter specified with the given key, null if the parameter could not be found by key. The type of the parameter is an instance of the IUserParameter interface.
Throws:
IllegalArgumentException - If the key is null or empty. If the parameter's type specified by the given key is not Integer.class.

getLongParameter

IUserParameter<Long> getLongParameter(String key)
Returns a long parameter from the collection.

Parameters:
key - The key of the parameter.
Returns:
The parameter specified with the given key, null if the parameter could not be found by key. The type of the parameter is an instance of the IUserParameter interface.
Throws:
IllegalArgumentException - If the key is null or empty. If the parameter's type specified by the given key is not Long.class.

getDoubleParameter

IUserParameter<Double> getDoubleParameter(String key)
Returns a double parameter from the collection.

Parameters:
key - The key of the parameter.
Returns:
The parameter specified with the given key, null if the parameter could not be found by key. The type of the parameter is an instance of the IUserParameter interface.
Throws:
IllegalArgumentException - If the key is null or empty. If the parameter's type specified by the given key is not Double.class.

getStringParameter

IUserParameter<String> getStringParameter(String key)
Returns a string parameter from the collection.

Parameters:
key - The key of the parameter.
Returns:
The parameter specified with the given key, null if the parameter could not be found by key. The type of the parameter is an instance of the IUserParameter interface.
Throws:
IllegalArgumentException - If the key is null or empty. If the parameter's type specified by the given key is not String.class.

getBooleanParameter

IUserParameter<Boolean> getBooleanParameter(String key)
Returns a boolean parameter from the collection.

Parameters:
key - The key of the parameter.
Returns:
The parameter specified with the given key, null if the parameter could not be found by key. The type of the parameter is an instance of the IUserParameter interface.
Throws:
IllegalArgumentException - If the key is null or empty. If the parameter's type specified by the given key is not Boolean.class.

getAllParameters

Collection<IUserParameter<?>> getAllParameters()
Returns all parameters from the collection as a read-only snapshot copy.

Returns:
A read-only copy of the parameter collection which contains IUserParameter interface implementations.

getParameter

<T> IUserParameter<T> getParameter(String key,
                                   Class<T> type)
Returns a parameter - an IUserParameter interface implementation instance - identified by the given key. No exception will be thrown if the parameter specified by the key does not exists in the collection.

Type Parameters:
T - The generic type of the parameter.
Parameters:
key - The key of the parameter. Must be not null and not empty.
type - The type of the parameter. Might be null.
Returns:
The parameter specified by the given key, null if the parameter could not be found by key.
Throws:
IllegalArgumentException - If the key is null or empty. If the parameter's type specified by the given key does not match the given type.

removeParameter

IUserParameter<?> removeParameter(String key)
Removes a parameter from the collection.

Parameters:
key - The key of the parameter. Must be not null and not empty.
Returns:
The removed parameter (an implementation of the IUserParameter interface).
Throws:
IllegalArgumentException - If the key is null or empty.


Copyright © 2019. All rights reserved.