Class LiveCounterUpdate

java.lang.Object
io.ably.lib.objects.type.ObjectUpdate
io.ably.lib.objects.type.counter.LiveCounterUpdate

public class LiveCounterUpdate extends ObjectUpdate
Represents an update that occurred on a LiveCounter object. Contains information about counter value changes from increment/decrement operations. Updates can represent positive changes (increments) or negative changes (decrements).
  • Constructor Details

    • LiveCounterUpdate

      public LiveCounterUpdate()
      Creates a no-op LiveCounterUpdate representing no actual change.
    • LiveCounterUpdate

      public LiveCounterUpdate(@NotNull @NotNull Double amount)
      Creates a LiveCounterUpdate with the specified amount change.
      Parameters:
      amount - the amount by which the counter changed (positive = increment, negative = decrement)
  • Method Details

    • getUpdate

      @NotNull public LiveCounterUpdate.Update getUpdate()
      Gets the update information containing the amount of change.
      Returns:
      the Update object with the counter modification amount
    • toString

      public String toString()
      Returns a string representation of this LiveCounterUpdate.
      Overrides:
      toString in class Object
      Returns:
      a string showing the amount of change to the counter