Package dev.morphia.mapping.validation
Class ConstraintViolation
- java.lang.Object
-
- dev.morphia.mapping.validation.ConstraintViolation
-
public class ConstraintViolation extends Object
- Author:
- Uwe Schaefer, (us@thomas-daily.de)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConstraintViolation.LevelLevels of constraint violations
-
Constructor Summary
Constructors Constructor Description ConstraintViolation(ConstraintViolation.Level level, EntityModel entityModel, PropertyModel property, Class<? extends ClassConstraint> validator, String message)Creates a violation instance to record invalid mapping metadataConstraintViolation(ConstraintViolation.Level level, EntityModel entityModel, Class<? extends ClassConstraint> validator, String message)Creates a violation instance to record invalid mapping metadata
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstraintViolation.LevelgetLevel()StringgetPrefix()Stringrender()
-
-
-
Constructor Detail
-
ConstraintViolation
public ConstraintViolation(ConstraintViolation.Level level, EntityModel entityModel, PropertyModel property, Class<? extends ClassConstraint> validator, String message)
Creates a violation instance to record invalid mapping metadata- Parameters:
level- the severity of the violationentityModel- the errant classproperty- the errant propertyvalidator- the constraint failedmessage- the message for the failure
-
ConstraintViolation
public ConstraintViolation(ConstraintViolation.Level level, EntityModel entityModel, Class<? extends ClassConstraint> validator, String message)
Creates a violation instance to record invalid mapping metadata- Parameters:
level- the severity of the violationentityModel- the errant classvalidator- the constraint failedmessage- the message for the failure
-
-
Method Detail
-
getLevel
public ConstraintViolation.Level getLevel()
- Returns:
- the severity of the violation
-
getPrefix
public String getPrefix()
- Returns:
- the qualified name of the failing mapping
-
render
public String render()
- Returns:
- a human friendly version of the violation
-
-