@Test public void testToString() { assertEquals(OptionalInt.empty().toString(), "OptionalInt.empty"); assertEquals(OptionalInt.of(42).toString(), "OptionalInt[42]"); }
@NotNull @Override public String toString() { return isPresent ? String.format("OptionalInt[%s]", value) : "OptionalInt.empty"; }
OptionalInt { @NotNull @Override public String toString() { return isPresent ? String.format("OptionalInt[%s]", value) : "OptionalInt.empty"; } }
OptionalInt { @NotNull @Override public String toString() { return isPresent ? String.format("OptionalInt[%s]", value) : "OptionalInt.empty"; } private  OptionalInt(); private  OptionalInt(int value); }
OptionalInt { @NotNull @Override public String toString() { return isPresent ? String.format("OptionalInt[%s]", value) : "OptionalInt.empty"; } private  OptionalInt(); private  OptionalInt(int value); @NotNull static OptionalInt empty(); @NotNull static OptionalInt of(int value); @NotNull static OptionalInt ofNullable(@Nullable Integer value); int getAsInt(); boolean isPresent(); boolean isEmpty(); void ifPresent(@NotNull IntConsumer consumer); void ifPresentOrElse(@NotNull IntConsumer consumer, @NotNull Runnable emptyAction); @NotNull OptionalInt executeIfPresent(@NotNull IntConsumer consumer); @NotNull OptionalInt executeIfAbsent(@NotNull Runnable action); @Nullable R custom(@NotNull Function<OptionalInt, R> function); @NotNull OptionalInt filter(@NotNull IntPredicate predicate); @NotNull OptionalInt filterNot(@NotNull IntPredicate predicate); @NotNull OptionalInt map(@NotNull IntUnaryOperator mapper); @NotNull Optional<U> mapToObj(@NotNull IntFunction<U> mapper); @NotNull OptionalLong mapToLong(@NotNull IntToLongFunction mapper); @NotNull OptionalDouble mapToDouble(@NotNull IntToDoubleFunction mapper); @NotNull IntStream stream(); @NotNull OptionalInt or(@NotNull Supplier<OptionalInt> supplier); int orElse(int other); int orElseGet(@NotNull IntSupplier other); int orElseThrow(); int orElseThrow(@NotNull Supplier<X> exceptionSupplier); @Override boolean equals(Object obj); @Override int hashCode(); @NotNull @Override String toString(); }
OptionalInt { @NotNull @Override public String toString() { return isPresent ? String.format("OptionalInt[%s]", value) : "OptionalInt.empty"; } private  OptionalInt(); private  OptionalInt(int value); @NotNull static OptionalInt empty(); @NotNull static OptionalInt of(int value); @NotNull static OptionalInt ofNullable(@Nullable Integer value); int getAsInt(); boolean isPresent(); boolean isEmpty(); void ifPresent(@NotNull IntConsumer consumer); void ifPresentOrElse(@NotNull IntConsumer consumer, @NotNull Runnable emptyAction); @NotNull OptionalInt executeIfPresent(@NotNull IntConsumer consumer); @NotNull OptionalInt executeIfAbsent(@NotNull Runnable action); @Nullable R custom(@NotNull Function<OptionalInt, R> function); @NotNull OptionalInt filter(@NotNull IntPredicate predicate); @NotNull OptionalInt filterNot(@NotNull IntPredicate predicate); @NotNull OptionalInt map(@NotNull IntUnaryOperator mapper); @NotNull Optional<U> mapToObj(@NotNull IntFunction<U> mapper); @NotNull OptionalLong mapToLong(@NotNull IntToLongFunction mapper); @NotNull OptionalDouble mapToDouble(@NotNull IntToDoubleFunction mapper); @NotNull IntStream stream(); @NotNull OptionalInt or(@NotNull Supplier<OptionalInt> supplier); int orElse(int other); int orElseGet(@NotNull IntSupplier other); int orElseThrow(); int orElseThrow(@NotNull Supplier<X> exceptionSupplier); @Override boolean equals(Object obj); @Override int hashCode(); @NotNull @Override String toString();  }