Enum WellKnownProto

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<WellKnownProto>

    @Internal
    public enum WellKnownProto
    extends java.lang.Enum<WellKnownProto>
    WellKnownProto types used throughout CEL. These types are specially handled to ensure that bidirectional conversion between CEL native values and these well-known types is performed consistently across runtimes.
    • Method Detail

      • values

        public static WellKnownProto[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (WellKnownProto c : WellKnownProto.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static WellKnownProto valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • pathName

        public java.lang.String pathName()
        Gets the full proto path name (ex: google/protobuf/any.proto)
      • typeName

        public java.lang.String typeName()
        Gets the fully qualified prototype name (ex: google.protobuf.FloatValue)
      • messageClass

        public java.lang.Class<?> messageClass()
        Gets the underlying java class for this WellKnownProto.
      • getByPathName

        public static com.google.common.collect.ImmutableCollection<WellKnownProto> getByPathName​(java.lang.String typeName)
        Returns the well known proto given the full proto path (example: google/protobuf/timestamp.proto)
      • getByTypeName

        public static java.util.Optional<WellKnownProto> getByTypeName​(java.lang.String typeName)
      • getByClass

        public static java.util.Optional<WellKnownProto> getByClass​(java.lang.Class<?> clazz)
      • isWrapperType

        public static boolean isWrapperType​(java.lang.String typeName)
        Returns true if the provided typeName is a well known type, and it's a wrapper. False otherwise.
      • isWrapperType

        public boolean isWrapperType()