Class ValidationHelper
java.lang.Object
dev.getelements.elements.sdk.model.util.ValidationHelper
Created by patricktwohig on 5/7/15.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
validateModel
(T model) Validates the given model object.<T> T
validateModel
(T model, Class<?> first, Class<?>... remaining) Validates the given model object.
-
Constructor Details
-
ValidationHelper
public ValidationHelper()
-
-
Method Details
-
validateModel
Validates the given model object. If the model fails validation, then an instance of ValidationFailureException is thrown.- Parameters:
model
- the model- Throws:
ValidationFailureException
- if validation fails.
-
validateModel
public <T> T validateModel(T model, Class<?> first, Class<?>... remaining) throws ValidationFailureException Validates the given model object. If the model fails validation, then an instance of ValidationFailureException is thrown. In addition to the groups specified, this will assume the user is requesting validation from theDefault
group as well.- Parameters:
model
- the modelfirst
- the first groupremaining
- the remaining n groups- Throws:
ValidationFailureException
- if validation fails.
-