Java Json jsonString(JsonValue value)

Here you can find the source of jsonString(JsonValue value)

Description

json String

License

Open Source License

Declaration

public static String jsonString(JsonValue value) 

Method Source Code

//package com.java2s;

import javax.json.JsonString;
import javax.json.JsonValue;

public class Main {
    public static String jsonString(JsonValue value) {
        if (value == null || value.getValueType() == JsonValue.ValueType.NULL)
            return "";
        if (value.getValueType() == JsonValue.ValueType.STRING && (value instanceof JsonString))
            return ((JsonString) value).getString();
        return "";
    }//from w w  w.ja  va  2 s .  c o  m
}

Related

  1. hasKey(JsonObject object, String name)
  2. jsonEquals(JsonArray expected, JsonArray actual, boolean strict)
  3. jsonObject(String key, JsonValue val)
  4. jsonObjectToBuilder(JsonObject jo)
  5. jsonPrettyPrinter(Object object)
  6. jsonValueToJsonString(final JsonValue jsonValue, final String key)
  7. listToJsonArray(List list)
  8. mapToJsonObjectBuilder(Map map)
  9. newObject()