Class JavaUtils

java.lang.Object
org.springframework.integration.util.JavaUtils

@Deprecated
public final class JavaUtils
extends java.lang.Object
Deprecated.
since 5.5.6 in favor of JavaUtils.
Chained utility methods to simplify some Java repetitive code. Obtain a reference to the singleton INSTANCE and then chain calls to the utility methods.
Since:
5.1.3
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static JavaUtils INSTANCE
    Deprecated.
    The singleton instance of this utility class.
  • Method Summary

    Modifier and Type Method Description
    <T1,​ T2> JavaUtils acceptIfCondition​(boolean condition, T1 t1, T2 t2, java.util.function.BiConsumer<T1,​T2> consumer)
    Deprecated.
    Invoke BiConsumer.accept(Object, Object) with the arguments if the condition is true.
    <T> JavaUtils acceptIfCondition​(boolean condition, T value, java.util.function.Consumer<T> consumer)
    Deprecated.
    Invoke Consumer.accept(Object) with the value if the condition is true.
    JavaUtils acceptIfHasText​(java.lang.String value, java.util.function.Consumer<java.lang.String> consumer)
    Deprecated.
    Invoke Consumer.accept(Object) with the value if it is not null or empty.
    <T> JavaUtils acceptIfHasText​(T t1, java.lang.String value, java.util.function.BiConsumer<T,​java.lang.String> consumer)
    Deprecated.
    Invoke BiConsumer.accept(Object, Object) with the arguments if the value argument is not null or empty.
    <T> JavaUtils acceptIfNotEmpty​(java.util.List<T> value, java.util.function.Consumer<java.util.List<T>> consumer)
    Deprecated.
    Invoke Consumer.accept(Object) with the value if it is not null or empty.
    <T> JavaUtils acceptIfNotEmpty​(T[] value, java.util.function.Consumer<T[]> consumer)
    Deprecated.
    Invoke Consumer.accept(Object) with the value if it is not null or empty.
    <T1,​ T2> JavaUtils acceptIfNotNull​(T1 t1, T2 t2, java.util.function.BiConsumer<T1,​T2> consumer)
    Deprecated.
    Invoke BiConsumer.accept(Object, Object) with the arguments if the t2 argument is not null.
    <T> JavaUtils acceptIfNotNull​(T value, java.util.function.Consumer<T> consumer)
    Deprecated.
    Invoke Consumer.accept(Object) with the value if it is not null.

    Methods inherited from class java.lang.Object

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

    • INSTANCE

      public static final JavaUtils INSTANCE
      Deprecated.
      The singleton instance of this utility class.
  • Method Details

    • acceptIfCondition

      public <T> JavaUtils acceptIfCondition​(boolean condition, T value, java.util.function.Consumer<T> consumer)
      Deprecated.
      Invoke Consumer.accept(Object) with the value if the condition is true.
      Type Parameters:
      T - the value type.
      Parameters:
      condition - the condition.
      value - the value.
      consumer - the consumer.
      Returns:
      this.
    • acceptIfNotNull

      public <T> JavaUtils acceptIfNotNull​(T value, java.util.function.Consumer<T> consumer)
      Deprecated.
      Invoke Consumer.accept(Object) with the value if it is not null.
      Type Parameters:
      T - the value type.
      Parameters:
      value - the value.
      consumer - the consumer.
      Returns:
      this.
    • acceptIfHasText

      public JavaUtils acceptIfHasText​(java.lang.String value, java.util.function.Consumer<java.lang.String> consumer)
      Deprecated.
      Invoke Consumer.accept(Object) with the value if it is not null or empty.
      Parameters:
      value - the value.
      consumer - the consumer.
      Returns:
      this.
      Since:
      5.2
    • acceptIfNotEmpty

      public <T> JavaUtils acceptIfNotEmpty​(java.util.List<T> value, java.util.function.Consumer<java.util.List<T>> consumer)
      Deprecated.
      Invoke Consumer.accept(Object) with the value if it is not null or empty.
      Type Parameters:
      T - the value type.
      Parameters:
      value - the value.
      consumer - the consumer.
      Returns:
      this.
      Since:
      5.2
    • acceptIfNotEmpty

      public <T> JavaUtils acceptIfNotEmpty​(T[] value, java.util.function.Consumer<T[]> consumer)
      Deprecated.
      Invoke Consumer.accept(Object) with the value if it is not null or empty.
      Type Parameters:
      T - the value type.
      Parameters:
      value - the value.
      consumer - the consumer.
      Returns:
      this.
      Since:
      5.2
    • acceptIfCondition

      public <T1,​ T2> JavaUtils acceptIfCondition​(boolean condition, T1 t1, T2 t2, java.util.function.BiConsumer<T1,​T2> consumer)
      Deprecated.
      Invoke BiConsumer.accept(Object, Object) with the arguments if the condition is true.
      Type Parameters:
      T1 - the first argument type.
      T2 - the second argument type.
      Parameters:
      condition - the condition.
      t1 - the first consumer argument
      t2 - the second consumer argument
      consumer - the consumer.
      Returns:
      this.
      Since:
      5.2
    • acceptIfNotNull

      public <T1,​ T2> JavaUtils acceptIfNotNull​(T1 t1, T2 t2, java.util.function.BiConsumer<T1,​T2> consumer)
      Deprecated.
      Invoke BiConsumer.accept(Object, Object) with the arguments if the t2 argument is not null.
      Type Parameters:
      T1 - the first argument type.
      T2 - the second argument type.
      Parameters:
      t1 - the first argument
      t2 - the second consumer argument
      consumer - the consumer.
      Returns:
      this.
      Since:
      5.2
    • acceptIfHasText

      public <T> JavaUtils acceptIfHasText​(T t1, java.lang.String value, java.util.function.BiConsumer<T,​java.lang.String> consumer)
      Deprecated.
      Invoke BiConsumer.accept(Object, Object) with the arguments if the value argument is not null or empty.
      Type Parameters:
      T - the first argument type.
      Parameters:
      t1 - the first consumer argument.
      value - the second consumer argument
      consumer - the consumer.
      Returns:
      this.
      Since:
      5.2