private void writeAttribute(ProtobufSystemInfo.Attribute attribute, JsonWriter json) { switch (attribute.getValueCase()) { case BOOLEAN_VALUE: json.prop(attribute.getKey(), attribute.getBooleanValue()); break; case LONG_VALUE: json.prop(attribute.getKey(), attribute.getLongValue()); break; case DOUBLE_VALUE: json.prop(attribute.getKey(), attribute.getDoubleValue()); break; case STRING_VALUE: json.prop(attribute.getKey(), attribute.getStringValue()); break; case VALUE_NOT_SET: json.name(attribute.getKey()).beginArray().values(attribute.getStringValuesList()).endArray(); break; default: throw new IllegalArgumentException("Unsupported type: " + attribute.getValueCase()); } }
private void writeAttribute(ProtobufSystemInfo.Attribute attribute, JsonWriter json) { switch (attribute.getValueCase()) { case BOOLEAN_VALUE: json.prop(attribute.getKey(), attribute.getBooleanValue()); break; case LONG_VALUE: json.prop(attribute.getKey(), attribute.getLongValue()); break; case DOUBLE_VALUE: json.prop(attribute.getKey(), attribute.getDoubleValue()); break; case STRING_VALUE: json.prop(attribute.getKey(), attribute.getStringValue()); break; case VALUE_NOT_SET: json.name(attribute.getKey()).beginArray().values(attribute.getStringValuesList()).endArray(); break; default: throw new IllegalArgumentException("Unsupported type: " + attribute.getValueCase()); } }