Package com.ocs.dynamo.utils
Class EntityModelUtils
- java.lang.Object
-
- com.ocs.dynamo.utils.EntityModelUtils
-
public final class EntityModelUtils extends Object
- Author:
- bas.rutten
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>ALWAYS_IGNORE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> voidcopySimpleAttributes(T source, T target, EntityModel<T> model, String... ignore)Copies all simple attribute values from one entity to the otherstatic <T> StringgetDisplayPropertyValue(Collection<T> entities, EntityModel<T> model, int maxItems, MessageService messageService, Locale locale)Returns a comma separated String containing the display properties of the specified entitiesstatic <T> StringgetDisplayPropertyValue(T entity, EntityModel<?> model)Returns the value of the display property of an entity
-
-
-
Method Detail
-
copySimpleAttributes
public static <T> void copySimpleAttributes(T source, T target, EntityModel<T> model, String... ignore)Copies all simple attribute values from one entity to the other- Parameters:
source- the source entitytarget- the target entitymodel- the entity modelignore- the name of the properties to ignore
-
getDisplayPropertyValue
public static <T> String getDisplayPropertyValue(Collection<T> entities, EntityModel<T> model, int maxItems, MessageService messageService, Locale locale)
Returns a comma separated String containing the display properties of the specified entities- Parameters:
entities- the entitiesmodel- the modelmaxItems- the maximum number of items before the description is truncatedmessageService- message service- Returns:
-
getDisplayPropertyValue
public static <T> String getDisplayPropertyValue(T entity, EntityModel<?> model)
Returns the value of the display property of an entity- Parameters:
entity- the entitymodel- the entity model- Returns:
-
-