Package org.onosproject.net.config
Class SubjectFactory<S>
- java.lang.Object
-
- org.onosproject.net.config.SubjectFactory<S>
-
- Type Parameters:
S
- subject class
@Beta public abstract class SubjectFactory<S> extends Object
Base abstract factory for creating configuration subjects from their string key image.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SubjectFactory(Class<S> subjectClass, String subjectClassKey)
Creates a new configuration factory for the specified class of subjects capable of generating the configurations of the specified class.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract S
createSubject(String subjectKey)
Creates a configuration subject from its key image.Class<S>
subjectClass()
Returns the class of the subject to which this factory applies.String
subjectClassKey()
Returns the unique key of this configuration subject class.String
subjectKey(S subject)
Returns the unique key of the specified configuration subject.
-
-
-
Constructor Detail
-
SubjectFactory
protected SubjectFactory(Class<S> subjectClass, String subjectClassKey)
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:
subjectClass
- subject classsubjectClassKey
- subject class key
-
-
Method Detail
-
subjectClass
public Class<S> subjectClass()
Returns the class of the subject to which this factory applies.- Returns:
- subject type
-
subjectClassKey
public String subjectClassKey()
Returns the unique key of this configuration subject class. This is primarily aimed for use in composite JSON trees in external representations and has no bearing on the internal behaviours.- Returns:
- configuration key
-
subjectKey
public String subjectKey(S subject)
Returns the unique key of the specified configuration subject. This is primarily aimed for use in composite JSON trees in external representations and has no bearing on the internal behaviours.- Parameters:
subject
- specific subject- Returns:
- subject key
-
-