/** Finds the child with the specified index and returns it as a boolean. * @throws IllegalArgumentException if the child was not found. */ public boolean getBoolean (int index) { JsonValue child = get(index); if (child == null) throw new IllegalArgumentException("Indexed value not found: " + name); return child.asBoolean(); }
/** Finds the child with the specified name and returns it as a boolean. * @throws IllegalArgumentException if the child was not found. */ public boolean getBoolean (String name) { JsonValue child = get(name); if (child == null) throw new IllegalArgumentException("Named value not found: " + name); return child.asBoolean(); }
/** Finds the child with the specified name and returns it as a boolean. * @throws IllegalArgumentException if the child was not found. */ public boolean getBoolean (String name) { JsonValue child = get(name); if (child == null) throw new IllegalArgumentException("Named value not found: " + name); return child.asBoolean(); }
/** Finds the child with the specified index and returns it as a boolean. * @throws IllegalArgumentException if the child was not found. */ public boolean getBoolean (int index) { JsonValue child = get(index); if (child == null) throw new IllegalArgumentException("Indexed value not found: " + name); return child.asBoolean(); }
/** Finds the child with the specified name and returns it as a boolean. Returns defaultValue if not found. */ public boolean getBoolean (String name, boolean defaultValue) { JsonValue child = get(name); return (child == null || !child.isValue() || child.isNull()) ? defaultValue : child.asBoolean(); }
/** Finds the child with the specified name and returns it as a boolean. Returns defaultValue if not found. */ public boolean getBoolean (String name, boolean defaultValue) { JsonValue child = get(name); return (child == null || !child.isValue() || child.isNull()) ? defaultValue : child.asBoolean(); }
writer.append(Long.toString(object.asLong())); } else if (object.isBoolean()) { writer.append(Boolean.toString(object.asBoolean())); } else if (object.isNull()) { writer.append("null");
writer.append(Long.toString(object.asLong())); } else if (object.isBoolean()) { writer.append(Boolean.toString(object.asBoolean())); } else if (object.isNull()) { writer.append("null");
if (type == null || type == boolean.class || type == Boolean.class) return (T)(Boolean)jsonData.asBoolean(); } catch (NumberFormatException ignored) {
if (type == null || type == boolean.class || type == Boolean.class) return (T)(Boolean)jsonData.asBoolean(); } catch (NumberFormatException ignored) {
} else if (value.isBoolean()) { if (value.name != null) name(value.name); value(value.asBoolean()); } else if (value.isDouble()) { if (value.name != null) name(value.name);
} else if (value.isBoolean()) { if (value.name != null) name(value.name); value(value.asBoolean()); } else if (value.isDouble()) { if (value.name != null) name(value.name);
buffer.append(object.asLong()); } else if (object.isBoolean()) { buffer.append(object.asBoolean()); } else if (object.isNull()) { buffer.append("null");
buffer.append(object.asLong()); } else if (object.isBoolean()) { buffer.append(object.asBoolean()); } else if (object.isNull()) { buffer.append("null");
buffer.append(object.asLong()); } else if (object.isBoolean()) { buffer.append(object.asBoolean()); } else if (object.isNull()) { buffer.append("null");
buffer.append(object.asLong()); } else if (object.isBoolean()) { buffer.append(object.asBoolean()); } else if (object.isNull()) { buffer.append("null");
/** Finds the child with the specified index and returns it as a boolean. * @throws IllegalArgumentException if the child was not found. */ public boolean getBoolean (int index) { JsonValue child = get(index); if (child == null) throw new IllegalArgumentException("Indexed value not found: " + name); return child.asBoolean(); }
/** Finds the child with the specified name and returns it as a boolean. * @throws IllegalArgumentException if the child was not found. */ public boolean getBoolean (String name) { JsonValue child = get(name); if (child == null) throw new IllegalArgumentException("Named value not found: " + name); return child.asBoolean(); }
/** Finds the child with the specified name and returns it as a boolean. Returns defaultValue if not found. */ public boolean getBoolean (String name, boolean defaultValue) { JsonValue child = get(name); return (child == null || !child.isValue() || child.isNull()) ? defaultValue : child.asBoolean(); }
private Object getValue(JsonValue val) { Object value = null; switch (val.type()) { case stringValue: value = val.asString(); break; case doubleValue: value = val.asDouble(); break; case booleanValue: value = val.asBoolean(); break; case longValue: value = val.asLong(); break; default: break; } return value; }