Here are the examples of the java api com.alibaba.fastjson.JSON.toJSONString() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3641 Examples
19
Source : ProcessService.java
with Apache License 2.0
from ZTO-Express
with Apache License 2.0
from ZTO-Express
public ProcessStdLog tailProcessStderrLog(Integer processId, int offset, int length) throws IOException {
String programName = getProgramName(processId);
ServiceProcess serviceProcess = serviceProcessMapper.getByProcessId(processId);
String hostIp = zmsHostMapper.getHostIpByInstanceId(serviceProcess.getInstanceId());
Result result = agentApiService.tailProcessStderrLog(hostIp, programName, offset, length);
replacedert.that(result.isStatus(), "查询日志异常:" + result.getMessage());
return JSON.parseObject(JSON.toJSONString(result.getResult()), ProcessStdLog.clreplaced);
}
19
Source : HookStoreService.java
with Apache License 2.0
from zouzhirong
with Apache License 2.0
from zouzhirong
private WebhookLog newWebhookLog(App app, WebhookDetail webhook, WebhookRequestResponse requestResponse) {
WebhookLog bean = new WebhookLog();
bean.setAppId(webhook.getAppId());
bean.setAppName(app.getName());
bean.setWebhookId(webhook.getId());
bean.setName(webhook.getName());
bean.setUrl(webhook.getUrl());
bean.setContentType(webhook.getContentType().getFullType());
bean.setSecret(webhook.getSecret());
bean.setEventType(webhook.getEventType().getType());
bean.setEventName(webhook.getEventType().getTypeName());
bean.setCreateTime(new Date());
bean.setEventParams(JSON.toJSONString(webhook.getEventParams()));
bean.setRequestParams(JSON.toJSONString(webhook.getRequestParams()));
// HTTP请求、响应信息
if (requestResponse.getRequestHeaders() != null) {
bean.setRequestHeaders(JSON.toJSONString(requestResponse.getRequestHeaders()));
} else {
bean.setRequestHeaders("");
}
if (requestResponse.getRequestBody() != null) {
bean.setRequestBody(JSON.toJSONString(requestResponse.getRequestBody()));
} else {
bean.setRequestBody("");
}
bean.setStatusCode(requestResponse.getStatusCode());
if (requestResponse.getResponseHeaders() != null) {
bean.setResponseHeaders(JSON.toJSONString(requestResponse.getResponseHeaders()));
} else {
bean.setResponseHeaders("");
}
if (requestResponse.getResponseBody() != null) {
bean.setResponseBody(JSON.toJSONString(requestResponse.getResponseBody()));
} else {
bean.setResponseBody("");
}
// 错误信息
if (requestResponse.getException() != null) {
String errorMsg = getErrorMsg(requestResponse.getException());
bean.setErrorMsg(errorMsg);
} else {
bean.setErrorMsg("");
}
return bean;
}
19
Source : OkHttpUtil.java
with Apache License 2.0
from zilongTong
with Apache License 2.0
from zilongTong
public static Response postJsonParams(String url, Object jsonParams) {
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), JSON.toJSONString(jsonParams));
Request request = new Request.Builder().url(url).post(requestBody).build();
return client(request);
}
19
Source : SysNoticeService.java
with GNU Affero General Public License v3.0
from zhouhuan751312
with GNU Affero General Public License v3.0
from zhouhuan751312
/**
* 获取一个公告根居开始时间排序
* @return
*/
public SysNoticeEnreplacedy getNotice() {
SysNoticeEnreplacedy sysNotice;
List<SysNoticeEnreplacedy> listNotice = sysConfigRedis.getRedisNotice();
if (ToolUtil.isNotEmpty(listNotice)) {
JSONArray array = JSONArray.parseArray(JSON.toJSONString(listNotice));
listNotice = JSONObject.parseArray(array.toJSONString(), SysNoticeEnreplacedy.clreplaced);
Date temp;
Iterator<SysNoticeEnreplacedy> it = listNotice.iterator();
while (it.hasNext()) {
SysNoticeEnreplacedy notice = it.next();
if (notice.getNoticeLevel().equals("0") || !notice.getStatus().equals("0") || !notice.getNoticeType().equals("1")) {
it.remove();
}
}
if (ToolUtil.isNotEmpty(listNotice)) {
Collections.sort(listNotice, Comparator.comparing(SysNoticeEnreplacedy::getStartTime));
return listNotice.get(0);
}
return new SysNoticeEnreplacedy();
}
return new SysNoticeEnreplacedy();
}
19
Source : RedisUtil.java
with GNU Affero General Public License v3.0
from zhouhuan751312
with GNU Affero General Public License v3.0
from zhouhuan751312
/**
* Object转成JSON数据
*/
private String toJson(Object object) {
if (object instanceof Integer || object instanceof Long || object instanceof Float || object instanceof Double || object instanceof Boolean || object instanceof String) {
return String.valueOf(object);
}
return JSON.toJSONString(object);
}
19
Source : CacheKeyUtil.java
with GNU General Public License v3.0
from zhangyd-c
with GNU General Public License v3.0
from zhangyd-c
/**
* 获取方法参数组成的key
*
* @param params
* 参数数组
*/
public static String getMethodParamsKey(Object... params) {
if (null == params || params.length == 0) {
return "";
}
StringBuilder key = new StringBuilder("(");
for (Object obj : params) {
if (obj.getClreplaced().equals(BindingAwareModelMap.clreplaced)) {
continue;
}
key.append(JSON.toJSONString(obj).replaceAll("\"", "'"));
}
key.append(")");
return key.toString();
}
19
Source : SysGatewayRouteServiceImpl.java
with Apache License 2.0
from zhangdaiscott
with Apache License 2.0
from zhangdaiscott
@Override
public void addRoute2Redis(String key) {
List<SysGatewayRoute> ls = this.list(new LambdaQueryWrapper<SysGatewayRoute>().eq(SysGatewayRoute::getStatus, 1));
redisTemplate.opsForValue().set(key, JSON.toJSONString(ls));
}
19
Source : WordRepository.java
with MIT License
from zgqq
with MIT License
from zgqq
public void save() {
synchronized (fileLock) {
try {
IoUtils.writeToFile(localFile, JSON.toJSONString(words));
} catch (IOException e) {
throw new RepositoryException(e);
}
}
}
19
Source : locapiCellidClientUtil.java
with Apache License 2.0
from zengfr
with Apache License 2.0
from zengfr
public static void test() throws IOException {
Resp resp = parseResp("4163", "21297934", "UTF-8");
System.out.println(JSON.toJSONString(resp));
}
19
Source : BaseWrapper.java
with MIT License
from yunchaoyun
with MIT License
from yunchaoyun
/**
* 转为字符串 输出 如果需要改写 可以覆写此方法
* @return
*/
public String wrap() {
return JSON.toJSONString(this);
}
19
Source : ResultJson.java
with MIT License
from yunchaoyun
with MIT License
from yunchaoyun
/**
* 直接返回错误信息
* @param msg
* @return
*/
public static String getErrorStr(String msg) {
ResultJson j = new ResultJson();
j.setSuccess(false);
j.setMsg(msg);
return JSON.toJSONString(j);
}
19
Source : AjaxJson.java
with MIT License
from yunchaoyun
with MIT License
from yunchaoyun
/**
* 转为json字符串
*
* @return
*/
// public String getJsonStr() {
// JSONObject obj = new JSONObject();
// obj.put("success", this.isSuccess());
// obj.put("msg", this.getMsg());
// obj.put("obj", this.obj);
// obj.put("attributes", this.attributes);
// return obj.toJSONString();
// }
/**
* 直接返回错误信息
* @param msg
* @return
*/
public static String getErrorStr(String msg) {
AjaxJson j = new AjaxJson();
j.setSuccess(false);
j.setMsg(msg);
return JSON.toJSONString(j);
}
19
Source : DataResult.java
with Apache License 2.0
from yuboon
with Apache License 2.0
from yuboon
/**
* 转换JSON字符串
* @return
*/
public String toJsonStr() {
return JSON.toJSONString(results);
}
19
Source : Jsons.java
with Apache License 2.0
from yrain
with Apache License 2.0
from yrain
public static final String toJSONString(Object o) {
if (null == o) {
return null;
}
return JSON.toJSONString(o, ToJSONStringFeatures);
}
19
Source : FastjsonSerializer.java
with Apache License 2.0
from yrain
with Apache License 2.0
from yrain
public String serializeToJSONString(final Object obj) {
if (null == obj) {
return null;
}
return JSON.toJSONString(obj, features);
}
19
Source : AgentMonitor.java
with Apache License 2.0
from yile0906
with Apache License 2.0
from yile0906
public String getNetwork(Monitor.Info info) {
Map<String, Float> newWork = new HashMap<String, Float>();
float read = 0;
float write = 0;
for (Monitor.Net net : info.getNet()) {
read += net.getRead();
write += net.getWrite();
}
newWork.put("read", read);
newWork.put("write", write);
return JSON.toJSONString(newWork);
}
19
Source : JSONUtils.java
with Apache License 2.0
from yihonglei
with Apache License 2.0
from yihonglei
/**
* Bean对象转JSON
*
* @param object
* @return
*/
public static String beanToJson(Object object) {
if (object != null) {
return JSON.toJSONString(object);
} else {
return null;
}
}
19
Source : FastJsonUtil.java
with MIT License
from yidao620c
with MIT License
from yidao620c
public static String bean2Json(Object obj) {
return JSON.toJSONString(obj);
}
19
Source : BaseModel.java
with Apache License 2.0
from yi-jun
with Apache License 2.0
from yi-jun
public String toJson() {
return JSON.toJSONString(this);
}
19
Source : JsonUtils.java
with Apache License 2.0
from YeDaxia
with Apache License 2.0
from YeDaxia
/**
* 把对象转化成Json字符串
*
* @param object
* @return
*/
public static String toJsonString(Object object) {
return JSON.toJSONString(object);
}
19
Source : JbootSentinelBuilder.java
with Apache License 2.0
from yangfuhai
with Apache License 2.0
from yangfuhai
private <T> String encodeJson(T t) {
return JSON.toJSONString(t);
}
19
Source : JsonUtil.java
with MIT License
from YangDongChuan1995
with MIT License
from YangDongChuan1995
public static <T> String beanToString(T value) {
if (value == null) {
return null;
}
Clreplaced<?> clazz = value.getClreplaced();
if (clazz == int.clreplaced || clazz == Integer.clreplaced) {
return "" + value;
} else if (clazz == String.clreplaced) {
return (String) value;
} else if (clazz == long.clreplaced || clazz == Long.clreplaced) {
return "" + value;
} else {
return JSON.toJSONString(value);
}
}
19
Source : RemotingSerializable.java
with GNU General Public License v3.0
from y123456yz
with GNU General Public License v3.0
from y123456yz
public static String toJson(final Object obj, boolean prettyFormat) {
return JSON.toJSONString(obj, prettyFormat);
}
19
Source : MyTools.java
with Apache License 2.0
from xuwujing
with Apache License 2.0
from xuwujing
/**
* Object 转换为 String
*
* @param list
* @return String
*/
public static String toString(Object obj) {
return JSON.toJSONString(obj);
}
19
Source : Proposal.java
with Apache License 2.0
from xuperchain
with Apache License 2.0
from xuperchain
private String pb2JsonString(XchainOuterClreplaced.PreExecWithSelectUTXORequest request) {
LinkedHashMap<String, Object> m = new LinkedHashMap<>();
if (!request.getBcname().isEmpty()) {
m.put("bcname", request.getBcname());
}
if (!request.getAddress().isEmpty()) {
m.put("address", request.getAddress());
}
m.put("totalAmount", request.getTotalAmount());
LinkedHashMap<String, Object> m1 = new LinkedHashMap<>();
if (!request.getBcname().isEmpty()) {
m1.put("bcname", request.getBcname());
}
m1.put("initiator", request.getRequest().getInitiator());
m1.put("auth_require", request.getRequest().getAuthRequireList());
ArrayList<Object> l = new ArrayList<>();
for (XchainOuterClreplaced.InvokeRequest r : request.getRequest().getRequestsList()) {
LinkedHashMap<String, Object> m2 = new LinkedHashMap<>();
if (!r.getModuleName().isEmpty()) {
m2.put("module_name", r.getModuleName());
}
if (!r.getContractName().isEmpty()) {
m2.put("contract_name", r.getContractName());
}
if (!r.getMethodName().isEmpty()) {
m2.put("method_name", r.getMethodName());
}
if (r.getArgsMap().size() > 0) {
LinkedHashMap<String, Object> m3 = new LinkedHashMap<>();
for (Map.Entry<String, ByteString> entry : r.getArgsMap().entrySet()) {
m3.put(entry.getKey(), entry.getValue().toByteArray());
}
m2.put("args", m3);
}
if (!r.getAmount().isEmpty()) {
m2.put("amount", r.getAmount());
}
l.add(m2);
}
if (l.size() > 0) {
m1.put("requests", l);
}
m.put("request", m1);
return JSON.toJSONString(m);
}
19
Source : CorePageManager.java
with Apache License 2.0
from xuexiangjys
with Apache License 2.0
from xuexiangjys
/**
* 从hashMap中得到参数的json格式
*
* @param params 页面map形式参数
* @return json格式参数
*/
private String buildParams(Map<String, String> params) {
if (params == null) {
return "";
}
String result = JSON.toJSONString(params);
PageLog.d("params:" + result);
return result;
}
19
Source : StatisticsSevlet.java
with Apache License 2.0
from xuerong
with Apache License 2.0
from xuerong
public String mapToString(Map map) {
return JSON.toJSONString(map);
}
19
Source : FastJsonConvert.java
with GNU General Public License v3.0
from xubinux
with GNU General Public License v3.0
from xubinux
/**
* <B>方法名称:</B><BR>
* <B>概要说明:</B><BR>
* @param obj
* @return
*/
public static String convertObjectToJSONWithNullValue(Object obj) {
try {
String text = JSON.toJSONString(obj, featuresWithNullValue);
return text;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
19
Source : FastJsonConvert.java
with GNU General Public License v3.0
from xubinux
with GNU General Public License v3.0
from xubinux
/**
* <B>方法名称:</B>将对象转为JSON字符串<BR>
* <B>概要说明:</B>将对象转为JSON字符串<BR>
* @param obj 任意对象
* @return JSON字符串
*/
public static String convertObjectToJSON(Object obj) {
try {
String text = JSON.toJSONString(obj);
return text;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
19
Source : FastJsonConvert.java
with GNU General Public License v3.0
from xubinux
with GNU General Public License v3.0
from xubinux
/**
* <B>方法名称:</B>将对象转为(JSON字符串)<BR>
* <B>概要说明:</B>将对象转为(JSON字符串)<BR>
* @param obj 任意对象
* @return JSON字符串
*/
public static String convertObjectToJSONBracket(Object obj) {
try {
String text = JSON.toJSONString(obj);
return "(" + text + ")";
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
19
Source : WxPayApiServiceImpl.java
with GNU General Public License v3.0
from xiaomujiayou
with GNU General Public License v3.0
from xiaomujiayou
@GlobalTransactional(rollbackFor = Exception.clreplaced)
@Override
public void payment(EntPayMessage entPayMessage) throws WxPayException {
SpWxEntPayOrderInEnreplacedy record = new SpWxEntPayOrderInEnreplacedy();
record.setType(1);
record.setBillPayId(entPayMessage.getScBillPayEnreplacedy().getId());
if (spWxEntPayOrderInMapper.selectCount(record) > 0)
return;
EntPayRequest request = createEntPayRequest(wxPayPropertiesEx.getAppId(), wxPayPropertiesEx.getMchId(), StrUtil.isBlank(entPayMessage.getRetryTradeNo()) ? GenNumUtil.genWxEntPayOrderNum() : entPayMessage.getRetryTradeNo(), entPayMessage.getScBillPayEnreplacedy().getOpenId(), entPayMessage.getDesc(), entPayMessage.getIp(), entPayMessage.getScBillPayEnreplacedy().getTotalMoney());
EntPayResult result = null;
SpWxEntPayOrderInEnreplacedy spWxEntPayOrderInEnreplacedy = null;
try {
if (CollUtil.newArrayList(active.split(",")).contains("dev")) {
result = new EntPayResult();
}
if (CollUtil.newArrayList(active.split(",")).contains("prod")) {
result = wxService.getEntPayService().entPay(request);
}
spWxEntPayOrderInEnreplacedy = entPay(1, entPayMessage, null, null, request, result, null);
} catch (WxPayException e) {
spWxEntPayOrderInEnreplacedy = entPay(1, entPayMessage, null, null, request, null, e);
log.error("微信企业付款失败 信息:{} error:{}", JSON.toJSONString(spWxEntPayOrderInEnreplacedy), e);
} finally {
rabbitTemplate.convertAndSend(PayMqConfig.EXCHANGE_ENT, "", spWxEntPayOrderInEnreplacedy);
}
}
19
Source : WxPayApiServiceImpl.java
with GNU General Public License v3.0
from xiaomujiayou
with GNU General Public License v3.0
from xiaomujiayou
@GlobalTransactional(rollbackFor = Exception.clreplaced)
@Override
public void paymentActive(ActiveEntPayMessage activeEntPayMessage) {
SpWxEntPayOrderInEnreplacedy record = new SpWxEntPayOrderInEnreplacedy();
record.setType(2);
record.setBillPayId(activeEntPayMessage.getSaCashOutRecordEnreplacedy().getId());
if (spWxEntPayOrderInMapper.selectCount(record) > 0)
return;
EntPayRequest request = createEntPayRequest(wxPayPropertiesEx.getAppId(), wxPayPropertiesEx.getMchId(), StrUtil.isBlank(activeEntPayMessage.getRetryTradeNo()) ? GenNumUtil.genWxEntPayOrderNum() : activeEntPayMessage.getRetryTradeNo(), activeEntPayMessage.getSaCashOutRecordEnreplacedy().getOpenId(), activeEntPayMessage.getDesc(), activeEntPayMessage.getIp(), activeEntPayMessage.getSaCashOutRecordEnreplacedy().getMoney());
EntPayResult result = null;
SpWxEntPayOrderInEnreplacedy spWxEntPayOrderInEnreplacedy = null;
try {
if (CollUtil.newArrayList(active.split(",")).contains("dev")) {
result = new EntPayResult();
}
if (CollUtil.newArrayList(active.split(",")).contains("prod")) {
result = wxService.getEntPayService().entPay(request);
}
spWxEntPayOrderInEnreplacedy = entPay(2, null, activeEntPayMessage, null, request, result, null);
} catch (WxPayException e) {
spWxEntPayOrderInEnreplacedy = entPay(2, null, activeEntPayMessage, null, request, null, e);
log.error("微信企业付款失败 信息:{} error:{}", JSON.toJSONString(spWxEntPayOrderInEnreplacedy), e);
} finally {
rabbitTemplate.convertAndSend(PayMqConfig.EXCHANGE_ENT, "", spWxEntPayOrderInEnreplacedy);
}
}
19
Source : PddSdkComponent.java
with GNU General Public License v3.0
from xiaomujiayou
with GNU General Public License v3.0
from xiaomujiayou
public Boolean isRecord(String pid, Integer userId) throws Exception {
Map<String, Object> params = new HashMap<>();
params.put("uid", userId);
return isRecord(pid, JSON.toJSONString(params));
}
19
Source : HttpTools.java
with MIT License
from xiaodaojava
with MIT License
from xiaodaojava
public static <T> HttpResponse<T> doPost(String url, Map<String, String> bodyMap, Map<String, String> headerMap, Clreplaced<T> responseType) {
return doPost(url, JSON.toJSONString(bodyMap), headerMap, responseType);
}
19
Source : StoredRabbitTemplate.java
with Apache License 2.0
from Xiao-Y
with Apache License 2.0
from Xiao-Y
/**
* RabbitMQ的return回调<br/>
* <p>
* 发送至Exchange却没有发送到Queue时,也会走一遍 confirm 方法<br/>
* <p>
* 如果消息真的不可达,那么就要根据你实际的业务去做对应处理,比如是直接落库,记录补偿,还是放到死信队列里面,之后再进行落库
*
* @param message message
* @param replyCode code
* @param replyText error
* @param exchange exchange
* @param routingKey routingKey
*/
@Override
public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
LOGGER.error("{} 发送RabbitMQ消息returnedMessage,出现异常,Exchange不存在或发送至Exchange却没有发送到Queue中,message:[{}], replyCode[{}], replyText[{}], exchange[{}], routingKey[{}]", rabbitTemplateName, JSON.toJSONString(message), JSON.toJSONString(replyCode), JSON.toJSONString(replyText), JSON.toJSONString(exchange), JSON.toJSONString(routingKey));
}
19
Source : RolePermissionRedisKit.java
with Apache License 2.0
from Xiao-Y
with Apache License 2.0
from Xiao-Y
/**
* 设置角色的权限信息
*
* @param permissionPos 权限信息
* @param roleCode 角色code
* @author liuyongtao
* @since 2021-1-30 8:26
*/
public void setRolePermission(List<PermissionPo> permissionPos, String roleCode) {
redisUtils.setHash(ROLE_PERMISSION_KEY, roleCode, JSON.toJSONString(permissionPos));
}
19
Source : JsonUtils.java
with Apache License 2.0
from xiancloud
with Apache License 2.0
from xiancloud
public static String convertMapToJSON(Map<String, String> list) {
return JSON.toJSONString(list);
}
19
Source : EnvUtil.java
with Apache License 2.0
from xiancloud
with Apache License 2.0
from xiancloud
public static String getJreDetail() {
StringBuilder sb = new StringBuilder();
sb.append("SystemProperties = \r\n").append(JSON.toJSONString(System.getProperties(), true)).append("\r\n\r\n").append("SystemEnv = \r\n").append(JSON.toJSONString(System.getenv(), true)).append("\r\n");
return sb.toString();
}
19
Source : AccessToken.java
with Apache License 2.0
from xiancloud
with Apache License 2.0
from xiancloud
private static String convertMapToJSON(Map<String, String> list) {
return JSON.toJSONString(list);
}
19
Source : JsonX.java
with Apache License 2.0
from x-ream
with Apache License 2.0
from x-ream
public static String toJson(Object obj) {
if (obj == null)
return null;
if (obj instanceof String)
return obj.toString();
return JSON.toJSONString(obj);
}
19
Source : JsonX.java
with Apache License 2.0
from x-ream
with Apache License 2.0
from x-ream
public static String toJson(Map map) {
if (map == null)
return null;
if (map.isEmpty()) {
return "{}";
}
return JSON.toJSONString(map);
}
19
Source : JsonX.java
with Apache License 2.0
from x-ream
with Apache License 2.0
from x-ream
public static String toJson(List list) {
if (list == null)
return null;
if (list.isEmpty()) {
return "[]";
}
return JSON.toJSONString(list);
}
19
Source : ObjectMap.java
with MIT License
from wolforest
with MIT License
from wolforest
public String toJson() {
return JSON.toJSONString(getInnerMap());
}
19
Source : OnionPayCreator.java
with MIT License
from wolforest
with MIT License
from wolforest
private void storeCreateRequest() {
createRequest.setCurrencyCode("INR");
String json = JSON.toJSONString(createRequest);
String key;
Boolean status;
for (int i = 0; i < 3; i++) {
key = StringUtil.uuid();
status = stringRedisTemplate.opsForValue().setIfAbsent(key, json, Duration.ofMinutes(15));
if (status.equals(true)) {
break;
}
}
throw new PaymentCreateFailException("create payment token fail");
}
19
Source : CameraJsonCollection.java
with MIT License
from wladimir-computin
with MIT License
from wladimir-computin
public X8BaseCamJsonData setPhotoFormat(String param) {
String sendString = JSON.toJSONString(createBaseCmd(2, param, "photo_format"));
X8BaseCamJsonData baseCamJsonData = new X8BaseCamJsonData();
baseCamJsonData.setAddToSendQueue(false);
baseCamJsonData.setOutTime(1000);
baseCamJsonData.setMsgId(2);
baseCamJsonData.setCamKey("photo_format");
baseCamJsonData.setPayLoad(sendString.getBytes());
baseCamJsonData.packCmd();
return baseCamJsonData;
}
19
Source : CameraJsonCollection.java
with MIT License
from wladimir-computin
with MIT License
from wladimir-computin
public X8BaseCamJsonData setCamera(String param) {
String sendString = JSON.toJSONString(createBaseCmd(2, param, "system_type"));
X8BaseCamJsonData baseCamJsonData = new X8BaseCamJsonData();
baseCamJsonData.setAddToSendQueue(false);
baseCamJsonData.setOutTime(1000);
baseCamJsonData.setMsgId(2);
baseCamJsonData.setPayLoad(sendString.getBytes());
baseCamJsonData.setCamKey("system_type");
baseCamJsonData.packCmd();
return baseCamJsonData;
}
19
Source : CameraJsonCollection.java
with MIT License
from wladimir-computin
with MIT License
from wladimir-computin
public X8BaseCamJsonData setCameraIso(String param) {
String sendString = JSON.toJSONString(createBaseCmd(2, param, KEY_AE_ISO));
X8BaseCamJsonData baseCamJsonData = new X8BaseCamJsonData();
baseCamJsonData.setAddToSendQueue(false);
baseCamJsonData.setOutTime(1000);
baseCamJsonData.setMsgId(2);
baseCamJsonData.setCamKey(KEY_AE_ISO);
baseCamJsonData.setPayLoad(sendString.getBytes());
baseCamJsonData.packCmd();
return baseCamJsonData;
}
19
Source : CameraJsonCollection.java
with MIT License
from wladimir-computin
with MIT License
from wladimir-computin
public X8BaseCamJsonData setPhotoSize(String param) {
String sendString = JSON.toJSONString(createBaseCmd(2, param, "photo_size"));
X8BaseCamJsonData baseCamJsonData = new X8BaseCamJsonData();
baseCamJsonData.setAddToSendQueue(false);
baseCamJsonData.setOutTime(1000);
baseCamJsonData.setMsgId(2);
baseCamJsonData.setCamKey("photo_size");
baseCamJsonData.setPayLoad(sendString.getBytes());
baseCamJsonData.packCmd();
return baseCamJsonData;
}
19
Source : CameraJsonCollection.java
with MIT License
from wladimir-computin
with MIT License
from wladimir-computin
public X8BaseCamJsonData getCameraAWB() {
String sendString = JSON.toJSONString(createBaseCmd(1, null, "awb"));
X8BaseCamJsonData baseCamJsonData = new X8BaseCamJsonData();
baseCamJsonData.setAddToSendQueue(false);
baseCamJsonData.setOutTime(1000);
baseCamJsonData.setMsgId(1);
baseCamJsonData.setCamKey("awb");
baseCamJsonData.setPayLoad(sendString.getBytes());
baseCamJsonData.packCmd();
return baseCamJsonData;
}
19
Source : CameraJsonCollection.java
with MIT License
from wladimir-computin
with MIT License
from wladimir-computin
public X8BaseCamJsonData setVideoResolution(String param) {
String sendString = JSON.toJSONString(createBaseCmd(2, param, "video_resolution"));
X8BaseCamJsonData baseCamJsonData = new X8BaseCamJsonData();
baseCamJsonData.setAddToSendQueue(false);
baseCamJsonData.setOutTime(1000);
baseCamJsonData.setMsgId(2);
baseCamJsonData.setCamKey("video_resolution");
baseCamJsonData.setPayLoad(sendString.getBytes());
baseCamJsonData.packCmd();
return baseCamJsonData;
}
See More Examples