Class EntityModelUtils


  • public final class EntityModelUtils
    extends Object
    Author:
    bas.rutten
    • Field Detail

      • ALWAYS_IGNORE

        public static final Set<String> ALWAYS_IGNORE
    • 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 entity
        target - the target entity
        model - the entity model
        ignore - 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 entities
        model - the model
        maxItems - the maximum number of items before the description is truncated
        messageService - 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 entity
        model - the entity model
        Returns: