@ParametersAreNonnullByDefault public final class ObjectHolder<T> extends Object
| Modifier and Type | Method and Description |
|---|---|
T |
borrowObjectIfAvailable() |
T |
borrowOrCreateObjectIfPossible() |
boolean |
disposeIfNotBorrowed() |
RecyclingSupplier.Factory<T> |
getFactory() |
T |
getObj() |
void |
returnObject(T object,
Exception e) |
String |
toString() |
void |
validateObjectIfNotBorrowed() |
public T getObj()
@Nullable public T borrowOrCreateObjectIfPossible() throws ObjectCreationException
ObjectCreationExceptionpublic void validateObjectIfNotBorrowed()
throws ObjectDisposeException
ObjectDisposeExceptionpublic boolean disposeIfNotBorrowed()
throws ObjectDisposeException
ObjectDisposeExceptionpublic RecyclingSupplier.Factory<T> getFactory()
Copyright © 2018 SPF4J. All rights reserved.