Package de.fraunhofer.iese.mydata.common
Class MyDataEntity
- java.lang.Object
-
- de.fraunhofer.iese.mydata.common.MyDataEntity
-
- Direct Known Subclasses:
ActionId
,Affiliation
,AffiliationId
,AuthorizationDecision
,BasicManagementServiceComponentInformation
,ClientId
,ComponentId
,DataObject
,DecisionId
,Event
,ExecuteAction
,HistoricEventParameter
,InfoId
,InputParameterDescription
,LibraryClient
,ManagementServiceComponentInformation
,MethodInterfaceDescription
,Modifier
,ModifierEngine
,OauthClientDetails
,OAuthCredentials
,Parameter
,PdpComponentInformation
,PepComponentInformation
,PepInterfaceDescription
,PipComponentInformation
,PipRequest
,Policy
,PolicyId
,PxpComponentInformation
,Solution
,SolutionAccessStatistics
,SolutionId
,SyncNotification
,Timer
,TimerId
,Timezone
,TypeDescription
,User
,ValueChangeEntity
public abstract class MyDataEntity extends Object
Common super class for all other MYDATA classes.- Author:
- Fraunhofer IESE
-
-
Constructor Summary
Constructors Constructor Description MyDataEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends MyDataEntity>
TfromJson(String json, Class<T> clazz)
Deserializes an MyDataEntity from JSON.static com.google.gson.Gson
getGson()
Gets the gson.static com.google.gson.Gson
getGson(boolean pretty)
String
toJson(boolean pretty)
Serializes an MyDataEntity to JSON.String
toString()
static void
validate(MyDataEntity entity, Class<?>... validationGroups)
static void
validateAndNullCheck(MyDataEntity entity, Class<?>... validationGroups)
-
-
-
Method Detail
-
fromJson
public static <T extends MyDataEntity> T fromJson(String json, Class<T> clazz)
Deserializes an MyDataEntity from JSON.- Type Parameters:
T
- the generic type (sub class ofMyDataEntity
)- Parameters:
json
- the serialized object in JSON notationclazz
- the generic type (sub class ofMyDataEntity
)- Returns:
- the deserialized
MyDataEntity
-
getGson
public static com.google.gson.Gson getGson()
Gets the gson.- Returns:
- the gson
-
getGson
public static com.google.gson.Gson getGson(boolean pretty)
- Parameters:
pretty
-- Returns:
- the serialized entity
-
validate
public static void validate(MyDataEntity entity, Class<?>... validationGroups) throws InvalidEntityException
- Parameters:
entity
-validationGroups
-- Throws:
InvalidEntityException
-
validateAndNullCheck
public static void validateAndNullCheck(MyDataEntity entity, Class<?>... validationGroups) throws InvalidEntityException
- Parameters:
entity
-validationGroups
-- Throws:
InvalidEntityException
-
toJson
public String toJson(boolean pretty)
Serializes an MyDataEntity to JSON.- Parameters:
pretty
- if true, pretty printing is enabled- Returns:
- the JSON serialized
MyDataEntity
-
-