Example usage for com.google.gson JsonPrimitive JsonPrimitive

List of usage examples for com.google.gson JsonPrimitive JsonPrimitive

Introduction

In this page you can find the example usage for com.google.gson JsonPrimitive JsonPrimitive.

Prototype

public JsonPrimitive(Character c) 

Source Link

Document

Create a primitive containing a character.

Usage

From source file:at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.json.JsonCharacterTypeAdapter.java

License:Apache License

@Override
public JsonElement serialize(Character object, TypeMetadata<JsonElement> typeMetadata) {
    return new JsonPrimitive(object);
}

From source file:at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.json.JsonDoubleTypeAdapter.java

License:Apache License

@Override
public JsonElement serialize(Double object, TypeMetadata<JsonElement> typeMetadata) {
    return new JsonPrimitive(object);
}

From source file:at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.json.JsonEnumTypeAdapter.java

License:Apache License

@Override
public JsonElement serialize(Enum object, TypeMetadata<JsonElement> typeMetadata) {
    return new JsonPrimitive(object.name());
}

From source file:at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.json.JsonFloatTypeAdapter.java

License:Apache License

@Override
public JsonElement serialize(Float object, TypeMetadata<JsonElement> typeMetadata) {
    return new JsonPrimitive(object);
}

From source file:at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.json.JsonIntegerTypeAdapter.java

License:Apache License

@Override
public JsonElement serialize(Integer object, TypeMetadata<JsonElement> typeMetadata) {
    return new JsonPrimitive(object);
}

From source file:at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.json.JsonLongTypeAdapter.java

License:Apache License

@Override
public JsonElement serialize(Long object, TypeMetadata<JsonElement> typeMetadata) {
    return new JsonPrimitive(object);
}

From source file:at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.json.JsonShortTypeAdapter.java

License:Apache License

@Override
public JsonElement serialize(Short object, TypeMetadata<JsonElement> typeMetadata) {
    return new JsonPrimitive(object);
}

From source file:at.ac.tuwien.infosys.jcloudscale.datastore.mapping.type.json.JsonStringTypeAdapter.java

License:Apache License

@Override
public JsonElement serialize(String object, TypeMetadata<JsonElement> typeMetadata) {
    return new JsonPrimitive(object);
}

From source file:at.yawk.buycraft.BuycraftApi.java

License:Mozilla Public License

/**
 * @see #commands(String, String, String)
 *///from  w  ww.  j  a va 2s  . com
default List<Command> commands(Collection<String> players, boolean offlineCommands, int offlineCommandLimit)
        throws IOException {
    JsonArray array = new JsonArray();
    players.forEach(p -> array.add(new JsonPrimitive(p)));
    return commands(array.toString(), Boolean.toString(offlineCommands), Integer.toString(offlineCommandLimit));
}

From source file:at.yawk.buycraft.BuycraftApi.java

License:Mozilla Public License

/**
 * @see #removeCommands(String)// w w  w  .  j av  a 2 s.  co m
 */
default void removeCommands(Collection<Integer> commandIds) throws IOException {
    JsonArray array = new JsonArray();
    commandIds.forEach(i -> array.add(new JsonPrimitive(i)));
    removeCommands(array.toString());
}