public synchronized boolean isWatchOnlyOrInvalidAddress(String address) throws WalletCallException, IOException, InterruptedException { JsonObject response = this.executeCommandAndGetJsonValue("validateaddress", wrapStringParameter(address)).asObject(); if (response.getBoolean("isvalid", false)) { return response.getBoolean("iswatchonly", true); } return true; }
public synchronized boolean isWatchOnlyOrInvalidAddress(String address) throws WalletCallException, IOException, InterruptedException { JsonObject response = this.executeCommandAndGetJsonValue("validateaddress", wrapStringParameter(address)).asObject(); if (response.getBoolean("isvalid", false)) { return response.getBoolean("iswatchonly", true); } return true; }
public void copyFromJSONObject(JsonObject obj) throws IOException { // Mandatory fields! this.automaticallyAddUsersIfNotExplicitlyImported = obj.getBoolean("automaticallyaddusersifnotexplicitlyimported", true); this.amountToSend = obj.getDouble("amounttosend", 0.0001d); this.transactionFee = obj.getDouble("transactionfee", 0.0001d); }
public void copyFromJSONObject(JsonObject obj) throws IOException { // Mandatory fields! this.automaticallyAddUsersIfNotExplicitlyImported = obj.getBoolean("automaticallyaddusersifnotexplicitlyimported", true); this.amountToSend = obj.getDouble("amounttosend", 0.0001d); this.transactionFee = obj.getDouble("transactionfee", 0.0001d); }
this.diferenciaConfiguration.storeResults = configuration.getString("storeResults", null); this.diferenciaConfiguration.differenceMode = DiferenciaMode.valueOf(configuration.getString("differenceMode", "").toUpperCase()); this.diferenciaConfiguration.noiseDetection = configuration.getBoolean("noiseDetection", false); this.diferenciaConfiguration.mirroring = configuration.getBoolean("mirroring", false); this.diferenciaConfiguration.returnResult = configuration.getBoolean("returnResult", false); this.diferenciaConfiguration.headers = configuration.getBoolean("headers", false); diferenciaConfiguration.allowUnsafeOperations = configuration.getBoolean("allowUnsafeOperartions", false); diferenciaConfiguration.insecureSkipVerify = configuration.getBoolean("insecureSkipVerify", false); diferenciaConfiguration.caCert = configuration.getString("caCert", null); diferenciaConfiguration.clientCert = configuration.getString("clientCert", null); diferenciaConfiguration.clientKey = configuration.getString("clientKey", null); diferenciaConfiguration.prometheus = configuration.getBoolean("prometheus", false); diferenciaConfiguration.forcePlainText = configuration.getBoolean("forcePlainText", false);
try { JsonObject obj = (JsonObject) object; boolean isPresent = obj.getBoolean("isPresent", false); if (isPresent) { JsonValue subJson = obj.get("subobject");
boolean subcl = obj.getBoolean("subclassed", false);
@Test public void testSaveAndLoad() { String apiKey = UUID.randomUUID().toString(); boolean syncSpectogram = true; client.saveR2CloudConfiguration(apiKey, syncSpectogram); JsonObject config = client.getR2CloudConfiguration(); assertEquals(apiKey, config.getString("apiKey", null)); assertTrue(config.getBoolean("syncSpectogram", false)); }
@Override public ResourceModel deserialize(JsonObject o) { if (o == null) return null; if (!o.isObject()) return null; int id = o.getInt("id", -1); if (id < 0) return null; String name = o.getString("name", null); Operations operations = Operations.valueOf(o.getString("operations", null)); String instancetype = o.getString("instancetype", null); boolean mandatory = o.getBoolean("mandatory", false); Type type = Type.valueOf(o.getString("type", "").toUpperCase()); String range = o.getString("range", null); String units = o.getString("units", null); String description = o.getString("description", null); return new ResourceModel(id, name, operations, "multiple".equals(instancetype), mandatory, type, range, units, description); } }
@Override public ObjectModel deserialize(JsonObject o) { if (o == null) return null; if (!o.isObject()) return null; int id = o.getInt("id", -1); if (id < 0) return null; String name = o.getString("name", null); String instancetype = o.getString("instancetype", null); boolean mandatory = o.getBoolean("mandatory", false); String description = o.getString("description", null); String version = o.getString("version", ObjectModel.DEFAULT_VERSION); List<ResourceModel> resourceSpecs = resourceModelSerDes.deserialize(o.get("resourcedefs").asArray()); return new ObjectModel(id, name, description, version, "multiple".equals(instancetype), mandatory, resourceSpecs); } }
this.twitter = obj.getString("twitter", ""); this.isAnonymous = obj.getBoolean("isanonymous", false); this.isGroup = obj.getBoolean("isgroup", false); this.threadID = obj.getString("threadid", "");
this.twitter = obj.getString("twitter", ""); this.isAnonymous = obj.getBoolean("isanonymous", false); this.isGroup = obj.getBoolean("isgroup", false); this.threadID = obj.getString("threadid", "");
public void copyFromJSONObject(JsonObject obj) { // Wire protocol fields this.version = obj.getInt("ver", 1); this.from = obj.getString("from", ""); this.message = obj.getString("message", ""); this.sign = obj.getString("sign", ""); this.threadID = obj.getString("threadid", ""); this.returnAddress = obj.getString("returnaddress", ""); // Additional fields - may be missing, get default values this.transactionID = obj.getString("transactionID", ""); this.time = new Date(obj.getLong("time", 0)); this.direction = DIRECTION_TYPE.valueOf( obj.getString("direction", DIRECTION_TYPE.RECEIVED.toString())); this.verification = VERIFICATION_TYPE.valueOf( obj.getString("verification", VERIFICATION_TYPE.UNVERIFIED.toString())); if (obj.get("isanonymous") != null) { this.isAnonymous = obj.getBoolean("isanonymous", false); } else { // Determine from content if it is anonymous this.isAnonymous = obj.get("threadid") != null; } }
public void copyFromJSONObject(JsonObject obj) { // Wire protocol fields this.version = obj.getInt("ver", 1); this.from = obj.getString("from", ""); this.message = obj.getString("message", ""); this.sign = obj.getString("sign", ""); this.threadID = obj.getString("threadid", ""); this.returnAddress = obj.getString("returnaddress", ""); // Additional fields - may be missing, get default values this.transactionID = obj.getString("transactionID", ""); this.time = new Date(obj.getLong("time", 0)); this.direction = DIRECTION_TYPE.valueOf( obj.getString("direction", DIRECTION_TYPE.RECEIVED.toString())); this.verification = VERIFICATION_TYPE.valueOf( obj.getString("verification", VERIFICATION_TYPE.UNVERIFIED.toString())); if (obj.get("isanonymous") != null) { this.isAnonymous = obj.getBoolean("isanonymous", false); } else { // Determine from content if it is anonymous this.isAnonymous = obj.get("threadid") != null; } }