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 java.lang.Object
Base abstract factory for creating configuration subjects from their string key image.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SubjectFactory(java.lang.Class<S> subjectClass, java.lang.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(java.lang.String subjectKey)
Creates a configuration subject from its key image.java.lang.Class<S>
subjectClass()
Returns the class of the subject to which this factory applies.java.lang.String
subjectClassKey()
Returns the unique key of this configuration subject class.java.lang.String
subjectKey(S subject)
Returns the unique key of the specified configuration subject.
-
-
-
Constructor Detail
-
SubjectFactory
protected SubjectFactory(java.lang.Class<S> subjectClass, java.lang.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 java.lang.Class<S> subjectClass()
Returns the class of the subject to which this factory applies.- Returns:
- subject type
-
subjectClassKey
public java.lang.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 java.lang.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
-
createSubject
public abstract S createSubject(java.lang.String subjectKey)
Creates a configuration subject from its key image.- Parameters:
subjectKey
- subject class key- Returns:
- configuration subject
-
-