import com.alibaba.fastjson2.JSONObject;
import com.google.protobuf.util.JsonFormat;
public class helloworld {
public static void main(String[] args) throws InvalidProtocolBufferException {
System.out.println(LocalDateTime.now());
System.out.println(10 != 20);
System.out.println("sss".equals("2"));
Integer hhh = 2;
System.out.println(! hhh.equals(222));
System.out.println(1 / 3);
System.out.println(1 / 3.0);
System.out.println("=======");
ObjectUtils.Null hh = null;
System.out.println("====hh===" + hh);
if (hh == null) {
System.out.println("==hh.equals=null====");
}
// string -> pb
String fullDocumentString = "real_data";
JSONObject fullJson = JSONObject.parseObject(fullDocumentString);
ProtoMeta.Builder aa = ProtoMeta.newBuilder();
JsonFormat.parser().ignoringUnknownFields().merge(fullJson, aa)
// pb -> string
ProtoMeta.Builder hh = ProtoMeta.newBuilder();
String msgJson = JsonFormat.printer()
.printingEnumsAsInts()
.print(hh);
// replace 后要重新赋值;加上转义是为了执行的时候不报错
String sql = "select `#xray_id` hh `#xray_id`";
System.out.println(sql);
sql = sql.replace("`", "\\`");
sql = sql.replace("xray_id", "\\`xray_id222");
System.out.println(sql);
}
}
版权声明:本文为Faker_Second原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。