Class 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
    • Constructor Detail

      • Change

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

      • 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