Class ExpressionCardinality

java.lang.Object
org.openhab.core.voice.text.Expression
org.openhab.core.voice.text.ExpressionCardinality

public final class ExpressionCardinality extends Expression
Expression that successfully parses, if a given expression occurs or repeats with a specified cardinality. This class is immutable.
Author:
Tilman Kamp - Initial contribution
  • Constructor Details

    • ExpressionCardinality

      public ExpressionCardinality(Expression subExpression, boolean atLeastOne, boolean atMostOne)
      Constructs a new instance.
      Parameters:
      subExpression - expression that could occur or repeat
      atLeastOne - true, if expression should occur at least one time
      atMostOne - true, if expression should occur at most one time
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSubExpression

      public Expression getSubExpression()
      Returns:
      the subExpression
    • isAtLeastOne

      public boolean isAtLeastOne()
      Returns:
      the atLeastOne
    • isAtMostOne

      public boolean isAtMostOne()
      Returns:
      the atMostOne