@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
ObjectCreationException
public void validateObjectIfNotBorrowed() throws ObjectDisposeException
ObjectDisposeException
public boolean disposeIfNotBorrowed() throws ObjectDisposeException
ObjectDisposeException
public RecyclingSupplier.Factory<T> getFactory()
Copyright © 2018 SPF4J. All rights reserved.