Interface CelExpr

All Known Subinterfaces:
CelExpr.Binary, CelExpr.Macro, CelExpr.Unary
All Known Implementing Classes:
CelExpr.Add, CelExpr.And, CelExpr.BoolValue, CelExpr.BytesValue, CelExpr.Divide, CelExpr.DoubleValue, CelExpr.EqualTo, CelExpr.FunctionCall, CelExpr.GreaterThan, CelExpr.GreaterThanOrEqualTo, CelExpr.Ident, CelExpr.IfElse, CelExpr.In, CelExpr.Index, CelExpr.LessThan, CelExpr.LessThanOrEqualTo, CelExpr.ListOf, CelExpr.LongValue, CelExpr.Macro.All, CelExpr.Macro.Exists, CelExpr.Macro.ExistsOne, CelExpr.Macro.Filter, CelExpr.Macro.FilterMap, CelExpr.Macro.Has, CelExpr.Macro.Map, CelExpr.MapOf, CelExpr.MemberCall, CelExpr.Modulo, CelExpr.Multiply, CelExpr.Negative, CelExpr.Not, CelExpr.NotEqualTo, CelExpr.NullValue, CelExpr.OptionalIndex, CelExpr.OptionalSelect, CelExpr.Or, CelExpr.Select, CelExpr.StringValue, CelExpr.Struct, CelExpr.Subtract, CelExpr.UintValue

  • Method Details

    • sourceIndex

      int sourceIndex()
      Returns the 0-based source character index where this expression starts.
    • withSourceIndex

      CelExpr withSourceIndex(int index)
      Returns a copy of this expression with the given source index.
    • of

      static CelExpr of(String cel)
      Parses and returns a CelExpr representing the cel string.
    • value

      static CelExpr.BoolValue value(boolean value)
      CelExpr.value(true) is equivalent to CelExpr.of("true").
    • value

      static CelExpr.LongValue value(long value)
      CelExpr.value(123) is equivalent to CelExpr.of("123").
    • value

      static CelExpr.DoubleValue value(double value)
      CelExpr.value(12.3) is equivalent to CelExpr.of("12.3").
    • string

      static CelExpr.StringValue string(String value)
      CelExpr.value("foo") is equivalent to CelExpr.of("'foo'").
    • bytes

      static CelExpr.BytesValue bytes(byte... value)
      CelExpr.bytes((byte) 1, (byte) 2) is equivalent to CelExpr.of("b'\\x01\\x02'").
    • unsigned

      static CelExpr.UintValue unsigned(long value)
      CelExpr.unsigned(123) is equivalent to CelExpr.of("123u").
    • negative

      static CelExpr.Negative negative(CelExpr expr)
      CelExpr.negative(value(5)) is equivalent to CelExpr.of("-(5)").
    • not

      static CelExpr.Not not(CelExpr expr)
      CelExpr.not(value(true)) is equivalent to CelExpr.of("!true").
    • select

      default CelExpr.Select select(CelExpr.Ident field)
      expr.select(field) is equivalent to CelExpr.of("expr.field").
    • optionalSelect

      default CelExpr.OptionalSelect optionalSelect(CelExpr.Ident field)
      expr.optionalSelect(field) is equivalent to CelExpr.of("expr.?field").
    • index

      default CelExpr.Index index(CelExpr index)
      expr.index(value(0)) is equivalent to CelExpr.of("expr[0]").
    • optionalIndex

      default CelExpr.OptionalIndex optionalIndex(CelExpr index)
      expr.optionalIndex(value(0)) is equivalent to CelExpr.of("expr[?0]").
    • add

      default CelExpr.Add add(CelExpr that)
      a.add(b) is equivalent to CelExpr.of("a + b").
    • subtract

      default CelExpr.Subtract subtract(CelExpr that)
      a.subtract(b) is equivalent to CelExpr.of("a - b").
    • multiply

      default CelExpr.Multiply multiply(CelExpr that)
      a.multiply(b) is equivalent to CelExpr.of("a * b").
    • divide

      default CelExpr.Divide divide(CelExpr that)
      a.divide(b) is equivalent to CelExpr.of("a / b").
    • modulo

      default CelExpr.Modulo modulo(CelExpr that)
      a.modulo(b) is equivalent to CelExpr.of("a % b").
    • equalTo

      default CelExpr.EqualTo equalTo(CelExpr that)
      a.equalTo(b) is equivalent to CelExpr.of("a == b").
    • notEqualTo

      default CelExpr.NotEqualTo notEqualTo(CelExpr that)
      a.notEqualTo(b) is equivalent to CelExpr.of("a != b").
    • lessThan

      default CelExpr.LessThan lessThan(CelExpr that)
      a.lessThan(b) is equivalent to CelExpr.of("a < b").
    • atMost

      default CelExpr.LessThanOrEqualTo atMost(CelExpr ceiling)
      a.atMost(b) is equivalent to CelExpr.of("a <= b").
    • greaterThan

      default CelExpr.GreaterThan greaterThan(CelExpr that)
      a.greaterThan(b) is equivalent to CelExpr.of("a > b").
    • atLeast

      default CelExpr.GreaterThanOrEqualTo atLeast(CelExpr floor)
      a.atLeast(b) is equivalent to CelExpr.of("a >= b").
    • in

      default CelExpr.In in(CelExpr that)
      a.in(b) is equivalent to CelExpr.of("a in b").
    • and

      default CelExpr.And and(CelExpr that)
      a.and(b) is equivalent to CelExpr.of("a && b").
    • or

      default CelExpr.Or or(CelExpr that)
      a.or(b) is equivalent to CelExpr.of("a || b").
    • ifElse

      default CelExpr.IfElse ifElse(CelExpr ifTrue, CelExpr ifFalse)
      active.ifElse(1, 0) is equivalent to CelExpr.of("active ? 1 : 0").
    • call

      default CelExpr.MemberCall call(CelExpr.Ident member, List<CelExpr> args)
      target.call(member, args) is equivalent to CelExpr.of("target.member(args)").