SMILA (incubation) API documentation

org.eclipse.smila.jobmanager.internal
Class AccessAny

java.lang.Object
  extended by org.eclipse.smila.jobmanager.internal.AccessAny

public final class AccessAny
extends java.lang.Object

Some job manager related helper methods to deal with Any and their Exception handling.


Field Summary
static DataFactory FACTORY
          factory for Any.
 
Method Summary
static Any get(AnyMap any, java.lang.String fieldName, Any.ValueType fieldType)
          get a field value from a Map and check that it has an expected type.
static java.lang.String getString(AnyMap any, java.lang.String fieldName)
          get a string from a Map.
static java.lang.String getStringRequired(AnyMap any, java.lang.String fieldName)
          like #getString(Any, String), but throw an exception if the field does not exists.
static java.util.List<java.lang.String> getStringSeq(AnyMap any, java.lang.String fieldName)
          get list of strings from a field of the any.
static ValueExpression getValueExpression(AnyMap any, java.lang.String fieldName)
          get a value expression from a Map.
static ValueExpression getValueExpressionRequired(AnyMap any, java.lang.String fieldName)
          like #getValueExpression(Any, String), but throw an exception if the field does not exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY

public static final DataFactory FACTORY
factory for Any.

Method Detail

get

public static Any get(AnyMap any,
                      java.lang.String fieldName,
                      Any.ValueType fieldType)
               throws InvalidConfigException
get a field value from a Map and check that it has an expected type.

Parameters:
any - a map any.
fieldName - key.
fieldType - expected field type
Returns:
the value for the key or null if it doesn't exist.
Throws:
InvalidConfigException - any is not a map, value does not have expected type or error accessing any.

getValueExpression

public static ValueExpression getValueExpression(AnyMap any,
                                                 java.lang.String fieldName)
                                          throws InvalidConfigException
get a value expression from a Map.

Parameters:
any - a map any.
fieldName - key.
Returns:
the value expression for the key or null if it doesn't exist.
Throws:
InvalidConfigException - any is not a map, value is not a string or error accessing any.

getString

public static java.lang.String getString(AnyMap any,
                                         java.lang.String fieldName)
                                  throws InvalidConfigException
get a string from a Map.

Parameters:
any - a map any.
fieldName - key.
Returns:
the string for the key or null if it doesn't exist.
Throws:
InvalidConfigException - any is not a map, value is not a string or error accessing any.

getValueExpressionRequired

public static ValueExpression getValueExpressionRequired(AnyMap any,
                                                         java.lang.String fieldName)
                                                  throws InvalidConfigException
like #getValueExpression(Any, String), but throw an exception if the field does not exists.

Parameters:
any - a map any.
fieldName - key.
Returns:
the value expression for the key.
Throws:
InvalidConfigException - any is not a map, value does not exists or is not a string or error accessing any.

getStringRequired

public static java.lang.String getStringRequired(AnyMap any,
                                                 java.lang.String fieldName)
                                          throws InvalidConfigException
like #getString(Any, String), but throw an exception if the field does not exists.

Parameters:
any - a map any.
fieldName - key.
Returns:
the string for the key.
Throws:
InvalidConfigException - any is not a map, value does not exists or is not a string or error accessing any.

getStringSeq

public static java.util.List<java.lang.String> getStringSeq(AnyMap any,
                                                            java.lang.String fieldName)
                                                     throws InvalidConfigException
get list of strings from a field of the any.

Parameters:
any - a map any.
fieldName - key.
Returns:
the list of strings or null if the field does not exists.
Throws:
InvalidConfigException - any is not a map, value is not an sequence of strings or error accessing any.

SMILA (incubation) API documentation