Package tech.muyan.utils
Class DomainHelper
- java.lang.Object
-
- tech.muyan.utils.DomainHelper
-
public class DomainHelper extends java.lang.Object
Helper class for domain operations.
-
-
Constructor Summary
Constructors Constructor Description DomainHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.List<T>
batchCreate(java.lang.Class<T> domainClazz, java.util.List<T> domainObjects)
Batch create domain objects of the specified class.static <T> java.util.List<T>
batchCreate(java.lang.String domainName, java.util.List<T> domainObjects)
Batch create domain objects of the specified domain name.static java.lang.Object
buildDomain(java.lang.String domainName)
Build a domain object with the given domainName.static java.lang.Object
buildDomain(java.lang.String domainName, java.lang.Object properties)
Build a domain object with the given domainName and properties.static void
createDomain(java.lang.Object requestData)
Create a domain object with the given requestData.static void
deleteDomain(java.lang.Object requestData)
Delete a domain object with the given requestData.static java.util.Map<java.lang.String,java.lang.Object>
render(java.lang.Object domainObj, DomainObjectRenderType renderType)
Render the domain object with the given renderType.static void
updateDomain(java.lang.Object requestData)
Update a domain object with the given requestData.
-
-
-
Method Detail
-
buildDomain
public static java.lang.Object buildDomain(java.lang.String domainName)
Build a domain object with the given domainName.- Parameters:
domainName
- the name of the domain to build- Returns:
- the domain object
-
buildDomain
public static java.lang.Object buildDomain(java.lang.String domainName, java.lang.Object properties)
Build a domain object with the given domainName and properties.- Parameters:
domainName
- the name of the domain to buildproperties
- the properties to set on the domain object- Returns:
- the domain object
-
createDomain
public static void createDomain(java.lang.Object requestData)
Create a domain object with the given requestData.- Parameters:
requestData
- the data to create the domain object with
-
updateDomain
public static void updateDomain(java.lang.Object requestData)
Update a domain object with the given requestData.- Parameters:
requestData
- the data to update the domain object with
-
deleteDomain
public static void deleteDomain(java.lang.Object requestData)
Delete a domain object with the given requestData.- Parameters:
requestData
- the data to delete the domain object with
-
render
public static java.util.Map<java.lang.String,java.lang.Object> render(java.lang.Object domainObj, DomainObjectRenderType renderType)
Render the domain object with the given renderType.- Parameters:
domainObj
- the domain object to renderrenderType
- the render type to render the domain object with- Returns:
- the rendered domain object
- See Also:
DomainObjectRenderType
-
batchCreate
public static <T> java.util.List<T> batchCreate(java.lang.Class<T> domainClazz, java.util.List<T> domainObjects)
Batch create domain objects of the specified class.- Type Parameters:
T
- the type of domain objects- Parameters:
domainClazz
- the class of domain objects to createdomainObjects
- the list of domain objects to create- Returns:
- the list of created domain objects
-
batchCreate
public static <T> java.util.List<T> batchCreate(java.lang.String domainName, java.util.List<T> domainObjects)
Batch create domain objects of the specified domain name.- Type Parameters:
T
- the type of domain objects- Parameters:
domainName
- the name of the domain to create objects fordomainObjects
- the list of domain objects to create- Returns:
- the list of created domain objects
-
-