com.kuka.parameters
Interface IParameterMap

All Superinterfaces:
IParameter, Iterable<Map.Entry<String,IParameter>>

public interface IParameterMap
extends IParameter, Iterable<Map.Entry<String,IParameter>>

Represents a map containing all parameter of a IParameterizable object.

Represents a map with strings as keys and IParameter objects as values and should fully describe a parameterizable object.
Identified via type of parameterizable object - see getType()

The implementation is not required to be thread safe.


Method Summary
 void clear()
          Deletes the whole contenst of the map.
 boolean contains(String key)
          Returns true if this parameter map contains a parameter with the specified key.
 IParameterMap copy()
          Creates the deep copy of the map.
 IParameter get(String key)
          Gets a parameter stored in the map under the specified key.
<T extends IParameter>
T
get(String key, Class<T> clazz)
          Gets the parameter of the specified class associated with the specified key.
 Class<? extends IParameterizable> getType()
          Gets a type of the map - class of the parameterizable object which configuration is contained in the map.
 void put(String key, IParameter parameter)
          Stores the specified parameter under the specified key in the map.
 IParameter remove(String key)
          Removes the parameter assigned to the specified key from the map.
 IParameter replace(String key, IParameter param)
          Replaces the parameter stored in the map under the specified key with the specified parameter instance.
 int size()
          Gets the number of parameters in the map.
 IParameter tryGet(String key)
          Gets the parameter associated with the specified key.
<T extends IParameter>
T
tryGet(String key, Class<T> clazz)
          Gets the parameter of the specified class associated with the specified key.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getType

Class<? extends IParameterizable> getType()
Gets a type of the map - class of the parameterizable object which configuration is contained in the map.

Returns:
class of the parameterizable object.

contains

boolean contains(String key)
Returns true if this parameter map contains a parameter with the specified key.

Parameters:
key - parameter id in the map
Returns:
true if this parameter map contains the specified parameter

get

IParameter get(String key)
Gets a parameter stored in the map under the specified key.

Parameters:
key - parameter id in the map.
Returns:
parameter associated with the specified key.
Throws:
IllegalArgumentException - if the key not found in the map or is null.

put

void put(String key,
         IParameter parameter)
Stores the specified parameter under the specified key in the map.

Parameters:
key - key assigned to the stored parameter
parameter - parameter to store
Throws:
IllegalArgumentException - if the specified key is already contained in the map or is null.

remove

IParameter remove(String key)
Removes the parameter assigned to the specified key from the map.

Parameters:
key - key of the parameter to remove
Returns:
removed parameter
Throws:
IllegalArgumentException - if key does not exist or is null

clear

void clear()
Deletes the whole contenst of the map.


size

int size()
Gets the number of parameters in the map.

Returns:
the number of parameters in the map.

copy

IParameterMap copy()
Creates the deep copy of the map.

Specified by:
copy in interface IParameter
Returns:
the map containing the same parameters as this one.

tryGet

IParameter tryGet(String key)
Gets the parameter associated with the specified key. Does not throw exception if key was not found.

Parameters:
key - parameter id in the map
Returns:
parameter associated with the specified key or null, if the key was not found in the map.

tryGet

<T extends IParameter> T tryGet(String key,
                                Class<T> clazz)
Gets the parameter of the specified class associated with the specified key. Does not throw exception if key was not found.

Type Parameters:
T - type of the requested parameter
Parameters:
key - parameter id in the map
clazz - class of the parameter that should be returned.This class must be exactly the same as the class of the requested parameter.
Returns:
parameter associated with the specified key or null, if the key was not found in the map.
Throws:
IllegalArgumentException - if the parameter associated with the specified key is not of the specified class, or if key or clazz are null

get

<T extends IParameter> T get(String key,
                             Class<T> clazz)
Gets the parameter of the specified class associated with the specified key.

Type Parameters:
T - type of the requested parameter
Parameters:
key - parameter id in the map
clazz - class of the parameter that should be returned.This class must be exactly the same as the class of the requested parameter.
Returns:
parameter associated with the specified key or null, if the key was not found in the map.
Throws:
IllegalArgumentException - if the parameter associated with the specified key is not of the specified class, key not found or if key or clazz are null

replace

IParameter replace(String key,
                   IParameter param)
Replaces the parameter stored in the map under the specified key with the specified parameter instance.

If no parameter is stored under the specified key just puts the parameter into the map under that key.

Parameters:
key - key of the parameter to replace
param - parameter to replace the existing parameter with.
Returns:
parameter that was replaced or null if no parameter was replaced


Copyright © 2019. All rights reserved.