com.kuka.common.params
Interface IParameterSet

All Superinterfaces:
Iterable<IParameter<?>>
All Known Implementing Classes:
AbstractParameterSet, ParameterSet

public interface IParameterSet
extends Iterable<IParameter<?>>

Represents a set of parameters.

This element is not in its final state and might change in future versions.

Method Summary
 IParameterSet combine(IParameterSet other)
          Combines this parameter set with another set and returns the resulting set.
<T extends IParameter<?>>
boolean
contains(Class<T> paramType)
          Determines if this set contains the given parameter.
 boolean isEmpty()
          Checks whether this parameter set is empty.
 Iterator<IParameter<?>> iterator()
           
 String name()
          Gets the name of this parameter set.
<T extends IParameter<?>>
T
optionalParameter(Class<T> paramType)
          Gets the parameter with the specified name.
<V,W extends V,T extends IParameter<V>>
V
optionalValue(Class<T> paramType, W defaultValue)
          Gets the parameter with the specified name.
 int paramCount()
          Gets the number of parameters in the set.
<T extends IParameter<?>>
T
requiredParameter(Class<T> paramType)
          Gets the parameter with the specified name.
<V,T extends IParameter<V>>
V
requiredValue(Class<T> paramType)
          Gets the parameter with the specified name.
 

Method Detail

name

String name()
Gets the name of this parameter set.

Returns:
The name of this parameter set. Can be null.

optionalParameter

<T extends IParameter<?>> T optionalParameter(Class<T> paramType)
Gets the parameter with the specified name. Returns null if the parameter was not found.

Type Parameters:
T - parameter type
Parameters:
paramType - The parameter type class object.
Returns:
The parameter value or null.

optionalValue

<V,W extends V,T extends IParameter<V>> V optionalValue(Class<T> paramType,
                                                        W defaultValue)
Gets the parameter with the specified name. Returns the given default value if no parameter was found.

Type Parameters:
V - value supertype
W - value type
T - parameter type
Parameters:
paramType - The parameter type class object.
defaultValue - The default value which is returned when no parameter was found.
Returns:
The parameter value or the default value.

requiredParameter

<T extends IParameter<?>> T requiredParameter(Class<T> paramType)
Gets the parameter with the specified name. Fails if the parameter was not found.

Type Parameters:
T - parameter type
Parameters:
paramType - The parameter type class object.
Returns:
The parameter with the specified name.
Throws:
NullPointerException - if paramType is null
NoSuchElementException - if the required parameter does not exists in the set

requiredValue

<V,T extends IParameter<V>> V requiredValue(Class<T> paramType)
Gets the parameter with the specified name. Fails if the parameter was not found.

Type Parameters:
T - parameter type
V - value type
Parameters:
paramType - The parameter type class object.
Returns:
The parameter with the specified name.
Throws:
NullPointerException - if paramType is null
NoSuchElementException - if the required parameter does not exists in the set

contains

<T extends IParameter<?>> boolean contains(Class<T> paramType)
Determines if this set contains the given parameter.

Type Parameters:
T - parameter type
Parameters:
paramType - The parameter type class object.
Returns:
True if this set contains the specified parameter.

isEmpty

boolean isEmpty()
Checks whether this parameter set is empty.

Returns:
True if this set is empty, false otherwise.

iterator

Iterator<IParameter<?>> iterator()
Specified by:
iterator in interface Iterable<IParameter<?>>

combine

IParameterSet combine(IParameterSet other)
Combines this parameter set with another set and returns the resulting set. The order of the sets is important: Parameters in the primary sets take precedence over parameters in the second set.

Parameters:
other - The other set
Returns:
A new, combined set.

paramCount

int paramCount()
Gets the number of parameters in the set.

Returns:
the number of parameters in the set.


Copyright © 2019. All rights reserved.