Package dev.cel.expr

Class CheckedExpr

    • Method Detail

      • internalGetMapField

        protected MapField internalGetMapField​(int number)
        Description copied from class: GeneratedMessageV3
        Gets the map field with the given field number. This method should be overridden in the generated message class if the message contains map fields.

        Unlike other field types, reflection support for map fields can't be implemented based on generated public API because we need to access a map field as a list in reflection API but the generated API only allows us to access it as a map. This method returns the underlying map field directly and thus enables us to access the map field as a list.

        Overrides:
        internalGetMapField in class GeneratedMessageV3
      • getReferenceMapCount

        public int getReferenceMapCount()
        Description copied from interface: CheckedExprOrBuilder
         A map from expression ids to resolved references.
         The following entries are in this table:
         - An Ident or Select expression is represented here if it resolves to a
           declaration. For instance, if `a.b.c` is represented by
           `select(select(id(a), b), c)`, and `a.b` resolves to a declaration,
           while `c` is a field selection, then the reference is attached to the
           nested select expression (but not to the id or or the outer select).
           In turn, if `a` resolves to a declaration and `b.c` are field selections,
           the reference is attached to the ident expression.
         - Every Call expression has an entry here, identifying the function being
           called.
         - Every CreateStruct expression for a message has an entry, identifying
           the message.
         
        map<int64, .cel.expr.Reference> reference_map = 2;
        Specified by:
        getReferenceMapCount in interface CheckedExprOrBuilder
      • containsReferenceMap

        public boolean containsReferenceMap​(long key)
         A map from expression ids to resolved references.
         The following entries are in this table:
         - An Ident or Select expression is represented here if it resolves to a
           declaration. For instance, if `a.b.c` is represented by
           `select(select(id(a), b), c)`, and `a.b` resolves to a declaration,
           while `c` is a field selection, then the reference is attached to the
           nested select expression (but not to the id or or the outer select).
           In turn, if `a` resolves to a declaration and `b.c` are field selections,
           the reference is attached to the ident expression.
         - Every Call expression has an entry here, identifying the function being
           called.
         - Every CreateStruct expression for a message has an entry, identifying
           the message.
         
        map<int64, .cel.expr.Reference> reference_map = 2;
        Specified by:
        containsReferenceMap in interface CheckedExprOrBuilder
      • getReferenceMapMap

        public java.util.Map<java.lang.Long,​Reference> getReferenceMapMap()
         A map from expression ids to resolved references.
         The following entries are in this table:
         - An Ident or Select expression is represented here if it resolves to a
           declaration. For instance, if `a.b.c` is represented by
           `select(select(id(a), b), c)`, and `a.b` resolves to a declaration,
           while `c` is a field selection, then the reference is attached to the
           nested select expression (but not to the id or or the outer select).
           In turn, if `a` resolves to a declaration and `b.c` are field selections,
           the reference is attached to the ident expression.
         - Every Call expression has an entry here, identifying the function being
           called.
         - Every CreateStruct expression for a message has an entry, identifying
           the message.
         
        map<int64, .cel.expr.Reference> reference_map = 2;
        Specified by:
        getReferenceMapMap in interface CheckedExprOrBuilder
      • getReferenceMapOrDefault

        public Reference getReferenceMapOrDefault​(long key,
                                                  Reference defaultValue)
         A map from expression ids to resolved references.
         The following entries are in this table:
         - An Ident or Select expression is represented here if it resolves to a
           declaration. For instance, if `a.b.c` is represented by
           `select(select(id(a), b), c)`, and `a.b` resolves to a declaration,
           while `c` is a field selection, then the reference is attached to the
           nested select expression (but not to the id or or the outer select).
           In turn, if `a` resolves to a declaration and `b.c` are field selections,
           the reference is attached to the ident expression.
         - Every Call expression has an entry here, identifying the function being
           called.
         - Every CreateStruct expression for a message has an entry, identifying
           the message.
         
        map<int64, .cel.expr.Reference> reference_map = 2;
        Specified by:
        getReferenceMapOrDefault in interface CheckedExprOrBuilder
      • getReferenceMapOrThrow

        public Reference getReferenceMapOrThrow​(long key)
         A map from expression ids to resolved references.
         The following entries are in this table:
         - An Ident or Select expression is represented here if it resolves to a
           declaration. For instance, if `a.b.c` is represented by
           `select(select(id(a), b), c)`, and `a.b` resolves to a declaration,
           while `c` is a field selection, then the reference is attached to the
           nested select expression (but not to the id or or the outer select).
           In turn, if `a` resolves to a declaration and `b.c` are field selections,
           the reference is attached to the ident expression.
         - Every Call expression has an entry here, identifying the function being
           called.
         - Every CreateStruct expression for a message has an entry, identifying
           the message.
         
        map<int64, .cel.expr.Reference> reference_map = 2;
        Specified by:
        getReferenceMapOrThrow in interface CheckedExprOrBuilder
      • getTypeMapCount

        public int getTypeMapCount()
        Description copied from interface: CheckedExprOrBuilder
         A map from expression ids to types.
         Every expression node which has a type different than DYN has a mapping
         here. If an expression has type DYN, it is omitted from this map to save
         space.
         
        map<int64, .cel.expr.Type> type_map = 3;
        Specified by:
        getTypeMapCount in interface CheckedExprOrBuilder
      • containsTypeMap

        public boolean containsTypeMap​(long key)
         A map from expression ids to types.
         Every expression node which has a type different than DYN has a mapping
         here. If an expression has type DYN, it is omitted from this map to save
         space.
         
        map<int64, .cel.expr.Type> type_map = 3;
        Specified by:
        containsTypeMap in interface CheckedExprOrBuilder
      • getTypeMapMap

        public java.util.Map<java.lang.Long,​Type> getTypeMapMap()
         A map from expression ids to types.
         Every expression node which has a type different than DYN has a mapping
         here. If an expression has type DYN, it is omitted from this map to save
         space.
         
        map<int64, .cel.expr.Type> type_map = 3;
        Specified by:
        getTypeMapMap in interface CheckedExprOrBuilder
      • getTypeMapOrDefault

        public Type getTypeMapOrDefault​(long key,
                                        Type defaultValue)
         A map from expression ids to types.
         Every expression node which has a type different than DYN has a mapping
         here. If an expression has type DYN, it is omitted from this map to save
         space.
         
        map<int64, .cel.expr.Type> type_map = 3;
        Specified by:
        getTypeMapOrDefault in interface CheckedExprOrBuilder
      • getTypeMapOrThrow

        public Type getTypeMapOrThrow​(long key)
         A map from expression ids to types.
         Every expression node which has a type different than DYN has a mapping
         here. If an expression has type DYN, it is omitted from this map to save
         space.
         
        map<int64, .cel.expr.Type> type_map = 3;
        Specified by:
        getTypeMapOrThrow in interface CheckedExprOrBuilder
      • hasSourceInfo

        public boolean hasSourceInfo()
         The source info derived from input that generated the parsed `expr` and
         any optimizations made during the type-checking pass.
         
        .cel.expr.SourceInfo source_info = 5;
        Specified by:
        hasSourceInfo in interface CheckedExprOrBuilder
        Returns:
        Whether the sourceInfo field is set.
      • getSourceInfo

        public SourceInfo getSourceInfo()
         The source info derived from input that generated the parsed `expr` and
         any optimizations made during the type-checking pass.
         
        .cel.expr.SourceInfo source_info = 5;
        Specified by:
        getSourceInfo in interface CheckedExprOrBuilder
        Returns:
        The sourceInfo.
      • getSourceInfoOrBuilder

        public SourceInfoOrBuilder getSourceInfoOrBuilder()
         The source info derived from input that generated the parsed `expr` and
         any optimizations made during the type-checking pass.
         
        .cel.expr.SourceInfo source_info = 5;
        Specified by:
        getSourceInfoOrBuilder in interface CheckedExprOrBuilder
      • getExprVersion

        public java.lang.String getExprVersion()
         The expr version indicates the major / minor version number of the `expr`
         representation.
         The most common reason for a version change will be to indicate to the CEL
         runtimes that transformations have been performed on the expr during static
         analysis. In some cases, this will save the runtime the work of applying
         the same or similar transformations prior to evaluation.
         
        string expr_version = 6;
        Specified by:
        getExprVersion in interface CheckedExprOrBuilder
        Returns:
        The exprVersion.
      • getExprVersionBytes

        public ByteString getExprVersionBytes()
         The expr version indicates the major / minor version number of the `expr`
         representation.
         The most common reason for a version change will be to indicate to the CEL
         runtimes that transformations have been performed on the expr during static
         analysis. In some cases, this will save the runtime the work of applying
         the same or similar transformations prior to evaluation.
         
        string expr_version = 6;
        Specified by:
        getExprVersionBytes in interface CheckedExprOrBuilder
        Returns:
        The bytes for exprVersion.
      • hasExpr

        public boolean hasExpr()
         The checked expression. Semantically equivalent to the parsed `expr`, but
         may have structural differences.
         
        .cel.expr.Expr expr = 4;
        Specified by:
        hasExpr in interface CheckedExprOrBuilder
        Returns:
        Whether the expr field is set.
      • getExpr

        public Expr getExpr()
         The checked expression. Semantically equivalent to the parsed `expr`, but
         may have structural differences.
         
        .cel.expr.Expr expr = 4;
        Specified by:
        getExpr in interface CheckedExprOrBuilder
        Returns:
        The expr.
      • getExprOrBuilder

        public ExprOrBuilder getExprOrBuilder()
         The checked expression. Semantically equivalent to the parsed `expr`, but
         may have structural differences.
         
        .cel.expr.Expr expr = 4;
        Specified by:
        getExprOrBuilder in interface CheckedExprOrBuilder
      • getSerializedSize

        public int getSerializedSize()
        Description copied from interface: MessageLite
        Get the number of bytes required to encode this message. The result is only computed on the first call and memoized after that. If this message requires more than Integer.MAX_VALUE bytes to encode, the return value will be smaller than the actual number of bytes required and might be negative.
        Specified by:
        getSerializedSize in interface MessageLite
        Overrides:
        getSerializedSize in class GeneratedMessageV3
      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from interface: Message
        Compares the specified object with this message for equality. Returns true if the given object is a message of the same type (as defined by getDescriptorForType()) and has identical values for all of its fields. Subclasses must implement this; inheriting Object.equals() is incorrect.
        Specified by:
        equals in interface Message
        Overrides:
        equals in class AbstractMessage
        Parameters:
        obj - object to be compared for equality with this message
        Returns:
        true if the specified object is equal to this message
      • hashCode

        public int hashCode()
        Description copied from interface: Message
        Returns the hash code value for this message. The hash code of a message should mix the message's type (object identity of the descriptor) with its contents (known and unknown field values). Subclasses must implement this; inheriting Object.hashCode() is incorrect.
        Specified by:
        hashCode in interface Message
        Overrides:
        hashCode in class AbstractMessage
        Returns:
        the hash code value for this message
        See Also:
        Map.hashCode()
      • parseFrom

        public static CheckedExpr parseFrom​(java.io.InputStream input)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

        public static CheckedExpr parseFrom​(java.io.InputStream input,
                                            ExtensionRegistryLite extensionRegistry)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDelimitedFrom

        public static CheckedExpr parseDelimitedFrom​(java.io.InputStream input)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDelimitedFrom

        public static CheckedExpr parseDelimitedFrom​(java.io.InputStream input,
                                                     ExtensionRegistryLite extensionRegistry)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getDefaultInstance

        public static CheckedExpr getDefaultInstance()
      • getDefaultInstanceForType

        public CheckedExpr getDefaultInstanceForType()
        Description copied from interface: MessageLiteOrBuilder
        Get an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from the getDefaultInstance() method of generated message classes in that this method is an abstract method of the MessageLite interface whereas getDefaultInstance() is a static method of a specific class. They return the same thing.
        Specified by:
        getDefaultInstanceForType in interface MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface MessageOrBuilder