com.qiniu.convert.JsonObjectPair Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qsuits Show documentation
Show all versions of qsuits Show documentation
qiniu-suits is a efficient tools for qiniu api implemented by java8.
package com.qiniu.convert;
import com.google.gson.JsonObject;
import com.qiniu.interfaces.KeyValuePair;
public class JsonObjectPair implements KeyValuePair {
private JsonObject jsonObject = new JsonObject();
@Override
public void putKey(String key, String value) {
jsonObject.addProperty(key, value);
}
@Override
public void put(String key, String value) {
jsonObject.addProperty(key, value);
}
@Override
public void put(String key, Boolean value) {
jsonObject.addProperty(key, value);
}
@Override
public void put(String key, Integer value) {
jsonObject.addProperty(key, value);
}
@Override
public void put(String key, Long value) {
jsonObject.addProperty(key, value);
}
@Override
public JsonObject getProtoEntity() {
return jsonObject;
}
@Override
public int size() {
return jsonObject.size();
}
}