T
- The type of the object to be attached/detachedRef
- The type of the reference to store when the object is detached.public abstract class AbstractDetachable<T,Ref> extends Object implements Detachable<T>
#load()
.Modifier | Constructor and Description |
---|---|
protected |
AbstractDetachable(T aObject)
Constructs the detachable.
|
Modifier and Type | Method and Description |
---|---|
void |
detach()
Detaches the object.
|
T |
get()
Gets the object, attaching it if needed.
|
protected abstract Ref |
getReference(T aObject)
Obtains the reference for a given object.
|
protected abstract T |
load(Ref aReference)
Loads the object based on a reference.
|
protected AbstractDetachable(T aObject)
aObject
- Object.IllegalArgumentException
- When the object passed in is null.public void detach()
Detachable
detach
in interface Detachable<T>
public T get()
Detachable
get
in interface Detachable<T>
protected abstract T load(Ref aReference)
aReference
- Reference.Copyright © 2024. All rights reserved.