public static final class u.OptionalInt extends Object implements Comparable<u.OptionalInt>
public static u.OptionalInt empty()
public static u.OptionalInt of(int value)
value
- public static u.OptionalInt ofNullable(Integer val)
val
- public static u.OptionalInt from(OptionalInt op)
op
- public int get() throws NoSuchElementException
NoSuchElementException
- the no such element exceptionpublic boolean isPresent()
public boolean isEmpty()
public <E extends Exception> u.OptionalInt ifPresent(Throwables.IntConsumer<E> action) throws E extends Exception
E
- action
- E
- the eE extends Exception
public <E extends Exception,E2 extends Exception> u.OptionalInt ifPresentOrElse(Throwables.IntConsumer<E> action, Throwables.Runnable<E2> emptyAction) throws E extends Exception, E2 extends Exception
E
- E2
- action
- emptyAction
- E
- the eE2
- the e2E extends Exception
public <E extends Exception> u.OptionalInt filter(Throwables.IntPredicate<E> predicate) throws E extends Exception
E
- predicate
- E
- the eE extends Exception
public <E extends Exception> u.OptionalInt map(Throwables.IntUnaryOperator<E> mapper) throws E extends Exception
E
- mapper
- E
- the eE extends Exception
public <E extends Exception> u.OptionalLong mapToLong(Throwables.ToLongFunction<Integer,E> mapper) throws E extends Exception
E
- mapper
- E
- the eE extends Exception
public <E extends Exception> u.OptionalDouble mapToDouble(Throwables.ToDoubleFunction<Integer,E> mapper) throws E extends Exception
E
- mapper
- E
- the eE extends Exception
public <T,E extends Exception> u.Nullable<T> mapToObj(Throwables.IntFunction<T,E> mapper) throws E extends Exception
T
- E
- mapper
- E
- the eE extends Exception
public <T,E extends Exception> u.Optional<T> mapToNonNull(Throwables.IntFunction<T,E> mapper) throws E extends Exception
E extends Exception
public <E extends Exception> u.OptionalInt flatMap(Throwables.IntFunction<u.OptionalInt,E> mapper) throws E extends Exception
E
- mapper
- E
- the eE extends Exception
public <E extends Exception> u.OptionalInt or(Throwables.Supplier<u.OptionalInt,E> supplier) throws E extends Exception
E
- supplier
- E
- the eE extends Exception
public int orZero()
public int orElseThrow() throws NoSuchElementException
NoSuchElementException
- the no such element exceptionpublic int orElse(int other)
other
- public <E extends Exception> int orElseGet(Throwables.IntSupplier<E> other) throws E extends Exception
E
- other
- E
- the eE extends Exception
public <X extends Throwable> int orElseThrow(Supplier<? extends X> exceptionSupplier) throws X extends Throwable
X
- exceptionSupplier
- X
- the xX extends Throwable
public IntStream stream()
public ImmutableList<Integer> toImmutableList()
public ImmutableSet<Integer> toImmutableSet()
public u.Optional<Integer> boxed()
public OptionalInt __()
public int compareTo(u.OptionalInt optional)
compareTo
in interface Comparable<u.OptionalInt>
optional
- public boolean equals(Object obj)
Copyright © 2020. All rights reserved.