Class JavaUtils

java.lang.Object
org.springframework.pulsar.support.JavaUtils

public final class JavaUtils extends Object
Chained utility methods to simplify some Java repetitive code. Obtain a reference to the singleton INSTANCE and then chain calls to the utility methods.
Author:
Soby Chacko
  • Field Details

    • INSTANCE

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

    • acceptIfNotNull

      public <T> JavaUtils acceptIfNotNull(@Nullable T value, Consumer<T> consumer)
      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.