Package org.cache2k.config
Class CustomizationSupplierByClassName<T>
- java.lang.Object
-
- org.cache2k.config.CustomizationSupplierByClassName<T>
-
- All Implemented Interfaces:
BeanMarker
,ConfigBean
,CustomizationSupplier<T>
,ValidatingConfigBean
public final class CustomizationSupplierByClassName<T> extends Object implements CustomizationSupplier<T>, ValidatingConfigBean
Creates a new instance of the customization based on the class name and the class loader in effect by the cache.- Author:
- Jens Wilke
-
-
Constructor Summary
Constructors Constructor Description CustomizationSupplierByClassName()
Default constructor for beans.CustomizationSupplierByClassName(String className)
Construct a customization factory based on the class name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigBuilder
builder()
boolean
equals(@Nullable Object other)
@Nullable String
getClassName()
int
hashCode()
void
setClassName(String v)
T
supply(CacheBuildContext<?,?> ctx)
Create or return an existing customization instance.void
validate()
Check whether the configuration is valid, especially whether mandatory fields are set.
-
-
-
Constructor Detail
-
CustomizationSupplierByClassName
public CustomizationSupplierByClassName()
Default constructor for beans.
-
CustomizationSupplierByClassName
public CustomizationSupplierByClassName(String className)
Construct a customization factory based on the class name.- Parameters:
className
- Fully qualified class name, used to create the class instance via aClassLoader.loadClass(String)
. The class must have a default constructor. Not null.
-
-
Method Detail
-
setClassName
public void setClassName(String v)
-
validate
public void validate()
Description copied from interface:ValidatingConfigBean
Check whether the configuration is valid, especially whether mandatory fields are set.- Specified by:
validate
in interfaceValidatingConfigBean
-
builder
public ConfigBuilder builder()
- Specified by:
builder
in interfaceConfigBean
-
supply
public T supply(CacheBuildContext<?,?> ctx)
Description copied from interface:CustomizationSupplier
Create or return an existing customization instance.- Specified by:
supply
in interfaceCustomizationSupplier<T>
- Returns:
- created customization, never
null
-
-