Class ProtoCelValueConverter


  • @Immutable
    @Internal
    public final class ProtoCelValueConverter
    extends java.lang.Object
    CelValueConverter handles bidirectional conversion between native Java and protobuf objects to CelValue.

    Protobuf semantics take precedence for conversion. For example, CEL's TimestampValue will be converted into Protobuf's Timestamp instead of java.time.Instant.

    CEL Library Internals. Do Not Use.

    • Field Detail

      • celOptions

        protected final CelOptions celOptions
    • Method Detail

      • fromCelValueToJavaObject

        public java.lang.Object fromCelValueToJavaObject​(CelValue celValue)
        Adapts a CelValue to a native Java object. The CelValue is adapted into protobuf object when an equivalent exists.
      • fromProtoMessageToCelValue

        public CelValue fromProtoMessageToCelValue​(com.google.protobuf.MessageOrBuilder message)
        Adapts a Protobuf message into a CelValue.
      • fromJavaObjectToCelValue

        public CelValue fromJavaObjectToCelValue​(java.lang.Object value)
        Adapts a plain old Java Object to a CelValue. Protobuf semantics take precedence for conversion.
      • fromProtoMessageFieldToCelValue

        public CelValue fromProtoMessageFieldToCelValue​(com.google.protobuf.Message message,
                                                        com.google.protobuf.Descriptors.FieldDescriptor fieldDescriptor)
        Adapts the protobuf message field into CelValue.
      • fromJavaPrimitiveToCelValue

        protected CelValue fromJavaPrimitiveToCelValue​(java.lang.Object value)
        Adapts a plain old Java Object that are considered primitives to a CelValue.