Package com.hazelcast.config
Class AbstractFactoryWithPropertiesConfig<T extends AbstractFactoryWithPropertiesConfig<T>>
- java.lang.Object
-
- com.hazelcast.config.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 Summary
Fields Modifier and Type Field Description protected boolean
enabled
protected java.lang.String
factoryClassName
protected java.util.Properties
properties
-
Constructor Summary
Constructors Constructor Description AbstractFactoryWithPropertiesConfig()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getFactoryClassName()
Returns the factory class name.java.util.Properties
getProperties()
Gets all properties.java.lang.String
getProperty(java.lang.String name)
Gets a property.int
hashCode()
boolean
isEnabled()
Returns if this configuration is enabled.protected abstract T
self()
T
setEnabled(boolean enabled)
Enables and disables this configuration.T
setFactoryClassName(java.lang.String factoryClassName)
Sets the factory class name.T
setProperties(java.util.Properties properties)
Sets the properties.T
setProperty(java.lang.String name, java.lang.String value)
Sets a single property.java.lang.String
toString()
-
-
-
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 setvalue
- the value of the property to set- Returns:
- the updated config object (self)
- Throws:
java.lang.NullPointerException
- if name or value isnull
-
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 isnull
-
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 isnull
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
self
protected abstract T self()
-
-