public abstract class Severity
extends java.lang.Object
implements javax.validation.Payload
ConstraintViolation
. Severity
levels are extraneous to the javax.validation framework and can only be
conveyed using generic Payload
objects. Unfortunately, only the class
of those objects is communicated back to the client. The class is the
message. Concrete instances or enum
s (an obvious choice for severity
levels) cannot function as Payload
objects. The Severity class
enables you to program using true Severity instances (one for each level),
while behind the scenes only the class of those instances is taken into
account.Modifier and Type | Class and Description |
---|---|
static class |
Severity.Error |
static class |
Severity.Notice |
static class |
Severity.Warning |
Modifier and Type | Field and Description |
---|---|
static Severity.Error |
ERROR |
static Severity.Notice |
NOTICE |
static Severity.Warning |
WARNING |
Modifier and Type | Method and Description |
---|---|
static Severity |
forName(java.lang.String name)
Get
Severity object for the specified String
representation. |
static Severity |
getSeverity(javax.validation.ConstraintViolation<?> error)
Get the
Severity of the specified ConstraintViolation . |
java.lang.String |
toString() |
public static final Severity.Notice NOTICE
public static final Severity.Warning WARNING
public static final Severity.Error ERROR
public static Severity forName(java.lang.String name)
name
- The String
representation of Severity
object
you want.Severity
objectpublic static Severity getSeverity(javax.validation.ConstraintViolation<?> error)
Severity
of the specified ConstraintViolation
.error
- The ConstraintViolation
Severity
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2007-2020 EDIT. All Rights Reserved.