java.lang.Object | ||
↳ | org.apache.commons.betwixt.strategy.IdStoringStrategy | |
↳ | org.apache.commons.betwixt.strategy.DefaultIdStoringStrategy |
Stores every ID that given to it into an internal HashMap
and
returns it on request.
DefaultIdStoringStrategy(Map, Map)
allows the implementations
to be specified.
For example, those who want to use identity (rather than equality)
should pass a IdentityHashMap
instance.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.commons.betwixt.strategy.IdStoringStrategy
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a
IdStoringStrategy using a HashMap for
storage. | |||||||||||
Constructs a
IdStoringStrategy using the Map
implementations provided for storage. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a String id for the given bean if it has been stored previously.
| |||||||||||
Gets an object matching the given reference.
| |||||||||||
Clears all beans.
| |||||||||||
Stores an ID for the given instance and context.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.commons.betwixt.strategy.IdStoringStrategy
| |||||||||||
From class
java.lang.Object
|
Constructs a IdStoringStrategy
using the Map
implementations provided for storage.
idByBeanMap | Map implementation stores the ID's by bean |
---|---|
beanByIdMap | Map implementation stores the bean's by ID |
Returns a String id for the given bean if it has been stored previously. Otherwise returns null.
context | current context, not null |
---|---|
bean | the instance, not null |
Gets an object matching the given reference.
context | Context , not null |
---|---|
id | the reference id |
Clears all beans.
Stores an ID for the given instance and context. It will check first if this ID has been previously stored and will do nothing in that case.
context | current context, not null |
---|---|
bean | current instance, not null |
id | the ID to store |