Class GenericPodioInterfaceProxy
- java.lang.Object
-
- com.java_podio.code_gen.static_interface.GenericPodioInterfaceProxy
-
public abstract class GenericPodioInterfaceProxy extends Object
This is a proxy/cache for podio objects. It immediately delegates all calls - except unnecessary updates are suppressed.
Note: any methods of subclasses ofGenericPodioImplthat directly useGenericPodioImpl.getAPI(Integer, Class)bypass the caching!
-
-
Constructor Summary
Constructors Constructor Description GenericPodioInterfaceProxy()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static <T extends AppWrapper>
voidcacheItem(Class<T> type, AppWrapper item)protected static <T extends AppWrapper>
voidcacheItems(Collection<T> items)static voidclearCache()protected static <T extends AppWrapper>
TcopyItem(T item)protected static <T extends AppWrapper>
TgetCachedItem(Class<T> type, Integer podioId)protected static <T extends AppWrapper>
TgetCachedItem(T item)Returns the cached item that is equal with respect toitem.getPodioId(), ornull.protected static <T extends AppWrapper>
booleanisCached(T item)static voidprintCache()static GenericPodioInterfaceproxify(GenericPodioInterface original)static <T extends GenericPodioInterface>
Tproxify(T original, Class<T> interfaceType)
-
-
-
Method Detail
-
getCachedItem
protected static <T extends AppWrapper> T getCachedItem(Class<T> type, Integer podioId)
- Parameters:
type-podioId-- Returns:
- cached object or
null, if no object is found orpodioId==null
-
getCachedItem
protected static <T extends AppWrapper> T getCachedItem(T item)
Returns the cached item that is equal with respect toitem.getPodioId(), ornull.- Parameters:
item-- Returns:
-
isCached
protected static <T extends AppWrapper> boolean isCached(T item)
- Parameters:
item-- Returns:
trueif the cache contains an item that is equal to the parameter.
-
cacheItem
protected static <T extends AppWrapper> void cacheItem(Class<T> type, AppWrapper item)
- Parameters:
type-item-- Throws:
IllegalArgumentException- ifitem.getPodioId()==null
-
cacheItems
protected static <T extends AppWrapper> void cacheItems(Collection<T> items)
-
copyItem
protected static <T extends AppWrapper> T copyItem(T item) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
printCache
public static void printCache()
-
proxify
public static <T extends GenericPodioInterface> T proxify(T original, Class<T> interfaceType)
- Parameters:
original-interfaceType- must be interface!- Returns:
-
proxify
public static GenericPodioInterface proxify(GenericPodioInterface original)
- Parameters:
original-- Returns:
- See Also:
proxify(GenericPodioInterface, Class)
-
clearCache
public static void clearCache()
-
-