private void assureJsonArraySize(JsonArray jsonArray, Integer index) { while (index >= jsonArray.size()) { jsonArray.add(Json.NULL); } }
private List<String> parseMyTags(JsonArray jsonArray) { List<String> myTags = new ArrayList<String>(jsonArray.size()); for (JsonValue value : jsonArray) { myTags.add(value.asString()); } return myTags; } private Map<String, String> parseTrackingCodes(JsonArray jsonArray) {
private static List<JsonValue> toList(final com.eclipsesource.json.JsonArray minimalJsonArray) { final List<JsonValue> result = new ArrayList<>(minimalJsonArray.size()); for (final com.eclipsesource.json.JsonValue minimalJsonValue : minimalJsonArray) { result.add(convert(minimalJsonValue)); } return result; }
private List<String> parseTags(JsonArray jsonArray) { List<String> tags = new ArrayList<String>(jsonArray.size()); for (JsonValue value : jsonArray) { tags.add(value.asString()); } return tags; } }
private void assureJsonArraySize(JsonArray jsonArray, Integer index) { while (index >= jsonArray.size()) { jsonArray.add(Json.NULL); } }
public List<T> deserialize(JsonArray a) { ArrayList<T> res = new ArrayList<>(a.size()); for (JsonValue v : a) { res.add(deserialize(v.asObject())); } return res; } }
public synchronized String[] getWalletZAddresses() throws WalletCallException, IOException, InterruptedException { JsonArray jsonAddresses = executeCommandAndGetJsonArray("z_listaddresses", null); String strAddresses[] = new String[jsonAddresses.size()]; for (int i = 0; i < jsonAddresses.size(); i++) { strAddresses[i] = jsonAddresses.get(i).asString(); } return strAddresses; }
public synchronized String[] getWalletZAddresses() throws WalletCallException, IOException, InterruptedException { JsonArray jsonAddresses = executeCommandAndGetJsonArray("z_listaddresses", null); String strAddresses[] = new String[jsonAddresses.size()]; for (int i = 0; i < jsonAddresses.size(); i++) { strAddresses[i] = jsonAddresses.get(i).asString(); } return strAddresses; }
/** * */ public Object getReturnObject(Object object, Class<?> clazz, boolean clone, ClassLoader targetcl) { if(clazz!=null && targetcl!=null) clazz = SReflect.classForName0(SReflect.getClassName(clazz), targetcl); if(clazz==null) clazz = Object.class; int length = ((JsonArray)object).size(); return Array.newInstance(clazz, length); } }
public synchronized String[] getWalletAllPublicAddresses() throws WalletCallException, IOException, InterruptedException { JsonArray jsonReceivedOutputs = executeCommandAndGetJsonArray("listreceivedbyaddress", "0", "true"); Set<String> addresses = new HashSet<>(); for (int i = 0; i < jsonReceivedOutputs.size(); i++) { JsonObject outp = jsonReceivedOutputs.get(i).asObject(); addresses.add(outp.getString("address", "ERROR!")); } return addresses.toArray(new String[0]); }
public synchronized JsonObject[] getTransactionMessagingDataForZaddress(String ZAddress) throws WalletCallException, IOException, InterruptedException { JsonArray jsonTransactions = executeCommandAndGetJsonArray( "z_listreceivedbyaddress", wrapStringParameter(ZAddress), "0"); List<JsonObject> transactions = new ArrayList<JsonObject>(); for (int i = 0; i < jsonTransactions.size(); i++) { JsonObject trans = jsonTransactions.get(i).asObject(); transactions.add(trans); } return transactions.toArray(new JsonObject[0]); }
public synchronized String[] getWalletPublicAddressesWithUnspentOutputs() throws WalletCallException, IOException, InterruptedException { JsonArray jsonUnspentOutputs = executeCommandAndGetJsonArray("listunspent", "0"); Set<String> addresses = new HashSet<>(); for (int i = 0; i < jsonUnspentOutputs.size(); i++) { JsonObject outp = jsonUnspentOutputs.get(i).asObject(); addresses.add(outp.getString("address", "ERROR!")); } return addresses.toArray(new String[0]); }
public synchronized String[] getWalletPublicAddressesWithUnspentOutputs() throws WalletCallException, IOException, InterruptedException { JsonArray jsonUnspentOutputs = executeCommandAndGetJsonArray("listunspent", "0"); Set<String> addresses = new HashSet<>(); for (int i = 0; i < jsonUnspentOutputs.size(); i++) { JsonObject outp = jsonUnspentOutputs.get(i).asObject(); addresses.add(outp.getString("address", "ERROR!")); } return addresses.toArray(new String[0]); }
public synchronized String[] getWalletAllPublicAddresses() throws WalletCallException, IOException, InterruptedException { JsonArray jsonReceivedOutputs = executeCommandAndGetJsonArray("listreceivedbyaddress", "0", "true"); Set<String> addresses = new HashSet<>(); for (int i = 0; i < jsonReceivedOutputs.size(); i++) { JsonObject outp = jsonReceivedOutputs.get(i).asObject(); addresses.add(outp.getString("address", "ERROR!")); } return addresses.toArray(new String[0]); }
@SuppressWarnings("unchecked") @Override public T[] read(JsonValue jsonValue) throws Exception { JsonArray array = jsonValue.asArray(); T[] result = (T[]) Array.newInstance(clazz, array.size()); for (int i = 0; i < result.length; i++) { result[i] = getValue(array.get(i)); } return result; }
public synchronized JsonObject[] getTransactionMessagingDataForZaddress(String ZAddress) throws WalletCallException, IOException, InterruptedException { JsonArray jsonTransactions = executeCommandAndGetJsonArray( "z_listreceivedbyaddress", wrapStringParameter(ZAddress), "0"); List<JsonObject> transactions = new ArrayList<JsonObject>(); for (int i = 0; i < jsonTransactions.size(); i++) { JsonObject trans = jsonTransactions.get(i).asObject(); transactions.add(trans); } return transactions.toArray(new JsonObject[0]); }
public HashSet<String> getPropertyAsStringHashSet(String field) { if (mInternalCache.get(field) != null){ return (HashSet<String>)mInternalCache.get(field); } JsonValue value = getAsJsonValue(field); if (value == null || value.isNull()) { return null; } HashSet<String> strings = new HashSet<String>(value.asArray().size()); for (JsonValue member : value.asArray()){ strings.add(member.asString()); } mInternalCache.put(field, strings); return strings; }
public ArrayList<String> getAsStringArray(final String field){ if (mInternalCache.get(field) != null){ return (ArrayList<String>)mInternalCache.get(field); } JsonValue value = getAsJsonValue(field); if (value == null || value.isNull()) { return null; } ArrayList<String> strings = new ArrayList<String>(value.asArray().size()); for (JsonValue member : value.asArray()){ strings.add(member.asString()); } mInternalCache.put(field, strings); return strings; }