java.lang.Object
java.lang.Enum<Sync>
org.gcube.informationsystem.resourceregistry.api.rest.Sync
All Implemented Interfaces:
Serializable, Comparable<Sync>, Constable

public enum Sync extends Enum<Sync>
The Contexts that a write of a Resource reaches besides the token Context: the value of the sync query parameter of POST /instances/{type} and PUT /instances/{type}/{uuid}. The write is always on the token Context; every other Context it reaches ends up with the same Resource and the same ConsistsOf instances.

Besides these values, sync accepts the UUID of a Context: the write then reaches that Context only, besides the token Context.

The wire format uses lowercase values (e.g. "tree"). Use toString() to obtain the wire value and fromString(String) to parse it; only the exact lowercase values are accepted.

Author:
Luca Frosini (ISTI - CNR)
  • Enum Constant Details

    • NONE

      public static final Sync NONE
      The token Context only.
    • TREE

      public static final Sync TREE
      The token Context and every Context of its subtree.
    • EXISTING

      public static final Sync EXISTING
      The token Context and the descendants where the Resource is already present (PUT only).
  • Field Details

    • DEFAULT

      public static final Sync DEFAULT
      The default when no parameter is supplied.
  • Method Details

    • values

      public static Sync[] 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 Sync 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
    • fromString

      public static Sync fromString(String s)
      Parses an exact lowercase wire value. Returns null for any other string, a Context UUID included.
      Parameters:
      s - the wire string to parse
      Returns:
      the matching Sync, or null if unrecognised
    • toString

      public String toString()
      Returns the lowercase wire value (e.g. "tree").
      Overrides:
      toString in class Enum<Sync>