Class CrudMap<Key,​Value>

  • Type Parameters:
    Key - Type of the map keys.
    Value - Type of the map values.
    All Implemented Interfaces:
    Map<Key,​Value>

    public final class CrudMap<Key,​Value>
    extends AbstractMap<Key,​Value>
    CRUD = create, read, update, and delete

    A map that delegates to a CrudMapAdapter with a get(key), set(key, value), and delete method. This lets you implement a map in terms of simple get, set, delete operations (instead of having to implement an entry set when using AbstractMap).

    This is especially useful when you do not have a simple map, but need to compute the keys or values in some fashion.

    You can also use this to implement a view of an existing map with mapped or filtered keys and values: Keys for which get returns null are excluded from the map.

    Since:
    8.2.0
    Author:
    XIMA MEDIA GmbH