Class Transformation
java.lang.Object
org.openhab.core.transform.actions.Transformation
This class holds static "action" methods that can be used from within rules to execute
transformations.
- Author:
- Kai Kreuzer - Initial contribution
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Transformation
public Transformation()
-
-
Method Details
-
transform
Applies a transformation of a given type with some function to a value.- Parameters:
type
- the transformation type, e.g. REGEX or MAPfunction
- the function to call, this value depends on the transformation typevalue
- the value to apply the transformation to- Returns:
- the transformed value or the original one, if there was no service registered for the given type or a transformation exception occurred.
-
transformRaw
public static @Nullable String transformRaw(String type, String function, String value) throws TransformationException Applies a transformation of a given type with some function to a value.- Parameters:
type
- the transformation type, e.g. REGEX or MAPfunction
- the function to call, this value depends on the transformation typevalue
- the value to apply the transformation to- Returns:
- the transformed value
- Throws:
TransformationException
-