Class RosterMap

java.lang.Object
moe.kyokobot.libdave.RosterMap
All Implemented Interfaces:
Map<Long,byte[]>

public class RosterMap extends Object implements Map<Long,byte[]>
A read-only map representing the roster of participants in a DAVE session and their associated key data.

This maps user IDs (Long) to their key material (byte[]). In the context of CommitResult, this map represents changes: an entry with a value indicates an add/update, while an entry might represent removal depending on context (though typically removals might be explicit or implied by absence in a full snapshot, but specifically for commit results, it lists changed IDs).

Note: The implementation is backed by native arrays and is immutable.

  • Constructor Details

    • RosterMap

      public RosterMap(long[] keys, byte[][] values)
  • Method Details

    • size

      public int size()
      Specified by:
      size in interface Map<Long,byte[]>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<Long,byte[]>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<Long,byte[]>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<Long,byte[]>
    • get

      public byte[] get(Object key)
      Specified by:
      get in interface Map<Long,byte[]>
    • get

      public byte[] get(long key)
    • put

      public byte[] put(Long key, byte[] value)
      Specified by:
      put in interface Map<Long,byte[]>
    • remove

      public byte[] remove(Object key)
      Specified by:
      remove in interface Map<Long,byte[]>
    • putAll

      public void putAll(@NotNull @NotNull Map<? extends Long,? extends byte[]> m)
      Specified by:
      putAll in interface Map<Long,byte[]>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<Long,byte[]>
    • keySet

      @NotNull public @NotNull Set<Long> keySet()
      Specified by:
      keySet in interface Map<Long,byte[]>
    • values

      @NotNull public @NotNull Collection<byte[]> values()
      Specified by:
      values in interface Map<Long,byte[]>
    • entrySet

      @NotNull public @NotNull Set<Map.Entry<Long,byte[]>> entrySet()
      Specified by:
      entrySet in interface Map<Long,byte[]>