Package dev.cel.common.ast
Class CelConstant
- java.lang.Object
-
- dev.cel.common.ast.CelConstant
-
@Internal @Immutable public abstract class CelConstant extends java.lang.Object
Represents a primitive literal.This is the CEL-Java native type equivalent of Constant message type from syntax.proto.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCelConstant.CelConstantNotSetAn unset constant.static classCelConstant.KindRepresents the type of the Constant
-
Constructor Summary
Constructors Constructor Description CelConstant()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract booleanbooleanValue()abstract com.google.protobuf.ByteStringbytesValue()abstract doubledoubleValue()abstract com.google.protobuf.DurationdurationValue()Deprecated.Do not use.abstract CelConstant.KindgetKind()abstract longint64Value()static booleanisConstantValue(java.lang.Object value)Checks whether the provided Java object is a valid CelConstant value.abstract CelConstant.CelConstantNotSetnotSet()abstract com.google.protobuf.NullValuenullValue()static CelConstantofNotSet()static CelConstantofObjectValue(java.lang.Object value)Converts the given Java object into a CelConstant value.static CelConstantofValue(boolean value)static CelConstantofValue(double value)static CelConstantofValue(long value)static CelConstantofValue(com.google.common.primitives.UnsignedLong value)static CelConstantofValue(com.google.protobuf.ByteString value)static CelConstantofValue(com.google.protobuf.Duration value)Deprecated.Do not use.static CelConstantofValue(com.google.protobuf.NullValue value)static CelConstantofValue(com.google.protobuf.Timestamp value)Deprecated.Do not use.static CelConstantofValue(java.lang.String value)abstract java.lang.StringstringValue()abstract com.google.protobuf.TimestamptimestampValue()Deprecated.Do not use.abstract com.google.common.primitives.UnsignedLonguint64Value()
-
-
-
Method Detail
-
getKind
public abstract CelConstant.Kind getKind()
-
notSet
public abstract CelConstant.CelConstantNotSet notSet()
-
nullValue
public abstract com.google.protobuf.NullValue nullValue()
-
booleanValue
public abstract boolean booleanValue()
-
int64Value
public abstract long int64Value()
-
uint64Value
public abstract com.google.common.primitives.UnsignedLong uint64Value()
-
doubleValue
public abstract double doubleValue()
-
stringValue
public abstract java.lang.String stringValue()
-
bytesValue
public abstract com.google.protobuf.ByteString bytesValue()
-
timestampValue
@Deprecated public abstract com.google.protobuf.Timestamp timestampValue()
Deprecated.Do not use. Timestamp is no longer built-in CEL type.
-
durationValue
@Deprecated public abstract com.google.protobuf.Duration durationValue()
Deprecated.Do not use. Duration is no longer built-in CEL type.
-
ofNotSet
public static CelConstant ofNotSet()
-
ofValue
public static CelConstant ofValue(com.google.protobuf.NullValue value)
-
ofValue
public static CelConstant ofValue(boolean value)
-
ofValue
public static CelConstant ofValue(long value)
-
ofValue
public static CelConstant ofValue(com.google.common.primitives.UnsignedLong value)
-
ofValue
public static CelConstant ofValue(double value)
-
ofValue
public static CelConstant ofValue(java.lang.String value)
-
ofValue
public static CelConstant ofValue(com.google.protobuf.ByteString value)
-
isConstantValue
public static boolean isConstantValue(java.lang.Object value)
Checks whether the provided Java object is a valid CelConstant value.
-
ofObjectValue
public static CelConstant ofObjectValue(java.lang.Object value)
Converts the given Java object into a CelConstant value. This is equivalent of callingofValue(com.google.protobuf.NullValue)with concrete types.- Throws:
java.lang.IllegalArgumentException- If the value is not a supported CelConstant. This includes the deprecated duration and timestamp values.
-
ofValue
@Deprecated public static CelConstant ofValue(com.google.protobuf.Duration value)
Deprecated.Do not use. Duration is no longer built-in CEL type.
-
ofValue
@Deprecated public static CelConstant ofValue(com.google.protobuf.Timestamp value)
Deprecated.Do not use. Timestamp is no longer built-in CEL type.
-
-