Class FieldChangeTrigger<S,T>
- java.lang.Object
-
- org.esa.snap.ui.tooladapter.dialogs.components.FieldChangeTrigger<S,T>
-
- Type Parameters:
S- The source field typeT- The target field type
- All Implemented Interfaces:
Function<S,T>
public class FieldChangeTrigger<S,T> extends Object implements Function<S,T>
Models a relation between two entity fields such that, if one field changes, the other may change based on the new value of the first field.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tapply(S input)booleancanApply(S input)static <K,V>
FieldChangeTrigger<K,V>create(String fieldName, Function<K,V> action)Creates a field change trigger with just an action.static <K,V>
FieldChangeTrigger<K,V>create(String fieldName, Function<K,V> action, Predicate<K> condition)Creates a field change trigger with an action that will execute based on a condition.StringgetTargetFieldName()Returns the target field name
-
-
-
Method Detail
-
create
public static <K,V> FieldChangeTrigger<K,V> create(String fieldName, Function<K,V> action)
Creates a field change trigger with just an action.- Type Parameters:
K- The source field typeV- The target field type- Parameters:
fieldName- The target field nameaction- The action that will set the target
-
create
public static <K,V> FieldChangeTrigger<K,V> create(String fieldName, Function<K,V> action, Predicate<K> condition)
Creates a field change trigger with an action that will execute based on a condition.- Type Parameters:
K- The source field typeV- The target field type- Parameters:
fieldName- The target field nameaction- The action that may set the targetcondition- The condition to check before performing the action
-
getTargetFieldName
public String getTargetFieldName()
Returns the target field name
-
canApply
public boolean canApply(S input)
-
-