Package com.skava.list.helper
Class ListHelper
java.lang.Object
com.skava.list.helper.ListHelperExtends
com.skava.list.helper.ListHelper
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 Summary
ConstructorsConstructorDescriptionListHelper This Constructor provides list helper.ListHelper
(ListRepository listRepository, ListWiredServices listWiredServices) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkIfKeyEmpty
(ListItem listItem) This methods Check if key empty other wise throw the exception.static List<CollectionProperty>
This methods Provides Collection property domain to request.static List<CollectionPropertyDomain>
This methods Provides Collection property to domain.static List<CollectionPropertyDomain>
convertPropertiesToDomain
(Map<String, String> collectionPropertyDomainMap) This methods provides Convert properties to domain.convertPropertiesToMap
(List<CollectionPropertyDomain> collectionPropertyDomains) This methods provides Convert properties to map.static String
encloseQuotes
(String value) This methods provides enclose quotes value of list.static List<ListItemEntity>
listItemDomainToListItemEntityConverter
(List<ListItemDomain> listItemDomainList) This method converts list item domain into list item entity.static List<ListItemDomain>
listItemEntityToListItemDomainConverter
(List<ListItemEntity> listItemEntityList) This method converts list item entity into list item domain.void
validateDuplicateListType
(List list, Map<String, String> propertiesMap) This methods provides validate duplicate by list.boolean
validateDuplicateListTypeByCount
(String type, String userId, Long collectionId, Map<String, String> propertiesMap) This methods provides validate duplicate list item by list typevoid
validateItemTypeByType
(List list, Map<String, String> propertiesMap) This methods provides validate list item by list type.void
validateListCount
(List list, Map<String, String> propertiesMap) This method validates the list count exceeds or notstatic void
validateListItem
(ListItem listItem) Validate list items.void
validateListItemCount
(Map<String, String> propertiesMap, ListItemRequestInternal listInt) This method validates the list count exceeds or notMethods inherited from class com.skava.list.helper.ListHelperExtends
getCollectionProperty, getValidatorsFromCollectionProperty, validateFilterField, validateSortField
-
Constructor Details
-
ListHelper
-
ListHelper
public ListHelper()ListHelper This Constructor provides list helper.
-
-
Method Details
-
validateListItem
Validate list items.- Parameters:
listItem
- Refers to the identifier of the list item. This field is generated automatically.
-
checkIfKeyEmpty
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
This methods provides validate list item by list type.- Parameters:
list
- list to be validatedpropertiesMap
- contains collection properties for validation
-
validateDuplicateListType
This methods provides validate duplicate by list.- Parameters:
list
- list to be validatedpropertiesMap
- 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
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
This method validates the list count exceeds or not -
validateListItemCount
public void validateListItemCount(Map<String, String> propertiesMap, ListItemRequestInternal listInt) This method validates the list count exceeds or not- Parameters:
propertiesMap
-Map
propertieslistInt
-ListItemRequestInternal
ListItemRequestInternal
-