Class ValidationHelper

java.lang.Object
dev.getelements.elements.sdk.model.util.ValidationHelper

public class ValidationHelper extends Object
Created by patricktwohig on 5/7/15.
  • Constructor Details

    • ValidationHelper

      public ValidationHelper()
  • Method Details

    • validateModel

      public <T> T validateModel(T model) throws ValidationFailureException
      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 the Default group as well.
      Parameters:
      model - the model
      first - the first group
      remaining - the remaining n groups
      Throws:
      ValidationFailureException - if validation fails.