Package dev.cel.common.values
Class MapValue<K extends CelValue,V extends CelValue>
- java.lang.Object
-
- dev.cel.common.values.CelValue
-
- dev.cel.common.values.MapValue<K,V>
-
- All Implemented Interfaces:
SelectableValue<K>,java.util.Map<K,V>
- Direct Known Subclasses:
ImmutableMapValue
@Immutable(containerOf={"K","V"}) public abstract class MapValue<K extends CelValue,V extends CelValue> extends CelValue implements java.util.Map<K,V>, SelectableValue<K>MapValue is an abstract representation of a generic map containingCelValueas keys and values.All methods that can mutate the map are disallowed.
-
-
Constructor Summary
Constructors Constructor Description MapValue()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CelTypecelType()The CelType that represents this value.voidclear()Deprecated.Unsupported operation.Vcompute(K key, java.util.function.BiFunction<? super K,? super @Nullable V,? extends @Nullable V> remappingFunction)Deprecated.Unsupported operation.VcomputeIfAbsent(K key, java.util.function.Function<? super K,? extends V> mappingFunction)Deprecated.Unsupported operation.VcomputeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends @Nullable V> remappingFunction)Deprecated.Unsupported operation.java.util.Optional<CelValue>find(K field)Finds the field.Vget(java.lang.Object key)booleanisZeroValue()Returns true if theCelValue.value()is a zero value for its type.Vmerge(K key, V value, java.util.function.BiFunction<? super V,? super V,? extends @Nullable V> function)Deprecated.Unsupported operation.Vput(K key, V value)Deprecated.Unsupported operation.voidputAll(java.util.Map<? extends K,? extends V> map)Deprecated.Unsupported operation.VputIfAbsent(K key, V value)Deprecated.Unsupported operation.Vremove(java.lang.Object o)Deprecated.Unsupported operation.booleanremove(java.lang.Object key, java.lang.Object value)Deprecated.Unsupported operation.Vreplace(K key, V value)Deprecated.Unsupported operation.booleanreplace(K key, V oldValue, V newValue)Deprecated.Unsupported operation.voidreplaceAll(java.util.function.BiFunction<? super K,? super V,? extends V> function)Deprecated.Unsupported operation.Vselect(K field)Performs field selection.abstract java.util.Map<K,V>value()The underlying value.
-
-
-
Method Detail
-
value
public abstract java.util.Map<K,V> value()
Description copied from class:CelValueThe underlying value. This is typically the Java native value or a derived instance of CelValue (ex: an element in lists or key/value pair in maps).
-
isZeroValue
public boolean isZeroValue()
Description copied from class:CelValueReturns true if theCelValue.value()is a zero value for its type.- Specified by:
isZeroValuein classCelValue
-
get
public V get(java.lang.Object key)
-
select
public V select(K field)
Description copied from interface:SelectableValuePerforms field selection. The behavior depends on the concrete implementation of the value being selected. For structs and maps, this must throw an exception if the field does not exist. For optional values, this will return anoptional.none().- Specified by:
selectin interfaceSelectableValue<K extends CelValue>
-
find
public java.util.Optional<CelValue> find(K field)
Description copied from interface:SelectableValueFinds the field. This will return anOptional.empty()if the field does not exist. This can be used for presence testing.- Specified by:
findin interfaceSelectableValue<K extends CelValue>
-
celType
public CelType celType()
Description copied from class:CelValueThe CelType that represents this value.
-
put
@CanIgnoreReturnValue @Deprecated public final V put(K key, V value)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
putIfAbsent
@CanIgnoreReturnValue @Deprecated public final V putIfAbsent(K key, V value)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
replace
@Deprecated public final boolean replace(K key, V oldValue, V newValue)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
replace
@Deprecated public final V replace(K key, V value)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
computeIfAbsent
@Deprecated public final V computeIfAbsent(K key, java.util.function.Function<? super K,? extends V> mappingFunction)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
computeIfPresent
@Deprecated public final V computeIfPresent(K key, java.util.function.BiFunction<? super K,? super V,? extends @Nullable V> remappingFunction)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
compute
@Deprecated public final V compute(K key, java.util.function.BiFunction<? super K,? super @Nullable V,? extends @Nullable V> remappingFunction)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
merge
@Deprecated public final V merge(K key, V value, java.util.function.BiFunction<? super V,? super V,? extends @Nullable V> function)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
putAll
@Deprecated public final void putAll(java.util.Map<? extends K,? extends V> map)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
replaceAll
@Deprecated public final void replaceAll(java.util.function.BiFunction<? super K,? super V,? extends V> function)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
remove
@Deprecated public final V remove(java.lang.Object o)
Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
remove
@Deprecated public final boolean remove(java.lang.Object key, java.lang.Object value)Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.
-
-