Class AbstractFactoryWithPropertiesConfig<T extends AbstractFactoryWithPropertiesConfig<T>>

  • Type Parameters:
    T - final child type
    Direct Known Subclasses:
    AuditlogConfig, SSLConfig

    public abstract class AbstractFactoryWithPropertiesConfig<T extends AbstractFactoryWithPropertiesConfig<T>>
    extends java.lang.Object
    Configuration base for config types with a factory class and its properties.
    • Field Detail

      • enabled

        protected boolean enabled
      • factoryClassName

        protected java.lang.String factoryClassName
      • properties

        protected java.util.Properties properties
    • Constructor Detail

      • AbstractFactoryWithPropertiesConfig

        public AbstractFactoryWithPropertiesConfig()
    • Method Detail

      • getFactoryClassName

        public java.lang.String getFactoryClassName()
        Returns the factory class name.
      • setFactoryClassName

        public T setFactoryClassName​(@Nonnull
                                     java.lang.String factoryClassName)
        Sets the factory class name.
      • isEnabled

        public boolean isEnabled()
        Returns if this configuration is enabled.
        Returns:
        true if enabled, false otherwise
      • setEnabled

        public T setEnabled​(boolean enabled)
        Enables and disables this configuration.
        Parameters:
        enabled - true to enable, false to disable
      • setProperty

        public T setProperty​(java.lang.String name,
                             java.lang.String value)
        Sets a single property.
        Parameters:
        name - the name of the property to set
        value - the value of the property to set
        Returns:
        the updated config object (self)
        Throws:
        java.lang.NullPointerException - if name or value is null
      • getProperty

        public java.lang.String getProperty​(java.lang.String name)
        Gets a property.
        Parameters:
        name - the name of the property to get
        Returns:
        the value of the property, null if not found
        Throws:
        java.lang.NullPointerException - if name is null
      • getProperties

        public java.util.Properties getProperties()
        Gets all properties.
        Returns:
        the properties
      • setProperties

        public T setProperties​(@Nonnull
                               java.util.Properties properties)
        Sets the properties.
        Parameters:
        properties - the properties to set
        Returns:
        the updated config object (self)
        Throws:
        java.lang.IllegalArgumentException - if properties is null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • self

        protected abstract T self()