private static String getJsonValue(JsonValue value) { String s = null; if (value != null) { s = getJsonValueAsString(value); if (s == null) { s = getJsonValueAsNumberString(value); } if (s == null) { Boolean b = getJsonValueAsBoolean(value); if (b != null) { s = b ? "true" : "false"; } } } return s; }
private static void setPeerRole(String channelName, PeerOptions peerOptions, JsonObject jsonPeer, PeerRole role) throws NetworkConfigurationException { String propName = roleNameRemap(role); JsonValue val = jsonPeer.get(propName); if (val != null) { Boolean isSet = getJsonValueAsBoolean(val); if (isSet == null) { // This is an invalid boolean value throw new NetworkConfigurationException(format("Error constructing channel %s. Role %s has invalid boolean value: %s", channelName, propName, val.toString())); } if (isSet) { peerOptions.addPeerRole(role); } } }
private static String getJsonValue(JsonValue value) { String s = null; if (value != null) { s = getJsonValueAsString(value); if (s == null) { s = getJsonValueAsNumberString(value); } if (s == null) { Boolean b = getJsonValueAsBoolean(value); if (b != null) { s = b ? "true" : "false"; } } } return s; }
private static String getJsonValue(JsonValue value) { String s = null; if (value != null) { s = getJsonValueAsString(value); if (s == null) { s = getJsonValueAsNumberString(value); } if (s == null) { Boolean b = getJsonValueAsBoolean(value); if (b != null) { s = b ? "true" : "false"; } } } return s; }
private static void setPeerRole(String channelName, PeerOptions peerOptions, JsonObject jsonPeer, PeerRole role) throws NetworkConfigurationException { String propName = role.getPropertyName(); JsonValue val = jsonPeer.get(propName); if (val != null) { Boolean isSet = getJsonValueAsBoolean(val); if (isSet == null) { // This is an invalid boolean value throw new NetworkConfigurationException(format("Error constructing channel %s. Role %s has invalid boolean value: %s", channelName, propName, val.toString())); } if (isSet) { peerOptions.addPeerRole(role); } } }
private static void setPeerRole(String channelName, PeerOptions peerOptions, JsonObject jsonPeer, PeerRole role) throws NetworkConfigurationException { String propName = roleNameRemap(role); JsonValue val = jsonPeer.get(propName); if (val != null) { Boolean isSet = getJsonValueAsBoolean(val); if (isSet == null) { // This is an invalid boolean value throw new NetworkConfigurationException(format("Error constructing channel %s. Role %s has invalid boolean value: %s", channelName, propName, val.toString())); } if (isSet) { peerOptions.addPeerRole(role); } } }