Class MapValue<K extends CelValue,​V extends CelValue>

  • 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 containing CelValue as keys and values.

    All methods that can mutate the map are disallowed.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      MapValue()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      CelType celType()
      The CelType that represents this value.
      void clear()
      Deprecated.
      Unsupported operation.
      V compute​(K key, java.util.function.BiFunction<? super K,​? super @Nullable V,​? extends @Nullable V> remappingFunction)
      Deprecated.
      Unsupported operation.
      V computeIfAbsent​(K key, java.util.function.Function<? super K,​? extends V> mappingFunction)
      Deprecated.
      Unsupported operation.
      V computeIfPresent​(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.
      V get​(java.lang.Object key)  
      boolean isZeroValue()
      Returns true if the CelValue.value() is a zero value for its type.
      V merge​(K key, V value, java.util.function.BiFunction<? super V,​? super V,​? extends @Nullable V> function)
      Deprecated.
      Unsupported operation.
      V put​(K key, V value)
      Deprecated.
      Unsupported operation.
      void putAll​(java.util.Map<? extends K,​? extends V> map)
      Deprecated.
      Unsupported operation.
      V putIfAbsent​(K key, V value)
      Deprecated.
      Unsupported operation.
      V remove​(java.lang.Object o)
      Deprecated.
      Unsupported operation.
      boolean remove​(java.lang.Object key, java.lang.Object value)
      Deprecated.
      Unsupported operation.
      V replace​(K key, V value)
      Deprecated.
      Unsupported operation.
      boolean replace​(K key, V oldValue, V newValue)
      Deprecated.
      Unsupported operation.
      void replaceAll​(java.util.function.BiFunction<? super K,​? super V,​? extends V> function)
      Deprecated.
      Unsupported operation.
      V select​(K field)
      Performs field selection.
      abstract java.util.Map<K,​V> value()
      The underlying value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Map

        containsKey, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, size, values
    • Constructor Detail

      • MapValue

        public MapValue()
    • Method Detail

      • value

        public abstract java.util.Map<K,​V> value()
        Description copied from class: CelValue
        The 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).
        Specified by:
        value in class CelValue
      • get

        public V get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<K extends CelValue,​V extends CelValue>
      • select

        public V select​(K field)
        Description copied from interface: SelectableValue
        Performs 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 an optional.none().
        Specified by:
        select in interface SelectableValue<K extends CelValue>
      • find

        public java.util.Optional<CelValue> find​(K field)
        Description copied from interface: SelectableValue
        Finds the field. This will return an Optional.empty() if the field does not exist. This can be used for presence testing.
        Specified by:
        find in interface SelectableValue<K extends CelValue>
      • celType

        public CelType celType()
        Description copied from class: CelValue
        The CelType that represents this value.
        Specified by:
        celType in class CelValue
      • put

        @CanIgnoreReturnValue
        @Deprecated
        public final V put​(K key,
                           V value)
        Deprecated.
        Unsupported operation.
        Guaranteed to throw an exception and leave the map unmodified.
        Specified by:
        put in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • putIfAbsent

        @CanIgnoreReturnValue
        @Deprecated
        public final V putIfAbsent​(K key,
                                   V value)
        Deprecated.
        Unsupported operation.
        Guaranteed to throw an exception and leave the map unmodified.
        Specified by:
        putIfAbsent in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • 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.
        Specified by:
        replace in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • replace

        @Deprecated
        public final V replace​(K key,
                               V value)
        Deprecated.
        Unsupported operation.
        Guaranteed to throw an exception and leave the map unmodified.
        Specified by:
        replace in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • 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.
        Specified by:
        computeIfAbsent in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • 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.
        Specified by:
        computeIfPresent in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • 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.
        Specified by:
        compute in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • 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.
        Specified by:
        merge in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • 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.
        Specified by:
        putAll in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • 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.
        Specified by:
        replaceAll in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • remove

        @Deprecated
        public final V remove​(java.lang.Object o)
        Deprecated.
        Unsupported operation.
        Guaranteed to throw an exception and leave the map unmodified.
        Specified by:
        remove in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • 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.
        Specified by:
        remove in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always
      • clear

        @Deprecated
        public final void clear()
        Deprecated.
        Unsupported operation.
        Guaranteed to throw an exception and leave the map unmodified.
        Specified by:
        clear in interface java.util.Map<K extends CelValue,​V extends CelValue>
        Throws:
        java.lang.UnsupportedOperationException - always