Class Chain

java.lang.Object
com.landawn.abacus.util.Chain

public final class Chain extends Object
Author:
HaiYang Li
  • Method Details

    • compare

      public static <T extends Comparable<? super T>> Chain.ComparisonChain compare(T left, T right)
      Compares two comparable objects as specified by Comparable.compareTo(T), if the result of this comparison chain has not already been determined.
      Type Parameters:
      T -
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • compare

      public static <T> Chain.ComparisonChain compare(T left, T right, Comparator<T> comparator)
      Compares two objects using a comparator, if the result of this comparison chain has not already been determined.
      Type Parameters:
      T -
      Parameters:
      left -
      right -
      comparator -
      Returns:
      ComparisonChain
    • compare

      public static <T, E extends Exception> Chain.ComparisonChain compare(T left, T right, Throwables.BiFunction<? super T,? super T,Integer,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      left -
      right -
      func -
      Returns:
      Throws:
      E - the e
    • compareNullLess

      public static <T extends Comparable<? super T>> Chain.ComparisonChain compareNullLess(T left, T right)
      null is smaller.
      Type Parameters:
      T -
      Parameters:
      left -
      right -
      Returns:
    • compareNullBigger

      public static <T extends Comparable<? super T>> Chain.ComparisonChain compareNullBigger(T left, T right)
      null is bigger.
      Type Parameters:
      T -
      Parameters:
      left -
      right -
      Returns:
    • compareFalseLess

      public static Chain.ComparisonChain compareFalseLess(boolean left, boolean right)
      Compares two boolean values, considering false to be less than true, if the result of this comparison chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • compareTrueLess

      public static Chain.ComparisonChain compareTrueLess(boolean left, boolean right)
      Compares two boolean values, considering true to be less than false, if the result of this comparison chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • compare

      public static Chain.ComparisonChain compare(char left, char right)
      Compares two char values as specified by CommonUtil.compare(boolean, boolean), if the result of this comparison chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • compare

      public static Chain.ComparisonChain compare(byte left, byte right)
      Compares two byte values as specified by CommonUtil.compare(boolean, boolean), if the result of this comparison chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • compare

      public static Chain.ComparisonChain compare(short left, short right)
      Compares two short values as specified by CommonUtil.compare(boolean, boolean), if the result of this comparison chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • compare

      public static Chain.ComparisonChain compare(int left, int right)
      Compares two int values as specified by CommonUtil.compare(boolean, boolean), if the result of this comparison chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • compare

      public static Chain.ComparisonChain compare(long left, long right)
      Compares two long values as specified by CommonUtil.compare(boolean, boolean), if the result of this comparison chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • compare

      public static Chain.ComparisonChain compare(float left, float right)
      Compares two float values as specified by Float.compare(float, float), if the result of this comparison chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • compare

      public static Chain.ComparisonChain compare(double left, double right)
      Compares two double values as specified by Double.compare(double, double), if the result of this comparison chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      ComparisonChain
    • equals

      public static Chain.EquivalenceChain equals(Object left, Object right)
      Compares two comparable objects as specified by CommonUtil.equals(Object, Object), if the result of this equivalence chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      EquivalenceChain
    • equals

      public static <T, E extends Exception> Chain.EquivalenceChain equals(T left, T right, Throwables.BiFunction<? super T,? super T,Boolean,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      left -
      right -
      func -
      Returns:
      Throws:
      E - the e
    • equals

      public static Chain.EquivalenceChain equals(boolean left, boolean right)
      Compares two boolean values as specified by left == right, if the result of this equivalence chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      EquivalenceChain
    • equals

      public static Chain.EquivalenceChain equals(char left, char right)
      Compares two char values as specified by left == right, if the result of this equivalence chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      EquivalenceChain
    • equals

      public static Chain.EquivalenceChain equals(byte left, byte right)
      Compares two byte values as specified by left == right, if the result of this equivalence chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      EquivalenceChain
    • equals

      public static Chain.EquivalenceChain equals(short left, short right)
      Compares two short values as specified by left == right, if the result of this equivalence chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      EquivalenceChain
    • equals

      public static Chain.EquivalenceChain equals(int left, int right)
      Compares two int values as specified by left == right, if the result of this equivalence chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      EquivalenceChain
    • equals

      public static Chain.EquivalenceChain equals(long left, long right)
      Compares two long values as specified by left == right, if the result of this equivalence chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      EquivalenceChain
    • equals

      public static Chain.EquivalenceChain equals(float left, float right)
      Compares two float values as specified by Float.compare(float, float), if the result of this equivalence chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      EquivalenceChain
    • equals

      public static Chain.EquivalenceChain equals(double left, double right)
      Compares two double values as specified by Double.compare(double, double), if the result of this equivalence chain has not already been determined.
      Parameters:
      left -
      right -
      Returns:
      EquivalenceChain
    • hash

      public static Chain.HashCodeChain hash(Object value)
      Add the hash code of the specified value to result.
      Parameters:
      value -
      Returns:
      this
    • hash

      public static <T, E extends Exception> Chain.HashCodeChain hash(T value, Throwables.ToIntFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      value -
      func -
      Returns:
      Throws:
      E - the e
    • hash

      public static Chain.HashCodeChain hash(boolean value)
      Add the hash code of the specified value to result.
      Parameters:
      value -
      Returns:
      this
    • hash

      public static Chain.HashCodeChain hash(char value)
      Add the hash code of the specified value to result.
      Parameters:
      value -
      Returns:
      this
    • hash

      public static Chain.HashCodeChain hash(byte value)
      Add the hash code of the specified value to result.
      Parameters:
      value -
      Returns:
      this
    • hash

      public static Chain.HashCodeChain hash(short value)
      Add the hash code of the specified value to result.
      Parameters:
      value -
      Returns:
      this
    • hash

      public static Chain.HashCodeChain hash(int value)
      Add the hash code of the specified value to result.
      Parameters:
      value -
      Returns:
      this
    • hash

      public static Chain.HashCodeChain hash(long value)
      Add the hash code of the specified value to result.
      Parameters:
      value -
      Returns:
      this
    • hash

      public static Chain.HashCodeChain hash(float value)
      Add the hash code of the specified value to result.
      Parameters:
      value -
      Returns:
      this
    • hash

      public static Chain.HashCodeChain hash(double value)
      Add the hash code of the specified value to result.
      Parameters:
      value -
      Returns:
      this