Class BidiConverter<A,​B>

  • Type Parameters:
    A - The proto value type.
    B - The CEL value type.

    @CheckReturnValue
    @Internal
    public abstract class BidiConverter<A,​B>
    extends java.lang.Object
    The BidiConverter is a bidirectional converter which contains Converter objects to forward convert from proto to CEL and backward convert from CEL to proto.

    Use the BidiConverter when dealing with reading and constructing proto messages during expression interpretation as CEL numeric primitives are wider than many of the proto primitives.

    CEL Library Internals. Do Not Use.

    • Field Detail

      • IDENTITY

        public static final BidiConverter<java.lang.Object,​java.lang.Object> IDENTITY
        A BidiConverter used for objects which do not need conversion.
    • Constructor Detail

      • BidiConverter

        public BidiConverter()
    • Method Detail

      • forwardConverter

        public abstract Converter<A,​B> forwardConverter()
        Return the Converter which adapts from proto values to CEL values.
      • backwardConverter

        public abstract Converter<B,​A> backwardConverter()
        Return the Converter which adapts from CEL values to proto values.
      • reverse

        public BidiConverter<B,​A> reverse()
        Return a BidiConverter with the converter references reversed.
      • of

        public static <A,​B> BidiConverter<A,​B> of​(Converter<A,​B> forwardConverter,
                                                              Converter<B,​A> backwardConverter)
        Create a new BidiConverter from the forwardConverter and backwardConverter Converter objects.