Interface ReplicatedRegisterMap<K,​V>

    • Method Detail

      • getValue

        java.util.Optional<V> getValue​(K key)
        Get the current value of the register at the given key.
        Parameters:
        key - the key for the register
        Returns:
        the current value of the register, if it exists (as an Optional)
      • setValue

        default ReplicatedRegisterMap<K,​V> setValue​(K key,
                                                          V value)
        Set the current value of the register at the given key, using the default clock.
        Parameters:
        key - the key for the register
        value - the new value of the register
        Returns:
        a new register map with the updated value
      • setValue

        ReplicatedRegisterMap<K,​V> setValue​(K key,
                                                  V value,
                                                  ReplicatedRegister.Clock clock,
                                                  long customClockValue)
        Set the current value of the register at the given key, using the given clock and custom clock value if required.
        Parameters:
        key - the key for the register
        value - the new value of the register
        clock - the clock to use for replication
        customClockValue - the custom clock value to use, only if it's a custom clock
        Returns:
        a new register map with the updated value
      • remove

        ReplicatedRegisterMap<K,​V> remove​(K key)
        Remove the mapping for a key if it is present.
        Parameters:
        key - key whose mapping is to be removed from the map
        Returns:
        a new register map with the removed mapping
      • clear

        ReplicatedRegisterMap<K,​V> clear()
        Remove all mappings from this register map.
        Returns:
        a new empty register map
      • size

        int size()
        Get the number of key-register mappings in this register map.
        Returns:
        the number of key-register mappings in this register map
      • isEmpty

        boolean isEmpty()
        Check whether this register map is empty.
        Returns:
        true if this register map contains no key-register mappings
      • containsKey

        boolean containsKey​(K key)
        Check whether this register map contains a mapping for the given key.
        Parameters:
        key - key whose presence in this map is to be tested
        Returns:
        true if this register map contains a mapping for the given key
      • keySet

        java.util.Set<K> keySet()
        Get a Set view of the keys contained in this register map.
        Returns:
        the keys contained in this register map