Add files via upload
This commit is contained in:
parent
e1241e741f
commit
669dc7804f
|
@ -8,10 +8,8 @@ import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.sun.istack.internal.NotNull;
|
|
||||||
|
|
||||||
public class ObjectToJsonConverter {
|
public class ObjectToJsonConverter {
|
||||||
public String convertToJson(@NotNull Object object) throws JsonSerializationException {
|
public String convertToJson(Object object) throws JsonSerializationException {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
checkIfSerializable(object);
|
checkIfSerializable(object);
|
||||||
|
@ -30,7 +28,7 @@ public class ObjectToJsonConverter {
|
||||||
|
|
||||||
Class<?> clazz = object.getClass();
|
Class<?> clazz = object.getClass();
|
||||||
if (!clazz.isAnnotationPresent(JsonSerializable.class)) {
|
if (!clazz.isAnnotationPresent(JsonSerializable.class)) {
|
||||||
throw new JsonSerializationException("The class" + clazz.getSimpleName() + " is not annotated with JsonSerializable");
|
throw new JsonSerializationException("The class " + clazz.getSimpleName() + " is not annotated with JsonSerializable");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue