Class LiveMap

java.lang.Object
io.ably.lib.liveobjects.value.LiveMap

public abstract class LiveMap extends Object
An immutable value type representing the intent to create a new LiveMap object with specific initial entries. Passed to mutation methods (such as LiveMapInstance#set or LiveMapPathObject#set, wrapped via LiveMapValue.of(LiveMap)) to assign a new LiveMap to the objects graph. Entries may themselves contain nested LiveMap / LiveCounter value types, enabling composable object structures.

This type is a holder for the initial value only - it is not a live, subscribable view of channel state. The MAP_CREATE operation it gives rise to is published when the enclosing mutation is applied.

Instances are obtained via the static create(Map) factory and are immutable after creation. The initial entries are held internally by the implementation; they have no public accessor.

Spec: RTLMV1, RTLMV2, RTLMV3

  • Constructor Details

    • LiveMap

      protected LiveMap()
      Extended by the LiveObjects implementation; not intended for application subclassing. Avoids implicit empty public constructor.
  • Method Details

    • create

      @NotNull public static @NotNull LiveMap create()
      Creates a new LiveMap value type with no initial entries.

      Spec: RTLMV3, RTLMV3a1, RTLMV3b

      Returns:
      an immutable LiveMap value type
      Throws:
      IllegalStateException - if the LiveObjects plugin is not on the classpath
    • create

      @NotNull public static @NotNull LiveMap create(@NotNull @NotNull Map<String,LiveMapValue> entries)
      Creates a new LiveMap value type with the given initial entries. No input validation is performed at creation time; validation is deferred to when the value is evaluated by a mutation method.

      Spec: RTLMV3, RTLMV3b, RTLMV3c, RTLMV3d

      Parameters:
      entries - the initial entries for the new LiveMap object
      Returns:
      an immutable LiveMap value type
      Throws:
      IllegalStateException - if the LiveObjects plugin is not on the classpath