Enum Class DiffAlgorithm

java.lang.Object
java.lang.Enum<DiffAlgorithm>
com.lightstreamer.adapters.remote.DiffAlgorithm
All Implemented Interfaces:
Serializable, Comparable<DiffAlgorithm>, Constable

public enum DiffAlgorithm extends Enum<DiffAlgorithm>
Enumerative class that lists the available "diff" algorithms that can be specified in ItemEventListener.declareFieldDiffOrder(java.lang.String, java.util.Map<java.lang.String, com.lightstreamer.adapters.remote.DiffAlgorithm[]>). Such algorithms can be used by the Server to compute the difference between a value and the previous one in order to send the client this difference, for "delta delivery" purpose.
More algorithms may be added to the enumerative class as their support is added to the Server.
  • Enum Constant Details

    • JSONPATCH

      public static final DiffAlgorithm JSONPATCH
      Computes the difference between two values that are valid JSON string representations in JSON Patch format.
      Note that this setting is ignored for the mandatory fields for COMMAND Mode named "key" and "command".
    • DIFF_MATCH_PATCH

      public static final DiffAlgorithm DIFF_MATCH_PATCH
      Computes the difference between two values with Google's "diff-match-patch" algorithm (the result is then serialized with the custom "TLCP-diff" format). This algorithm applies to any strings, only provided that they don't contain UTF-16 surrogate pairs.
  • Method Details

    • values

      public static DiffAlgorithm[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DiffAlgorithm valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null