Class NumberField
java.lang.Object
com.inet.taskplanner.server.api.field.Field
com.inet.taskplanner.server.api.field.NumberField
A field that takes an integer as input.
The field supports Task Planner placeholders, which must be taken into account.
- Since:
- taskplanner 21.0
-
Constructor Summary
ConstructorsConstructorDescriptionNumberField(String key, String label) Constructs the numeric field.NumberField(String key, String label, List<com.inet.config.structure.model.UnitConfigProperty.Unit> units) Constructs the numeric field, including a list ofUnitConfigProperty.Unitvalues to select from, with automatic recalculation. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisValidValue(String value) Checks whether the supplied value is a valid integer or a placeholder expression in square brackets.patchResultPlaceholderInValue(String value, List<JobResultContainer> results) Overrides this method to replace placeholders with values from the results.patchSeriesPlaceholderInValue(String value, Map<String, String> seriesProperties) Overrides this method to replace placeholders with values from the series.Methods inherited from class Field
getConditions, getKey, getLabel, getPlaceholder, getType, getValue, isUpdateValuesOnChange, isValueSavable, replaceSeriesPlaceholders, setConditions, setKey, setLabel, setPlaceholder, setType, setType, setUpdateValuesOnChange, setValue, setValueSavable
-
Constructor Details
-
NumberField
-
NumberField
public NumberField(String key, String label, List<com.inet.config.structure.model.UnitConfigProperty.Unit> units) Constructs the numeric field, including a list ofUnitConfigProperty.Unitvalues to select from, with automatic recalculation.- Parameters:
key- the key of the fieldlabel- the label of the fieldunits- the definition of the units for this field- Since:
- taskplanner 21.0
-
-
Method Details
-
isValidValue
Checks whether the supplied value is a valid integer or a placeholder expression in square brackets. Anullvalue and values that cannot be parsed as either form are invalid.- Parameters:
value- the value to check.- Returns:
trueif the value is valid.- Since:
- taskplanner 21.0
-
patchResultPlaceholderInValue
Overrides this method to replace placeholders with values from the results.- Overrides:
patchResultPlaceholderInValuein classField- Parameters:
value- the value to be patchedresults- the results that contain the meta properties that are replaced- Returns:
- the new value with replaced placeholders
-
patchSeriesPlaceholderInValue
Overrides this method to replace placeholders with values from the series.- Overrides:
patchSeriesPlaceholderInValuein classField- Parameters:
value- the value to be patchedseriesProperties- properties from the current series set- Returns:
- the new value with replaced placeholders
-