Codota Logo
HibernateConstraintValidatorContext.withDynamicPayload
Code IndexAdd Codota to your IDE (free)

How to use
withDynamicPayload
method
in
org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext

Best Java code snippets using org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext.withDynamicPayload (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: com.typesafe.play/play-java-forms

  default boolean reportValidationStatus(final Object validationResult, final ConstraintValidatorContext constraintValidatorContext) {
    if(validationSuccessful(validationResult)) {
      return true;
    }
    constraintValidatorContext
      .unwrap(HibernateConstraintValidatorContext.class)
      .withDynamicPayload(validationResult);
    return false;
  }
}
origin: com.typesafe.play/play-java-forms_2.12

  default boolean reportValidationStatus(final Object validationResult, final ConstraintValidatorContext constraintValidatorContext) {
    if(validationSuccessful(validationResult)) {
      return true;
    }
    constraintValidatorContext
      .unwrap(HibernateConstraintValidatorContext.class)
      .withDynamicPayload(validationResult);
    return false;
  }
}
origin: com.typesafe.play/play-java-forms_2.11

  default boolean reportValidationStatus(final Object validationResult, final ConstraintValidatorContext constraintValidatorContext) {
    if(validationSuccessful(validationResult)) {
      return true;
    }
    constraintValidatorContext
      .unwrap(HibernateConstraintValidatorContext.class)
      .withDynamicPayload(validationResult);
    return false;
  }
}
origin: org.hibernate.validator/hibernate-validator

/**
 * @param collection the collection to validate
 * @param constraintValidatorContext context in which the constraint is evaluated
 *
 * @return true if the input collection is null or does not contain duplicate elements
 */
@Override
public boolean isValid(Collection collection, ConstraintValidatorContext constraintValidatorContext) {
  if ( collection == null || collection.size() < 2 ) {
    return true;
  }
  List<Object> duplicates = findDuplicates( collection );
  if ( duplicates.isEmpty() ) {
    return true;
  }
  if ( constraintValidatorContext instanceof HibernateConstraintValidatorContext ) {
    constraintValidatorContext.unwrap( HibernateConstraintValidatorContext.class )
        .addMessageParameter( "duplicates", duplicates.stream().map( String::valueOf ).collect( Collectors.joining( ", " ) ) )
        .withDynamicPayload( CollectionHelper.toImmutableList( duplicates ) );
  }
  return false;
}
org.hibernate.validator.constraintvalidationHibernateConstraintValidatorContextwithDynamicPayload

Javadoc

Allows to set an object that may further describe the violation. The user is responsible himself to ensure that this payload is serializable in case the javax.validation.ConstraintViolation has to be serialized.

Popular methods of HibernateConstraintValidatorContext

  • addExpressionVariable
    Allows to set an additional expression variable which will be available as an EL variable during int
  • buildConstraintViolationWithTemplate
  • getConstraintValidatorPayload
    Returns an instance of the specified type or null if the current constraint validator payload isn't
  • addMessageParameter
    Allows to set an additional named parameter which can be interpolated in the constraint violation me
  • disableDefaultConstraintViolation
  • getDefaultConstraintMessageTemplate
  • getTimeProvider
    Returns the provider for obtaining the current time, e.g. when validating the Future and Pastconstra
  • unwrap

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JTable (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now