/*
 * Copyright 2014-present Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho;

import com.facebook.litho.annotations.ShouldUpdate;

/**
 * Represents a diff between two values T. It should be used when defining the
 * {@link ShouldUpdate} callback in a ComponentSpec. a Diff
 * holds the previous and next value for a specific Prop for a ComponentSpec
 */
public final class Diff<T> {

  final T mPrevious;
  T mNext;

  public Diff(T previous, T next) {
    mPrevious = previous;
    mNext = next;
  }

  public T getPrevious() {
    return mPrevious;
  }

  public T getNext() {
    return mNext;
  }

  public void setNext(T next) {
    mNext = next;
  }

  @Override
  public String toString() {
    return "Diff{" + "mPrevious=" + mPrevious + ", mNext=" + mNext + '}';
  }
}

@@ -678,16 +678,50 @@
 dUpdate;
+%0Aimport javax.annotation.Nullable;
 %0A%0A/**%0A *
@@ -976,16 +976,26 @@
   final 
+@Nullable 
 T mPrevi
@@ -1001,16 +1001,26 @@
 ious;%0A  
+@Nullable 
 T mNext;
@@ -1035,16 +1035,26 @@
 ic Diff(
+@Nullable 
 T previo
@@ -1056,16 +1056,26 @@
 revious,
+ @Nullable
  T next)
@@ -1118,32 +1118,44 @@
 xt = next;%0A  %7D%0A%0A
+  @Nullable%0A
   public T getPr
@@ -1188,24 +1188,36 @@
 vious;%0A  %7D%0A%0A
+  @Nullable%0A
   public T g
@@ -1272,16 +1272,26 @@
 setNext(
+@Nullable 
 T next) 

Mark Diff fields as @Nullable