Package com.storedobject.ai
Interface DataRetriever
public interface DataRetriever
Represents an interface for retrieving and managing stored objects of various types.
This interface provides default methods to list stored objects, count their instances,
and retrieve specific objects from storage.
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends StoredObject>
intCounts the number of instances of the specified class that exist in storage.default <T extends StoredObject>
TRetrieves a stored object of the specified type and purpose.default <T extends StoredObject>
ObjectIterator<T> Lists all stored objects of the specified type.
-
Method Details
-
list
Lists all stored objects of the specified type.- Type Parameters:
T
- the type of stored objects to be listed; it must extendStoredObject
.- Parameters:
c
- theClass
object representing the type of stored objects to be listed.- Returns:
- an
ObjectIterator<T>
containing all stored objects of the specified type.
-
count
Counts the number of instances of the specified class that exist in storage.- Type Parameters:
T
- the type of the class extendingStoredObject
.- Parameters:
c
- the class whose instances need to be counted.- Returns:
- the number of instances of the specified class in storage.
-
get
Retrieves a stored object of the specified type and purpose.- Type Parameters:
T
- The type of the stored object to retrieve, extendingStoredObject
.- Parameters:
c
- The class object representing the type of the stored object to retrieve.purpose
- The purpose or reason for retrieving the stored object, represented as a string.- Returns:
- The stored object of the specified type.
-