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

Class Some

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

The Some type, representing an existence of some value @param The type of value

Source from the content-addressed store, hash-verified

91 * @param <T> The type of value
92 */
93 public static class Some<T> extends Option<T> {
94 private final T value;
95
96 public Some(T value) {
97 this.value = value;
98 }
99
100 public boolean isDefined() {
101 return true;
102 }
103
104 public T get() {
105 return value;
106 }
107
108 public String toString() {
109 return "Some(" + value + ")";
110 }
111 }
112
113 /**
114 * Wraps value in an Option type, depending on whether or not value is null

Calls

no outgoing calls