Class ListHelper


@Component public class ListHelper extends ListHelperExtends

ListHelper class

This class extends the methods from the interface ListHelperExtends. These methods provides the default extends for converting to List Collection properties, List, List item domain and List entity models from the entity and data transfer models

  • Constructor Details

    • ListHelper

      @Autowired public ListHelper(ListRepository listRepository, ListWiredServices listWiredServices)
    • ListHelper

      public ListHelper()
      ListHelper This Constructor provides list helper.
  • Method Details

    • validateListItem

      public static void validateListItem(ListItem listItem)
      Validate list items.
      Parameters:
      listItem - Refers to the identifier of the list item. This field is generated automatically.
    • checkIfKeyEmpty

      public static void checkIfKeyEmpty(ListItem listItem)
      This methods Check if key empty other wise throw the exception.
      Parameters:
      listItem - Refers to the identifier of the list item. This field is generated automatically.
    • collectionPropertyToDomain

      public static List<CollectionPropertyDomain> collectionPropertyToDomain(List<CollectionProperty> list)
      This methods Provides Collection property to domain.
      Parameters:
      list - Indicates the unique identifier of the list. This field is generated automatically.
      Returns:
      domains It return list
    • collectionPropertyDomainToRequest

      public static List<CollectionProperty> collectionPropertyDomainToRequest(List<CollectionPropertyDomain> list)
      This methods Provides Collection property domain to request.
      Parameters:
      list - Indicates the unique identifier of the list. This field is generated automatically.
      Returns:
      lists Contains the lists information.
    • listItemDomainToListItemEntityConverter

      public static List<ListItemEntity> listItemDomainToListItemEntityConverter(List<ListItemDomain> listItemDomainList)
      This method converts list item domain into list item entity.
      Parameters:
      listItemDomainList - domain list to be converted
      Returns:
      A list
    • listItemEntityToListItemDomainConverter

      public static List<ListItemDomain> listItemEntityToListItemDomainConverter(List<ListItemEntity> listItemEntityList)
      This method converts list item entity into list item domain.
      Parameters:
      listItemEntityList - entity list to be converted
      Returns:
      A List
    • convertPropertiesToMap

      public static Map<String,String> convertPropertiesToMap(List<CollectionPropertyDomain> collectionPropertyDomains)
      This methods provides Convert properties to map.
      Parameters:
      collectionPropertyDomains - the collection property domains
      Returns:
      the map
    • convertPropertiesToDomain

      public static List<CollectionPropertyDomain> convertPropertiesToDomain(Map<String,String> collectionPropertyDomainMap)
      This methods provides Convert properties to domain.
      Parameters:
      collectionPropertyDomainMap - the collection property domain map
      Returns:
      the list
    • validateItemTypeByType

      public void validateItemTypeByType(List list, Map<String,String> propertiesMap)
      This methods provides validate list item by list type.
      Parameters:
      list - list to be validated
      propertiesMap - contains collection properties for validation
    • validateDuplicateListType

      public void validateDuplicateListType(List list, Map<String,String> propertiesMap)
      This methods provides validate duplicate by list.
      Parameters:
      list - list to be validated
      propertiesMap - contains collection properties for validation
    • validateDuplicateListTypeByCount

      public boolean validateDuplicateListTypeByCount(String type, String userId, Long collectionId, Map<String,String> propertiesMap)
      This methods provides validate duplicate list item by list type
      Parameters:
      type - Refers the list type.
      userId - Refers to the ID of the user for which the list is created.
      collectionId - Refers to the collection ID of the list for which the list is created.
      propertiesMap - contains collection properties for validation
      Returns:
      allowedMultiple
    • encloseQuotes

      public static String encloseQuotes(String value)
      This methods provides enclose quotes value of list.
      Parameters:
      value - enclose quotes value of list.
      Returns:
      Returns the filter quotes, query filter quotes and values.
    • validateListCount

      public void validateListCount(List list, Map<String,String> propertiesMap)
      This method validates the list count exceeds or not
      Parameters:
      list - List List
      propertiesMap - Map properties
    • validateListItemCount

      public void validateListItemCount(Map<String,String> propertiesMap, ListItemRequestInternal listInt)
      This method validates the list count exceeds or not
      Parameters:
      propertiesMap - Map properties
      listInt - ListItemRequestInternal ListItemRequestInternal