@Immutable public static final class u.OptionalLong extends Object implements Comparable<u.OptionalLong>, Immutable
public static u.OptionalLong empty()
public static u.OptionalLong of(long value)
value - public static u.OptionalLong ofNullable(Long val)
val - public long get()
throws NoSuchElementException
NoSuchElementException - the no such element exceptionpublic boolean isPresent()
public boolean isEmpty()
public <E extends Exception> u.OptionalLong ifPresent(Throwables.LongConsumer<E> action) throws E extends Exception
E - action - E - the eE extends Exceptionpublic <E extends Exception,E2 extends Exception> u.OptionalLong ifPresentOrElse(Throwables.LongConsumer<E> action, Throwables.Runnable<E2> emptyAction) throws E extends Exception, E2 extends Exception
E - E2 - action - emptyAction - E - the eE2 - the e2E extends Exceptionpublic <E extends Exception> u.OptionalLong filter(Throwables.LongPredicate<E> predicate) throws E extends Exception
E - predicate - E - the eE extends Exceptionpublic <E extends Exception> u.OptionalLong map(Throwables.LongUnaryOperator<E> mapper) throws E extends Exception
E - mapper - E - the eE extends Exceptionpublic <E extends Exception> u.OptionalInt mapToInt(Throwables.ToIntFunction<Long,E> mapper) throws E extends Exception
E - mapper - E - the eE extends Exceptionpublic <E extends Exception> u.OptionalDouble mapToDouble(Throwables.ToDoubleFunction<Long,E> mapper) throws E extends Exception
E - mapper - E - the eE extends Exceptionpublic <T,E extends Exception> u.Nullable<T> mapToObj(Throwables.LongFunction<T,E> mapper) throws E extends Exception
T - E - mapper - E - the eE extends Exceptionpublic <T,E extends Exception> u.Optional<T> mapToNonNull(Throwables.LongFunction<T,E> mapper) throws E extends Exception
E extends Exceptionpublic <E extends Exception> u.OptionalLong flatMap(Throwables.LongFunction<u.OptionalLong,E> mapper) throws E extends Exception
E - mapper - E - the eE extends Exceptionpublic <E extends Exception> u.OptionalLong or(Throwables.Supplier<u.OptionalLong,E> supplier) throws E extends Exception
E - supplier - E - the eE extends Exceptionpublic long orZero()
public long orElseThrow()
throws NoSuchElementException
NoSuchElementException - the no such element exceptionpublic long orElse(long other)
other - public <E extends Exception> long orElseGet(Throwables.LongSupplier<E> other) throws E extends Exception
E - other - E - the eE extends Exceptionpublic <X extends Throwable> long orElseThrow(Supplier<? extends X> exceptionSupplier) throws X extends Throwable
X - exceptionSupplier - X - the xX extends Throwablepublic ImmutableList<Long> toImmutableList()
public ImmutableSet<Long> toImmutableSet()
public u.Optional<Long> boxed()
public int compareTo(u.OptionalLong optional)
compareTo in interface Comparable<u.OptionalLong>optional - public boolean equals(Object obj)
Copyright © 2021. All rights reserved.