Class PendingChange

java.lang.Object
org.apache.juneau.petstore.service.PendingChange

public class PendingChange extends Object
One staged inline edit of a pet field, waiting on the Pending changes page to be applied or discarded.
Example:

PendingChange c = store.pendingChanges().stage(1, "name", "Sir Frisky", "alice"); // c.getState() == State.PENDING; the pet is unchanged until apply() store.pendingChanges().apply(c.getId(), "console:alice");

  • Constructor Details

  • Method Details

    • getId

      public long getId()
      Returns:
      The change id, increasing in staging order.
    • setId

      public PendingChange setId(long value)
      Parameters:
      value - The change id, increasing in staging order.
      Returns:
      This object.
    • getPetId

      public long getPetId()
      Returns:
      The id of the pet the change targets.
    • setPetId

      public PendingChange setPetId(long value)
      Parameters:
      value - The id of the pet the change targets.
      Returns:
      This object.
    • getField

      public String getField()
      Returns:
      The staged field, one of "name", "price", "species", "status" or "tags".
    • setField

      public PendingChange setField(String value)
      Parameters:
      value - The staged field, one of "name", "price", "species", "status" or "tags".
      Returns:
      This object.
    • getOldValue

      public String getOldValue()
      Returns:
      The field value when the change was staged.
    • setOldValue

      Parameters:
      value - The field value when the change was staged.
      Returns:
      This object.
    • getNewValue

      public String getNewValue()
      Returns:
      The staged new value.
    • setNewValue

      Parameters:
      value - The staged new value.
      Returns:
      This object.
    • getState

      Returns:
      The lifecycle state.
    • setState

      Parameters:
      value - The lifecycle state.
      Returns:
      This object.
    • getAuthor

      public String getAuthor()
      Returns:
      Who staged the change.
    • setAuthor

      public PendingChange setAuthor(String value)
      Parameters:
      value - Who staged the change.
      Returns:
      This object.
    • getSummary

      public String getSummary()
      Returns:
      A short human-readable summary of the change.
    • setSummary

      Parameters:
      value - A short human-readable summary of the change.
      Returns:
      This object.
    • getMessage

      public String getMessage()
      Returns:
      The failure text when the state is FAILED, otherwise null.
    • setMessage

      Parameters:
      value - The failure text when the state is FAILED, otherwise null.
      Returns:
      This object.