public class JsonObjectMapper extends Object
@IndexId,
@IndexType,
@JSONCreator,
@JSONProperty
Created by julien on 6/29/16.| Modifier and Type | Field and Description |
|---|---|
static com.fasterxml.jackson.databind.ObjectMapper |
MAPPER |
| Constructor and Description |
|---|
JsonObjectMapper() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Entity> |
getId(T obj)
Get the field value marked with
IndexId from DataShare domain entity object instance |
static <T extends Entity> |
getJson(T obj)
Get JSON representation (as a Map) of an Object instance
|
static <T extends Entity> |
getObject(String id,
Map<String,Object> source,
Class<T> type) |
static <T extends Entity> |
getParent(T obj)
Get the field value marked with
@IndexParent from DataShare domain entity object instance |
static <T extends Entity> |
getRoot(T obj) |
static String |
getType(Class<? extends Entity> cls)
Get value of
IndexType annotation from Class |
static <T extends Entity> |
getType(T obj)
Get the value of
IndexType annotation
from DataShare domain entity Object instance |
public static <T extends Entity> Map<String,Object> getJson(T obj)
T - the concrete type of entityobj - the object to convert to JSONobjpublic static <T extends Entity> T getObject(String id, Map<String,Object> source, Class<T> type)
public static String getType(Class<? extends Entity> cls)
IndexType annotation from Classcls - the class holding index type-annotated fieldpublic static <T extends Entity> String getType(T obj)
IndexType annotation
from DataShare domain entity Object instanceT - the concrete type of entityobj - the object instance from which @IndexType is extractedpublic static <T extends Entity> String getId(T obj)
IndexId from DataShare domain entity object instanceT - the concrete type of entityobj - the object holding the index id-annotated fieldpublic static <T extends Entity> String getParent(T obj)
@IndexParent from DataShare domain entity object instanceT - the concrete type of entityobj - the object holding the index id-annotated fieldCopyright © 2020–2021 ICIJ. All rights reserved.