Package org.onosproject.net.config
Class ConfigFactory<S,C extends Config<S>>
- java.lang.Object
- 
- org.onosproject.net.config.ConfigFactory<S,C>
 
- 
- Type Parameters:
- S- type of subject
- C- type of configuration
 
 @Beta public abstract class ConfigFactory<S,C extends Config<S>> extends java.lang.ObjectBase abstract factory for creating configurations for the specified subject type.
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedConfigFactory(SubjectFactory<S> subjectFactory, java.lang.Class<C> configClass, java.lang.String configKey)Creates a new configuration factory for the specified class of subjects capable of generating the configurations of the specified class.protectedConfigFactory(SubjectFactory<S> subjectFactory, java.lang.Class<C> configClass, java.lang.String configKey, boolean isList)Creates a new configuration factory for the specified class of subjects capable of generating the configurations of the specified class.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Class<C>configClass()Returns the class of the configuration which this factory generates.java.lang.StringconfigKey()Returns the unique key (within subject class) of this configuration.abstract CcreateConfig()Creates a new but uninitialized configuration.booleanisList()Indicates whether the configuration is a list and should be backed by a JSON array rather than JSON object.SubjectFactory<S>subjectFactory()Returns the class of the subject to which this factory applies.
 
- 
- 
- 
Constructor Detail- 
ConfigFactoryprotected ConfigFactory(SubjectFactory<S> subjectFactory, java.lang.Class<C> configClass, java.lang.String configKey) Creates a new configuration factory for the specified class of subjects capable of generating the configurations of the specified class. The subject and configuration class keys are used merely as keys for use in composite JSON trees.- Parameters:
- subjectFactory- subject factory
- configClass- configuration class
- configKey- configuration class key
 
 - 
ConfigFactoryprotected ConfigFactory(SubjectFactory<S> subjectFactory, java.lang.Class<C> configClass, java.lang.String configKey, boolean isList) Creates a new configuration factory for the specified class of subjects capable of generating the configurations of the specified class. The subject and configuration class keys are used merely as keys for use in composite JSON trees.Note that configurations backed by JSON array are not easily extensible at the top-level as they are inherently limited to holding an ordered list of items. - Parameters:
- subjectFactory- subject factory
- configClass- configuration class
- configKey- configuration class key
- isList- true to indicate backing by JSON array
 
 
- 
 - 
Method Detail- 
subjectFactorypublic SubjectFactory<S> subjectFactory() Returns the class of the subject to which this factory applies.- Returns:
- subject type
 
 - 
configClasspublic java.lang.Class<C> configClass() Returns the class of the configuration which this factory generates.- Returns:
- configuration type
 
 - 
configKeypublic java.lang.String configKey() Returns the unique key (within subject class) of this configuration. This is primarily aimed for use in composite JSON trees in external representations and has no bearing on the internal behaviours.- Returns:
- configuration key
 
 - 
createConfigpublic abstract C createConfig() Creates a new but uninitialized configuration. Framework will initialize the configuration viaConfig.init(S, java.lang.String, com.fasterxml.jackson.databind.JsonNode, com.fasterxml.jackson.databind.ObjectMapper, org.onosproject.net.config.ConfigApplyDelegate)method.- Returns:
- new uninitialized configuration
 
 - 
isListpublic boolean isList() Indicates whether the configuration is a list and should be backed by a JSON array rather than JSON object.- Returns:
- true if backed by JSON array
 
 
- 
 
-