Class AbstractReplicatedMap.MapEntry<K,​V>

  • Type Parameters:
    K - The type of keys maintained by this map
    V - The type of mapped values
    All Implemented Interfaces:
    java.util.Map.Entry<K,​V>
    Enclosing class:
    AbstractReplicatedMap<K,​V>

    public static class AbstractReplicatedMap.MapEntry<K,​V>
    extends java.lang.Object
    implements java.util.Map.Entry<K,​V>
    Represents an entry in the replicated map, including metadata about its role (primary, backup, proxy).
    • Constructor Summary

      Constructors 
      Constructor Description
      MapEntry​(K key, V value)
      Creates a new map entry with the specified key and value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(byte[] data, int offset, int length, boolean diff)
      apply a diff, or an entire object
      boolean equals​(java.lang.Object o)  
      Member[] getBackupNodes()
      Gets the backup nodes for this entry.
      K getKey()
      Gets the key for this entry.
      Member getPrimary()
      Gets the primary member for this entry.
      V getValue()
      Gets the value for this entry.
      int hashCode()  
      boolean isActive()
      Checks if this entry is active.
      boolean isBackup()
      Checks if this entry is a backup.
      boolean isCopy()
      Checks if this entry is a copy.
      boolean isDiffable()
      Checks if this entry is diffable.
      boolean isKeySerializable()
      Checks if the key is serializable.
      boolean isPrimary()
      Checks if this entry is primary.
      boolean isProxy()
      Checks if this entry is a proxy.
      boolean isSerializable()
      Checks if both the key and value are serializable.
      boolean isValueSerializable()
      Checks if the value is serializable.
      void setBackup​(boolean backup)
      Sets whether this entry is a backup.
      void setBackupNodes​(Member[] nodes)
      Sets the backup nodes for this entry.
      void setCopy​(boolean copy)
      Sets whether this entry is a copy.
      K setKey​(K key)
      Sets the key for this entry.
      void setPrimary​(Member m)
      Sets the primary member for this entry.
      void setProxy​(boolean proxy)
      Sets whether this entry is a proxy.
      V setValue​(V value)
      Sets the value for this entry.
      java.lang.String toString()
      Returns a string representation of this map entry.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MapEntry

        public MapEntry​(K key,
                        V value)
        Creates a new map entry with the specified key and value.
        Parameters:
        key - The key
        value - The value
    • Method Detail

      • isKeySerializable

        public boolean isKeySerializable()
        Checks if the key is serializable.
        Returns:
        true if the key is serializable or null
      • isValueSerializable

        public boolean isValueSerializable()
        Checks if the value is serializable.
        Returns:
        true if the value is serializable or null
      • isSerializable

        public boolean isSerializable()
        Checks if both the key and value are serializable.
        Returns:
        true if both key and value are serializable
      • isBackup

        public boolean isBackup()
        Checks if this entry is a backup.
        Returns:
        true if this entry is a backup
      • setBackup

        public void setBackup​(boolean backup)
        Sets whether this entry is a backup.
        Parameters:
        backup - true if this entry is a backup
      • isProxy

        public boolean isProxy()
        Checks if this entry is a proxy.
        Returns:
        true if this entry is a proxy
      • isPrimary

        public boolean isPrimary()
        Checks if this entry is primary.
        Returns:
        true if this entry is primary
      • isActive

        public boolean isActive()
        Checks if this entry is active.
        Returns:
        true if this entry is active
      • setProxy

        public void setProxy​(boolean proxy)
        Sets whether this entry is a proxy.
        Parameters:
        proxy - true if this entry is a proxy
      • isCopy

        public boolean isCopy()
        Checks if this entry is a copy.
        Returns:
        true if this entry is a copy
      • setCopy

        public void setCopy​(boolean copy)
        Sets whether this entry is a copy.
        Parameters:
        copy - true if this entry is a copy
      • isDiffable

        public boolean isDiffable()
        Checks if this entry is diffable.
        Returns:
        true if this entry is diffable
      • setBackupNodes

        public void setBackupNodes​(Member[] nodes)
        Sets the backup nodes for this entry.
        Parameters:
        nodes - The backup nodes
      • getBackupNodes

        public Member[] getBackupNodes()
        Gets the backup nodes for this entry.
        Returns:
        The backup nodes
      • setPrimary

        public void setPrimary​(Member m)
        Sets the primary member for this entry.
        Parameters:
        m - The primary member
      • getPrimary

        public Member getPrimary()
        Gets the primary member for this entry.
        Returns:
        The primary member
      • getValue

        public V getValue()
        Gets the value for this entry.
        Specified by:
        getValue in interface java.util.Map.Entry<K,​V>
        Returns:
        The value
      • setValue

        public V setValue​(V value)
        Sets the value for this entry.
        Specified by:
        setValue in interface java.util.Map.Entry<K,​V>
        Parameters:
        value - The new value
        Returns:
        The previous value
      • getKey

        public K getKey()
        Gets the key for this entry.
        Specified by:
        getKey in interface java.util.Map.Entry<K,​V>
        Returns:
        The key
      • setKey

        public K setKey​(K key)
        Sets the key for this entry.
        Parameters:
        key - The new key
        Returns:
        The previous key
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map.Entry<K,​V>
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Map.Entry<K,​V>
        Overrides:
        equals in class java.lang.Object
      • apply

        public void apply​(byte[] data,
                          int offset,
                          int length,
                          boolean diff)
                   throws java.io.IOException,
                          java.lang.ClassNotFoundException
        apply a diff, or an entire object
        Parameters:
        data - byte[]
        offset - int
        length - int
        diff - boolean
        Throws:
        java.io.IOException - IO error
        java.lang.ClassNotFoundException - Deserialization error
      • toString

        public java.lang.String toString()
        Returns a string representation of this map entry.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this map entry