B
- the "self"-type of this PersistenceOptionsBuilder
O
- the type of PersistenceOptions
built by this builderpublic abstract class AbstractPersistenceOptionsBuilder<B extends AbstractPersistenceOptionsBuilder<B,O>,O extends AbstractPersistenceOptions> extends Object implements PersistenceOptionsBuilder
PersistenceOptionsBuilder
that manages the assembly and the construction of
PersistenceOptions
.
All features are all optional: options can be created using all or none of them.
Modifier | Constructor and Description |
---|---|
protected |
AbstractPersistenceOptionsBuilder()
Constructs a new
AbstractPersistenceOptionsBuilder . |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
asMap()
Returns an immutable
Map containing all defined options. |
B |
cacheFeatures()
Adds the
cache-features feature in the created options. |
B |
cacheIsSet()
Adds the
cache-is-set feature in the created options. |
B |
cacheSizes()
Adds the
cache-sizes feature in the created options. |
B |
countLoadedObjects()
Adds the
count-loaded-objects feature in the created options. |
B |
log()
Adds the
log feature in the created options. |
static Map<String,Object> |
noOption()
Returns an immutable empty
Map . |
B |
option(String key,
Object value)
Adds a key/value in the created options.
|
protected B |
storeOption(PersistentStoreOptions storeOption)
Adds a feature defined by the given
storeOption in the created options. |
protected void |
validate()
Validates the defined options, and checks if there is conflict between them.
|
protected AbstractPersistenceOptionsBuilder()
AbstractPersistenceOptionsBuilder
.@Nonnull public static Map<String,Object> noOption()
Map
.Map
@Nonnull public final Map<String,Object> asMap() throws InvalidOptionException
PersistenceOptionsBuilder
Map
containing all defined options.asMap
in interface PersistenceOptionsBuilder
Map
InvalidOptionException
- if a conflict is detected during buildingprotected void validate() throws InvalidOptionException
InvalidOptionException
- if a conflict is detectedprotected B storeOption(PersistentStoreOptions storeOption)
storeOption
in the created options.storeOption
- the option to addpublic B option(String key, Object value)
key
- the key to addvalue
- the value of the key
public B cacheIsSet()
cache-is-set
feature in the created options.IsSetCachingStoreDecorator
public B cacheSizes()
cache-sizes
feature in the created options.SizeCachingStoreDecorator
public B cacheFeatures()
cache-features
feature in the created options.FeatureCachingStoreDecorator
public B log()
log
feature in the created options.LoggingStoreDecorator
public B countLoadedObjects()
count-loaded-objects
feature in the created options.LoadedObjectCounterStoreDecorator
Copyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.