Class Change<T>

  • Type Parameters:
    T - type of the changed value

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

      Fields 
      Modifier and Type Field Description
      private T newValue  
      private T oldValue  
    • Constructor Summary

      Constructors 
      Constructor Description
      Change​(T oldValue, T newValue)
      constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T getNewValue()
      the new value
      T getOldValue()
      the old value
      <R> Change<R> map​(java.util.function.Function<T,​R> fn)
      Applies a mapping function to both the old and the new value, wrapping the result in a new Change.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • oldValue

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

        @SerializedName("new")
        private final T newValue
    • 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​(java.util.function.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