@ParametersAreNonnullByDefault public final class BoundInMemoryBackend extends AbstractInMemoryBackend
InMemoryBackend
, bound to a unique Id
, that stores all elements in
Map
s.
This Backend
is fully transient and used when a PersistentEObject
is not owned by a Resource
,
persistent or not.
For performance reason, each instance is bound to a unique Id
, but data are stored in maps shared between all
instances.
AbstractInMemoryBackend.Sizes
SERIALIZER_FACTORY
Constructor and Description |
---|
BoundInMemoryBackend(Id owner)
Constructs a new
BoundInMemoryBackend with the given owner . |
Modifier and Type | Method and Description |
---|---|
protected void |
checkFeature(FeatureBean feature)
Checks the specified
feature before using it. |
protected Map<Id,SingleFeatureBean> |
containers()
Returns the map that holds all containers.
|
void |
copyTo(DataMapper target) |
boolean |
equals(Object o) |
protected Map<SingleFeatureBean,Object> |
features()
Returns the map that holds single-features.
|
int |
hashCode() |
protected Map<Id,ClassBean> |
instances()
Returns the map that holds all instances.
|
protected void |
internalClose()
Cleanly closes the database, and releases any system resources associated with it.
|
void |
removeValue(SingleFeatureBean feature)
Removes the value of the specified
feature . |
<V> Optional<V> |
valueFor(SingleFeatureBean feature,
V value)
Defines the
value of the specified feature . |
allInstancesOf, containerFor, containerOf, internalSave, metaClassFor, metaClassOf, referenceConverter, removeContainer, valueOf
allInstancesOf, close, internalCopyTo, save, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isDistributed, isPersistent
allInstancesOf
addAllValues, addValue, allValuesOf, appendAllValues, appendValue, removeAllValues, removeValue, sizeOfValue, valueFor, valueOf
addAllReferences, addReference, allReferencesOf, appendAllReferences, appendReference, referenceFor, referenceOf, removeAllReferences, removeReference, sizeOfReference
referenceFor, referenceOf, removeReference
addAllValues, addValue, allValuesOf, getOrCreateList, removeAllValues, removeValue, sizeOfValue, valueFor, valueOf
manyReferenceConverter
referenceFor, referenceOf, removeReference
addAllReferences, addReference, allReferencesOf, appendAllReferences, appendReference, referenceFor, referenceOf, removeAllReferences, removeReference, sizeOfReference
public BoundInMemoryBackend(Id owner)
BoundInMemoryBackend
with the given owner
.owner
- the identifier of the owner of this back-endprotected void internalClose()
AbstractBackend
internalClose
in class AbstractBackend
public void copyTo(DataMapper target)
copyTo
in interface Copiable<DataMapper>
copyTo
in class AbstractBackend
@Nonnull protected Map<Id,SingleFeatureBean> containers()
AbstractInMemoryBackend
containers
in class AbstractInMemoryBackend
@Nonnull protected Map<Id,ClassBean> instances()
AbstractInMemoryBackend
instances
in class AbstractInMemoryBackend
@Nonnull protected Map<SingleFeatureBean,Object> features()
AbstractInMemoryBackend
features
in class AbstractInMemoryBackend
protected void checkFeature(FeatureBean feature)
AbstractInMemoryBackend
feature
before using it.checkFeature
in class AbstractInMemoryBackend
feature
- the feature to check@Nonnull public <V> Optional<V> valueFor(SingleFeatureBean feature, V value)
ValueMapper
value
of the specified feature
.valueFor
in interface ValueMapper
valueFor
in class AbstractInMemoryBackend
V
- the type of valuefeature
- the bean identifying the valuevalue
- the value to setOptional
containing the previous value of the feature
, or Optional.empty()
if
the feature has no value beforepublic void removeValue(SingleFeatureBean feature)
ValueMapper
feature
.removeValue
in interface ValueMapper
removeValue
in class AbstractInMemoryBackend
feature
- the bean identifying the valueCopyright © 2013–2019 Atlanmod. All rights reserved.