Class AbstractSynchronousTransform
java.lang.Object
com.inductiveautomation.perspective.gateway.binding.transforms.AbstractSynchronousTransform
- All Implemented Interfaces:
Transform
- Direct Known Subclasses:
AbstractMapTransform
,ScriptTransform
An
Transform
which takes care of wrapping a blocking transform operation in a
CompletableFuture
. Implementations only need to override
synchronousTransformInternal(QualifiedValue)
to process their blocking transform work.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract QualifiedValue
Perform a blocking transformation on aQualifiedValue
, returning the transformed value as a QualifiedValue.transform
(QualifiedValue value) When the binding or previous transform emits a value, it will be given to this method.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.Transform
resolveReferences, shutdown, startup
-
Constructor Details
-
AbstractSynchronousTransform
public AbstractSynchronousTransform()
-
-
Method Details
-
synchronousTransformInternal
protected abstract QualifiedValue synchronousTransformInternal(@Nonnull QualifiedValue value) throws Throwable Perform a blocking transformation on aQualifiedValue
, returning the transformed value as a QualifiedValue.- Parameters:
value
- The input value to transform. The value will never be null.- Returns:
- The transformed value.
- Throws:
Throwable
- If there is any Exception or Error in the transformation.
-
transform
Description copied from interface:Transform
When the binding or previous transform emits a value, it will be given to this method. The expectation is that the transform will then push the transformed value onto the callback given to it in the factory- Specified by:
transform
in interfaceTransform
- Parameters:
value
- The input value to theTransform
. It could be the output value of the binding itself if the transform is first in the chain, or it could be a transformed value if it is after the first in the chain. The inputQualifiedValue
can never be null (though the value it wraps can be null)- Throws:
Throwable
- If there is a problem with the transformation
-