All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.api.validation.SimpleViolationsContainer Maven / Gradle / Ivy

The newest version!
package org.jboss.resteasy.api.validation;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.validation.ConstraintViolation;

public class SimpleViolationsContainer implements Serializable
{
   private static final long serialVersionUID = -7895854137980651540L;
   
   private Set> violations = new HashSet>();
   private Exception exception;
   private Object target;
   private boolean fieldsValidated;
   
   public SimpleViolationsContainer(Object target)
   {
      this.target = target;
   }
   
   public SimpleViolationsContainer(Set> cvs)
   {
      violations.addAll(cvs);
   }
   
   public void addViolations(Set> cvs)
   {
      violations.addAll(cvs);
   }
   
   public int size()
   {
      return violations.size();
   }
   
   public Exception getException()
   {
      return exception;
   }

   public void setException(Exception exception)
   {
      this.exception = exception;
   }
   
   public Object getTarget()
   {
      return target;
   }

   public void setTarget(Object target)
   {
      this.target = target;
   }
   
   public Set> getViolations()
   {
      return violations;
   }

   public boolean isFieldsValidated()
   {
      return fieldsValidated;
   }

   public void setFieldsValidated(boolean fieldsValidated)
   {
      this.fieldsValidated = fieldsValidated;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy