Record Class Parameter.StringParameter.NumericRange

java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.designer.tags.editing.dialog.multiinstancewizard.model.Parameter.StringParameter.NumericRange
All Implemented Interfaces:
Parameter<String>, Parameter.StringParameter
Enclosing interface:
Parameter.StringParameter

public static record Parameter.StringParameter.NumericRange(String name, String baseValue, int start, int step, Parameter.StringParameter.Placement placement) extends Record implements Parameter.StringParameter
Represents a numeric range with a specified start value and step.

Generates a list of numeric values within the specified range, appending the values to the baseValue based on the placement, up to the specified limit.

Example:


 Parameter<String> numericRange = new Parameter.StringParameter.NumericRange(
      "paramA",
      "exampleText-",
      1,
      2,
      Parameter.StringParameter.Placement.AFTER
 );

 // Generates ["exampleText-1", "exampleText-3", "exampleText-5"]
 List<String> values = numericRange.getValues().limit(3).toList();
 
  • Constructor Details

    • NumericRange

      public NumericRange(String name, String baseValue, int start, int step, Parameter.StringParameter.Placement placement)
      Creates an instance of a NumericRange record class.
      Parameters:
      name - the value for the name record component
      baseValue - the value for the baseValue record component
      start - the value for the start record component
      step - the value for the step record component
      placement - the value for the placement record component
  • Method Details

    • getValues

      public Stream<String> getValues()
      Specified by:
      getValues in interface Parameter<String>
    • getPresentedValue

      public String getPresentedValue()
      Specified by:
      getPresentedValue in interface Parameter<String>
    • cloneWithUpdatedValue

      public Parameter<?> cloneWithUpdatedValue(Object newValue)
      Specified by:
      cloneWithUpdatedValue in interface Parameter<String>
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Specified by:
      name in interface Parameter<String>
      Returns:
      the value of the name record component
    • baseValue

      public String baseValue()
      Returns the value of the baseValue record component.
      Specified by:
      baseValue in interface Parameter.StringParameter
      Returns:
      the value of the baseValue record component
    • start

      public int start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • step

      public int step()
      Returns the value of the step record component.
      Returns:
      the value of the step record component
    • placement

      Returns the value of the placement record component.
      Returns:
      the value of the placement record component