S
- type of subjectpublic abstract class BaseConfig<S> extends Config<S> implements CodecContext
Config
with access to CodecService
.Config.FieldPresence
Constructor and Description |
---|
BaseConfig() |
Modifier and Type | Method and Description |
---|---|
<T> JsonCodec<T> |
codec(java.lang.Class<T> entityClass)
Returns the JSON codec for the specified entity class.
|
protected <T> T |
decode(java.lang.String json,
java.lang.Class<T> entityClass)
Decodes the specified entity from JSON using codec
registered to this context.
|
<T> T |
getService(java.lang.Class<T> serviceClass)
Returns reference to the specified service implementation.
|
com.fasterxml.jackson.databind.ObjectMapper |
mapper()
Returns the JSON object mapper.
|
apply, clear, get, get, get, get, get, get, getList, getList, hasField, hasField, hasFields, hasFields, hasOnlyFields, hasOnlyFields, init, isBoolean, isBoolean, isConnectPoint, isConnectPoint, isDecimal, isDecimal, isIntegralNumber, isIntegralNumber, isIpAddress, isIpAddress, isIpPrefix, isIpPrefix, isMacAddress, isMacAddress, isNumber, isNumber, isString, isString, isTpPort, isTpPort, isValid, isValidLength, key, node, setList, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, setOrClear, subject, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
decode, encode
public <T> JsonCodec<T> codec(java.lang.Class<T> entityClass)
CodecContext
codec
in interface CodecContext
T
- entity typeentityClass
- entity classpublic <T> T getService(java.lang.Class<T> serviceClass)
CodecContext
getService
in interface CodecContext
T
- service typeserviceClass
- service classpublic com.fasterxml.jackson.databind.ObjectMapper mapper()
CodecContext
mapper
in interface CodecContext
protected <T> T decode(java.lang.String json, java.lang.Class<T> entityClass)
T
- entity class typejson
- JSON String to decodeentityClass
- entity class