Class Change<T>

java.lang.Object
com.suse.salt.netapi.results.Change<T>
Type Parameters:
T - type of the changed value

public class Change<T> extends Object
Represents a change from some old value to a new one. primarily used in salt for showing package changes
  • Field Details

    • oldValue

      @SerializedName("old") private final T oldValue
    • newValue

      @SerializedName("new") private final T newValue
  • Constructor Details

    • Change

      public Change(T oldValue, T newValue)
      constructor
      Parameters:
      oldValue - old value
      newValue - new value
  • Method Details

    • getOldValue

      public T getOldValue()
      the old value
      Returns:
      old value
    • getNewValue

      public T getNewValue()
      the new value
      Returns:
      new value
    • map

      public <R> Change<R> map(Function<T,R> fn)
      Applies a mapping function to both the old and the new value, wrapping the result in a new Change.
      Type Parameters:
      R - type returned by the mapping function
      Parameters:
      fn - the mapping function
      Returns:
      a new Change with mapped values