/*
 * Copyright (c) 2017-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

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 class Diff<T> {

  T mPrevious;
  T mNext;

  public Diff() {

  }

  public T getPrevious() {
    return mPrevious;
  }

  public T getNext() {
    return mNext;
  }

  void init(T previous, T next) {
    mPrevious = previous;
    mNext = next;
  }

  void release() {
    mPrevious = null;
    mNext = null;
  }
}

@@ -928,11 +928,131 @@
 ull;%0A  %7D
+%0A%0A  @Override%0A  public String toString() %7B%0A    return %22Diff%7B%22 + %22mPrevious=%22 + mPrevious + %22, mNext=%22 + mNext + '%7D';%0A  %7D
 %0A%7D%0A

Add toString() to Diff