-
- Type Parameters:
T
- the type of the object to read
- All Known Implementing Classes:
GluonCloudObjectDataReaderImpl
,GluonCloudObjectDataWriterImpl
,GluonCloudRemoteFunctionObjectDataReaderImpl
,GluonCloudUpdateFieldReader
,InputStreamObjectDataReader
,RestObjectDataReader
,RestObjectDataWriterAndRemover
public interface ObjectDataReader<T>
An ObjectDataReader is an entity that has the ability to read an object. The actual source and method that are used for reading the object is completely up to the implementation. The most common scenario is that the reader reads its data using aInputDataSource
and converts the read bytes by using anInputConverter
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GluonObservableObject<T>
newGluonObservableObject()
Provide an instance of a GluonObservableObject.T
readObject()
Reads the object and returns it.
-
-
-
Method Detail
-
newGluonObservableObject
GluonObservableObject<T> newGluonObservableObject()
Provide an instance of a GluonObservableObject. This method is called byDataProvider.retrieveObject(ObjectDataReader)
to get a GluonObservableObject that will contain the actual object when the retrieve operation has completed successfully. Most implementations will just return an instance of GluonObservableObject itself. Note that it is perfectly valid to return existing instances of GluonObservableObject.- Returns:
- an instance of a GluonObservableObject
-
readObject
T readObject() throws IOException
Reads the object and returns it. The actual source of the read and the method that converts the read data into an object instance is completely left to the implementation. This method is called byDataProvider.retrieveObject(ObjectDataReader)
to initiate the actual read process. The returned object will be set on the GluonObservableObject that is returned in thenewGluonObservableObject()
method.- Returns:
- the read object
- Throws:
IOException
- when an exception occurred during the read process
-
-