MCPcopy Create free account
hub / github.com/apache/thrift / or

Method or

lib/java/src/main/java/org/apache/thrift/Option.java:52–58  ·  view source on GitHub ↗

Get the contained value (if defined) or else return a default value @param other what to return if the value is not defined (a None) @return either the value, or other if the value is not defined

(T other)

Source from the content-addressed store, hash-verified

50 * @return either the value, or other if the value is not defined
51 */
52 public T or(T other) {
53 if (isDefined()) {
54 return get();
55 } else {
56 return other;
57 }
58 }
59
60 /**
61 * Turn this Option into Java 8 Optional type

Callers 2

testSomeMethod · 0.80
testNoneMethod · 0.80

Calls 2

isDefinedMethod · 0.95
getMethod · 0.95

Tested by 2

testSomeMethod · 0.64
testNoneMethod · 0.64