com.kuka.parameters.user.internal
Class UserParameters

java.lang.Object
  extended by com.kuka.parameters.user.internal.UserParameters
All Implemented Interfaces:
IUserParameters

public class UserParameters
extends Object
implements IUserParameters

An implementation of the IUserParameter interface.


Constructor Summary
UserParameters()
          Constructor.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserParameters

public UserParameters()
Constructor. Initializes the internal collection used to store the parameters.

Method Detail

addIntParameter

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

Specified by:
addIntParameter in interface IUserParameters
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.

addLongParameter

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

Specified by:
addLongParameter in interface IUserParameters
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.

addDoubleParameter

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

Specified by:
addDoubleParameter in interface IUserParameters
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.

addStringParameter

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

Specified by:
addStringParameter in interface IUserParameters
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.

addBooleanParameter

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

Specified by:
addBooleanParameter in interface IUserParameters
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.

getIntParameter

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

Specified by:
getIntParameter in interface IUserParameters
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.

getLongParameter

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

Specified by:
getLongParameter in interface IUserParameters
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.

getDoubleParameter

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

Specified by:
getDoubleParameter in interface IUserParameters
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.

getStringParameter

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

Specified by:
getStringParameter in interface IUserParameters
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.

getBooleanParameter

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

Specified by:
getBooleanParameter in interface IUserParameters
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.

getAllParameters

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

Specified by:
getAllParameters in interface IUserParameters
Returns:
A read-only copy of the parameter collection which contains IUserParameter interface implementations.

getParameter

public <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.

Specified by:
getParameter in interface IUserParameters
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.

removeParameter

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

Specified by:
removeParameter in interface IUserParameters
Parameters:
key - The key of the parameter. Must be not null and not empty.
Returns:
The removed parameter (an implementation of the IUserParameter interface).


Copyright © 2019. All rights reserved.