Package io.keyko.nevermined.models
Class AbstractModel
- java.lang.Object
-
- io.keyko.nevermined.models.AbstractModel
-
- Direct Known Subclasses:
AccessTemplate,Agreement,AgreementStatus,AssetMetadata,ComputeLogs,ComputeStatus,Condition,DDO,EncryptionRequest,EncryptionResponse,ExecuteService,FaucetRequest,FaucetResponse,GatewayService.ServiceExecutionResult,InitializeAccessSLA,OrderResult,PodStatus,SearchQuery,SearchResult,Service,ServiceAdditionalInformation,ServiceMain,Status
public abstract class AbstractModel extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static DateFormatDATE_FORMATstatic StringDATE_PATTERNprotected static org.apache.logging.log4j.Loggerloggerprivate static com.fasterxml.jackson.databind.ObjectMapperobjectMapper
-
Constructor Summary
Constructors Constructor Description AbstractModel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringchecksum()static <T> ObjectconvertToModel(Class<T> clazz, String json)static <T> TfromJSON(com.fasterxml.jackson.core.type.TypeReference<T> type, String json)static DategetDateNowFormatted()static com.fasterxml.jackson.databind.ObjectMappergetMapperInstance()private static StringgetNowFormatted()private static <T> com.fasterxml.jackson.databind.ObjectReadergetReaderInstance(Class<T> clazz)StringtoJson()StringtoJson(Object object)
-
-
-
Field Detail
-
logger
protected static final org.apache.logging.log4j.Logger logger
-
objectMapper
private static com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
DATE_PATTERN
public static final String DATE_PATTERN
- See Also:
- Constant Field Values
-
DATE_FORMAT
public static final DateFormat DATE_FORMAT
-
-
Method Detail
-
getMapperInstance
public static com.fasterxml.jackson.databind.ObjectMapper getMapperInstance()
-
getReaderInstance
private static <T> com.fasterxml.jackson.databind.ObjectReader getReaderInstance(Class<T> clazz)
-
convertToModel
public static <T> Object convertToModel(Class<T> clazz, String json) throws IOException
- Throws:
IOException
-
fromJSON
public static <T> T fromJSON(com.fasterxml.jackson.core.type.TypeReference<T> type, String json) throws IOException- Throws:
IOException
-
checksum
public String checksum() throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
toJson
public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
toJson
public String toJson(Object object) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getNowFormatted
private static String getNowFormatted()
-
getDateNowFormatted
public static Date getDateNowFormatted()
-
-