public final class LogLevelConverter extends AbstractConverter<Level>
Converter
implementation for the
java.util.logging.Level
type.Modifier and Type | Field and Description |
---|---|
static LogLevelConverter |
DEFAULT
LogLevelConverter single instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
appendMessageArguments(ValidationContext<?> context,
Map<String,Object> arguments)
Appends
levels argument that contains set of known log
levels. |
protected <T> Level |
doDecode(String value,
ValidationContext<T> context)
Converts string representation of log level into
java.util.logging.Level object. |
protected <T> String |
doEncode(Level value,
ValidationContext<T> context)
Converts
java.util.logging.Level object into string
representation. |
Class<Level> |
getType()
Returns
java.util.logging.Level type. |
decode, encode
getMessageTemplate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessageTemplate
public static final LogLevelConverter DEFAULT
LogLevelConverter
single instance.public Class<Level> getType()
java.util.logging.Level
type.java.util.logging.Level
type.public boolean appendMessageArguments(ValidationContext<?> context, Map<String,Object> arguments)
levels
argument that contains set of known log
levels.appendMessageArguments
in interface Converter<Level>
appendMessageArguments
in interface Validation<Level>
appendMessageArguments
in class AbstractValidation<Level>
context
- Validation context.arguments
- Arguments to be substituted into the error message
template.true
.protected <T> Level doDecode(String value, ValidationContext<T> context)
java.util.logging.Level
object.doDecode
in class AbstractConverter<Level>
T
- The type of validated entity.value
- String representation of log level.context
- Validation context.java.util.logging.Level
object.MalformedValueException
- if the specified string could not be
parsed as a log level.protected <T> String doEncode(Level value, ValidationContext<T> context)
java.util.logging.Level
object into string
representation.doEncode
in class AbstractConverter<Level>
T
- The type of validated entity.value
- java.util.logging.Level
object to be encoded.context
- Validation context.Copyright © 2011–2020 FoxLabs. All rights reserved.