Package org.onosproject.net.config
Class BaseConfig<S>
- java.lang.Object
-
- org.onosproject.net.config.Config<S>
-
- org.onosproject.net.config.BaseConfig<S>
-
- Type Parameters:
S- type of subject
- All Implemented Interfaces:
CodecContext
- Direct Known Subclasses:
DeviceAnnotationConfig,DeviceInjectionConfig,HostAnnotationConfig,PortAnnotationConfig,ProtectionConfig
public abstract class BaseConfig<S> extends Config<S> implements CodecContext
Configwith access toCodecService.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.onosproject.net.config.Config
Config.FieldPresence
-
-
Constructor Summary
Constructors Constructor Description BaseConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> JsonCodec<T>codec(Class<T> entityClass)Returns the JSON codec for the specified entity class.protected <T> Tdecode(String json, Class<T> entityClass)Decodes the specified entity from JSON using codec registered to this context.<T> TgetService(Class<T> serviceClass)Returns reference to the specified service implementation.com.fasterxml.jackson.databind.ObjectMappermapper()Returns the JSON object mapper.-
Methods inherited from class org.onosproject.net.config.Config
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.codec.CodecContext
decode, encode
-
-
-
-
Method Detail
-
codec
public <T> JsonCodec<T> codec(Class<T> entityClass)
Description copied from interface:CodecContextReturns the JSON codec for the specified entity class.- Specified by:
codecin interfaceCodecContext- Type Parameters:
T- entity type- Parameters:
entityClass- entity class- Returns:
- JSON codec; null if no codec available for the class
-
getService
public <T> T getService(Class<T> serviceClass)
Description copied from interface:CodecContextReturns reference to the specified service implementation.- Specified by:
getServicein interfaceCodecContext- Type Parameters:
T- service type- Parameters:
serviceClass- service class- Returns:
- service implementation; null if no implementation available for the class
-
mapper
public com.fasterxml.jackson.databind.ObjectMapper mapper()
Description copied from interface:CodecContextReturns the JSON object mapper.- Specified by:
mapperin interfaceCodecContext- Returns:
- object mapper
-
-