Class FloatField

java.lang.Object
com.inet.taskplanner.server.api.field.Field
com.inet.taskplanner.server.api.field.FloatField

@JsonData public class FloatField extends Field
A field that takes a floating-point number as input. The field supports Task Planner placeholders, which must be taken into account.
Since:
taskplanner 21.0
  • Constructor Details

    • FloatField

      public FloatField(String key, String label)
      Constructs the numeric field.
      Parameters:
      key - the key of the field
      label - the label of the field
      Since:
      taskplanner 21.0
    • FloatField

      public FloatField(String key, String label, List<com.inet.config.structure.model.UnitConfigProperty.Unit> units)
      Constructs the numeric field, including a list of UnitConfigProperty.Unit values to select from, with automatic recalculation.
      Parameters:
      key - the key of the field
      label - the label of the field
      units - the definition of the units for this field
      Since:
      taskplanner 21.0
  • Method Details

    • isValidValue

      public static boolean isValidValue(String value)
      Checks whether the supplied value is a valid floating-point number or a placeholder expression in square brackets. A null value and values that cannot be parsed as either form are invalid.
      Parameters:
      value - the value to check.
      Returns:
      true if the value is valid.
      Since:
      taskplanner 21.0
    • patchResultPlaceholderInValue

      public String patchResultPlaceholderInValue(String value, List<JobResultContainer> results)
      Overrides this method to replace placeholders with values from the results.
      Overrides:
      patchResultPlaceholderInValue in class Field
      Parameters:
      value - the value to be patched
      results - the results that contain the meta properties that are replaced
      Returns:
      the new value with replaced placeholders
    • patchSeriesPlaceholderInValue

      public String patchSeriesPlaceholderInValue(String value, Map<String,String> seriesProperties)
      Overrides this method to replace placeholders with values from the series.
      Overrides:
      patchSeriesPlaceholderInValue in class Field
      Parameters:
      value - the value to be patched
      seriesProperties - properties from the current series set
      Returns:
      the new value with replaced placeholders