Merge pull request #282 from sun7059/patch-1

Update JsonUtils.java
This commit is contained in:
agapple
2017-03-17 19:11:25 +08:00
committed by GitHub

View File

@@ -94,5 +94,17 @@ public class JsonUtils {
// 优先使用name // 优先使用name
serializer.write(address.getHostName()); serializer.write(address.getHostName());
} }
public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features)
throws IOException {
if (object == null) {
serializer.writeNull();
return;
}
InetAddress address = (InetAddress) object;
// 优先使用name
serializer.write(address.getHostName());
}
} }
} }