Optional
Optional points to a value if non-empty.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Optional(
inner?):Optional
Parameters
Section titled “Parameters”inner?
Section titled “inner?”Returns
Section titled “Returns”Optional
Methods
Section titled “Methods”aggregateSize()
Section titled “aggregateSize()”aggregateSize(
sizer):number
aggregateSize implements AggregateSizeVisitor. An empty optional contributes nothing.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number
convertToNative()
Section titled “convertToNative()”convertToNative(
typeDesc?):unknown
ConvertToNative converts the Value to a native TypeScript value according to the provided type description, or throws if the conversion is not feasible.
Parameters
Section titled “Parameters”typeDesc?
Section titled “typeDesc?”unknown
Returns
Section titled “Returns”unknown
Implementation of
Section titled “Implementation of”convertToType()
Section titled “convertToType()”convertToType(
typeValue):Val
ConvertToType supports type conversions between CEL value types supported by the expression language.
Parameters
Section titled “Parameters”typeValue
Section titled “typeValue”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”equal()
Section titled “equal()”equal(
other):Val
Equal determines whether the values contained by two optional values are equal.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”getValue()
Section titled “getValue()”getValue():
Val
GetValue returns the wrapped value contained in the optional.
Returns
Section titled “Returns”hasValue()
Section titled “hasValue()”hasValue():
boolean
HasValue returns true if the optional has a value.
Returns
Section titled “Returns”boolean
toString()
Section titled “toString()”toString():
string
String returns the string representation of the optional.
Returns
Section titled “Returns”string
type()
Section titled “type()”type():
RefType
Type returns the TypeValue of the value.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”value()
Section titled “value()”value():
unknown
Value returns the underlying Value() of the wrapped value, if present.
Returns
Section titled “Returns”unknown