Lines Matching refs:other
142 * Return the value if present, otherwise return {@code other}.
144 * @param other the value to be returned if there is no value present
145 * @return the value, if present, otherwise {@code other}
147 public long orElse(long other) {
148 return isPresent ? value : other;
152 * Return the value if present, otherwise invoke {@code other} and return
155 * @param other a {@code LongSupplier} whose result is returned if no value
157 * @return the value if present otherwise the result of {@code other.getAsLong()}
158 * @throws NullPointerException if value is not present and {@code other} is
161 public long orElseGet(LongSupplier other) {
162 return isPresent ? value : other.getAsLong();
190 * Indicates whether some other object is "equal to" this OptionalLong. The
191 * other object is considered equal if:
195 * <li>the present values are "equal to" each other via {@code ==}.
199 * @return {code true} if the other object is "equal to" this object
212 OptionalLong other = (OptionalLong) obj;
213 return (isPresent && other.isPresent)
214 ? value == other.value
215 : isPresent == other.isPresent;