Package com.onslip360

Class Erasable<T>


  • public class Erasable<T>
    extends Object
    • Method Detail

      • nil

        @Nonnull
        public static <T> Erasable<T> nil()
      • empty

        @Nonnull
        public static <T> Erasable<T> empty()
      • of

        @Nonnull
        public static <T> Erasable<T> of​(T value)
      • nilOr

        @Nonnull
        public static <T> Erasable<T> nilOr​(T value)
      • ofNullable

        @Nonnull
        public static <T> Erasable<T> ofNullable​(@Nullable
                                                 T value)
      • ofOptional

        @Nonnull
        public static <T> Erasable<T> ofOptional​(@Nullable
                                                 Optional<T> value)
      • ofErasable

        @Nonnull
        public static <T> Erasable<T> ofErasable​(@Nullable
                                                 Erasable<T> value)
      • asOptional

        @Nonnull
        public Optional<T> asOptional()
      • get

        @Nonnull
        public T get()
      • isPresent

        public boolean isPresent()
      • isEmpty

        public boolean isEmpty()
      • isNil

        public boolean isNil()
      • isNil

        public static boolean isNil​(@Nullable
                                    Object erasable)
      • ifPresent

        public void ifPresent​(Consumer<? super T> action)
      • ifPresentOrElse

        public void ifPresentOrElse​(Consumer<? super T> action,
                                    Runnable emptyAction)
      • map

        @Nonnull
        public <U> Erasable<U> map​(Function<? super T,​? extends U> mapper)
      • stream

        @Nonnull
        public Stream<T> stream()
      • orElse

        public T orElse​(T other)
      • orElseGet

        public T orElseGet​(Supplier<? extends T> supplier)
      • orElseThrow

        @Nonnull
        public T orElseThrow()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object