Package one.microstream.reference
Class ControlledLazyReference.Default<T>
java.lang.Object
one.microstream.reference.Lazy.Default<T>
one.microstream.reference.ControlledLazyReference.Default<T>
- Type Parameters:
T- type parameter
- All Implemented Interfaces:
ControlledLazyReference<T>,Lazy<T>,Referencing<T>
- Enclosing interface:
- ControlledLazyReference<T>
public static final class ControlledLazyReference.Default<T> extends Lazy.Default<T> implements ControlledLazyReference<T>
This implementation of the
ControlledLazyReference
lets a LazyClearController decide if the lazy reference can be cleared.-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.reference.ControlledLazyReference
ControlledLazyReference.Default<T>Nested classes/interfaces inherited from interface one.microstream.reference.Lazy
Lazy.Check, Lazy.Checker, Lazy.ClearingEvaluator, Lazy.Default<T> -
Constructor Summary
Constructors Constructor Description Default(T subject, LazyClearController lazyClearController)Standard constructor used by normal logic to instantiate a reference. -
Method Summary
Modifier and Type Method Description Tclear()Clears the reference, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing.booleanclear(Lazy.ClearingEvaluator clearingEvaluator)Clears the reference if theclearingEvaluatordecides to, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing.voidsetLazyClearController(LazyClearController lazyClearController)Methods inherited from class one.microstream.reference.Lazy.Default
$link, $setLoader, $unlink, genericType, get, isLoaded, isStored, lastTouched, objectId, peek, toString
-
Constructor Details
-
Default
Standard constructor used by normal logic to instantiate a reference.- Parameters:
subject- the subject to be referenced.lazyClearController- the lazy reference clear controller.
-
-
Method Details
-
setLazyClearController
- Specified by:
setLazyClearControllerin interfaceControlledLazyReference<T>
-
clear
Description copied from interface:LazyClears the reference, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing.- Specified by:
clearin interfaceLazy<T>- Overrides:
clearin classLazy.Default<T>- Returns:
- the subject referenced prior to clearing the reference.
- See Also:
Lazy.clear(ClearingEvaluator)
-
clear
Description copied from interface:LazyClears the reference if theclearingEvaluatordecides to, leaving the option to re-load it again intact, and returns the subject that was referenced prior to clearing.- Specified by:
clearin interfaceLazy<T>- Overrides:
clearin classLazy.Default<T>- Parameters:
clearingEvaluator- evaluator which decides if the reference should be cleared- Returns:
- if this lazy references was cleared
- See Also:
Lazy.clear()
-