/** * Return an {@code OptionalInt} with the specified value present. * * @param value the value to be present * @return an {@code OptionalInt} with the value present */ public static OptionalInt of(int value) { return new OptionalInt(value); }
public static OptionalInt empty() { if (INSTANCE_EMPTY == null) { INSTANCE_EMPTY = new OptionalInt(false, 0); } return INSTANCE_EMPTY; }
public static OptionalInt of(int value) { return new OptionalInt(true, value); }