Lines Matching refs:other
143 * Return the value if present, otherwise return {@code other}.
145 * @param other the value to be returned if there is no value present
146 * @return the value, if present, otherwise {@code other}
148 public int orElse(int other) {
149 return isPresent ? value : other;
153 * Return the value if present, otherwise invoke {@code other} and return
156 * @param other a {@code IntSupplier} whose result is returned if no value
158 * @return the value if present otherwise the result of {@code other.getAsInt()}
159 * @throws NullPointerException if value is not present and {@code other} is
162 public int orElseGet(IntSupplier other) {
163 return isPresent ? value : other.getAsInt();
191 * Indicates whether some other object is "equal to" this OptionalInt. The
192 * other object is considered equal if:
196 * <li>the present values are "equal to" each other via {@code ==}.
200 * @return {code true} if the other object is "equal to" this object
213 OptionalInt other = (OptionalInt) obj;
214 return (isPresent && other.isPresent)
215 ? value == other.value
216 : isPresent == other.isPresent;