public final class OptionalInt extends Object
Modifier and Type | Method and Description |
---|---|
static OptionalInt |
empty() |
boolean |
equals(Object obj) |
int |
getAsInt() |
int |
hashCode() |
void |
ifPresent(IntConsumer consumer) |
boolean |
isPresent() |
static OptionalInt |
of(int value) |
int |
orElse(int other) |
int |
orElseGet(IntSupplier other) |
<X extends Throwable> |
orElseThrow(Supplier<X> exceptionSupplier) |
String |
toString() |
public static OptionalInt empty()
public static OptionalInt of(int value)
public boolean isPresent()
public int getAsInt()
public void ifPresent(IntConsumer consumer)
public int orElse(int other)
public int orElseGet(IntSupplier other)
public <X extends Throwable> int orElseThrow(Supplier<X> exceptionSupplier) throws X extends Throwable
X extends Throwable
Copyright © 2018. All rights reserved.