MCPcopy
hub / github.com/google/gson / getAsString

Method getAsString

src/main/java/com/google/gson/JsonPrimitive.java:183–192  ·  view source on GitHub ↗

convenience method to get this element as a String. @return get this element as a String.

()

Source from the content-addressed store, hash-verified

181 * @return get this element as a String.
182 */
183 @Override
184 public String getAsString() {
185 if (isNumber()) {
186 return getAsNumber().toString();
187 } else if (isBoolean()) {
188 return getAsBooleanWrapper().toString();
189 } else {
190 return (String) value;
191 }
192 }
193
194 /**
195 * convenience method to get this element as a primitive double.

Callers 10

testStringsAndCharMethod · 0.95
getAsBooleanMethod · 0.95
getAsDoubleMethod · 0.95
getAsFloatMethod · 0.95
getAsLongMethod · 0.95
getAsShortMethod · 0.95
getAsIntMethod · 0.95
getAsByteMethod · 0.95
getAsCharacterMethod · 0.95
writeMethod · 0.95

Calls 5

isNumberMethod · 0.95
getAsNumberMethod · 0.95
isBooleanMethod · 0.95
getAsBooleanWrapperMethod · 0.95
toStringMethod · 0.45

Tested by 1

testStringsAndCharMethod · 0.76