Record Class ArrayExpression

java.lang.Object
java.lang.Record
io.openems.edge.core.appmanager.formly.expression.ArrayExpression

public record ArrayExpression(String array) extends Record
  • Constructor Details

    • ArrayExpression

      public ArrayExpression(String array)
      Creates an instance of a ArrayExpression record class.
      Parameters:
      array - the value for the array record component
  • Method Details

    • of

      public static ArrayExpression of(Variable... variable)
      Creates a ArrayExpression of the given values.
      Parameters:
      values - the values of the array
      Returns:
      the created ArrayExpression
    • length

      public Variable length()
      Creates a variable of the length of the current array.
      Returns:
      the Variable to obtain the length from
    • filter

      Creates a new ArrayExpression which is filtered by the given filter.
      Parameters:
      filter - the filter to be applied on every element
      Returns:
      the new filtered ArrayExpression
    • join

      public StringExpression join(String delimiter)
      Joins the array into a StringExpression separated by the given delimiter.
      Parameters:
      delimiter - the delimiter of the elements
      Returns:
      the created StringExpression
    • every

      Creates a BooleanExpression which checks if every element matches the resulting BooleanExpression of the predicate.
      Parameters:
      predicate - the function to get the expression to validate every element; the supplied variable represents the current element of the array
      Returns:
      the final BooleanExpression
    • some

      Creates a BooleanExpression which checks if some elements match the resulting BooleanExpression of the predicate.
      Parameters:
      predicate - the function to get the expression to validate every element; the supplied variable represents the current element of the array
      Returns:
      the final BooleanExpression
    • elementAt

      public Variable elementAt(int index)
      Takes the n-Element of this array and returns it as a Variable.
      Parameters:
      index - the index of the element
      Returns:
      the created Variable
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • array

      public String array()
      Returns the value of the array record component.
      Returns:
      the value of the array record component