
org.jglue.fluentjson.JsonPrimitiveBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fluent-json Show documentation
Show all versions of fluent-json Show documentation
A fluent builder for Google Gson objects
The newest version!
package org.jglue.fluentjson;
import java.io.IOException;
import java.io.Writer;
import com.google.gson.JsonPrimitive;
import com.google.gson.stream.JsonWriter;
public class JsonPrimitiveBuilder implements JsonBuilder {
private JsonPrimitive primitive;
public JsonPrimitiveBuilder(Number n) {
primitive = new JsonPrimitive(n);
}
public JsonPrimitiveBuilder(Character c) {
primitive = new JsonPrimitive(c);
}
public JsonPrimitiveBuilder(Boolean b) {
primitive = new JsonPrimitive(b);
}
public JsonPrimitiveBuilder(String s) {
primitive = new JsonPrimitive(s);
}
JsonPrimitive getPrimitive() {
return primitive;
}
@Override
public void write(Writer out) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public void write(JsonWriter out) throws IOException {
throw new UnsupportedOperationException();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy