Package com.skava.util
Class CollectionValidatorUtil
java.lang.Object
com.skava.util.CollectionValidatorUtil
- All Implemented Interfaces:
Serializable
The utility class CollectionValidatorUtil consists of helper and validator methods for collection entity.
- Author:
- Infosys Equinox
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkCollectionNameExists
(CollectionRepository collectionRepository, Collection collection, org.springframework.context.MessageSource messageSource, String locale) This method is used to check if a collection already exists for the given name.static void
filterCollectionProperties
(Collection collection, String collectionAllowedProperties) filterCollectionProperties - This method is used to filter the collection properties based on the allowed properties.static void
validateDescription
(Collection request, org.springframework.context.MessageSource messageSource) This method is used to check if the description exceeds a particular length.
-
Constructor Details
-
CollectionValidatorUtil
public CollectionValidatorUtil()
-
-
Method Details
-
validateDescription
public static void validateDescription(Collection request, org.springframework.context.MessageSource messageSource) This method is used to check if the description exceeds a particular length.- Parameters:
request
- HoldsCollection
object for checking description minimum and maximum length.messageSource
- HoldsMessageSource
object for throwing the response message.
-
checkCollectionNameExists
public static void checkCollectionNameExists(CollectionRepository collectionRepository, Collection collection, org.springframework.context.MessageSource messageSource, String locale) This method is used to check if a collection already exists for the given name.- Parameters:
collectionRepository
- HoldsCollectionRepository
object for checking the collection name and businessidcollection
- HoldsCollection
object for checking collection name.messageSource
- HoldsMessageSource
object for response code and message.locale
- Indicate the locale object for response message.
-
filterCollectionProperties
public static void filterCollectionProperties(Collection collection, String collectionAllowedProperties) filterCollectionProperties - This method is used to filter the collection properties based on the allowed properties.- Parameters:
collection
- HoldsCollection
object for filtering the collection properties.collectionAllowedProperties
- Holds the allowed properties for filtering the collection properties.
-