Class 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 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 class
        subjectClassKey - 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
      • createSubject

        public abstract S createSubject​(String subjectKey)
        Creates a configuration subject from its key image.
        Parameters:
        subjectKey - subject class key
        Returns:
        configuration subject