Package org.moeaframework.analysis.store
Interface Container
public interface Container
A container of blobs.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturnstrueif the blob identified by this name exists within this container.voidcreate()Creates the underlying, physical container.booleandelete()Deletes this container if it exists, including all blobs contained within.booleanexists()Returnstrueif the underlying, physical container exists.Gets a reference to a blob with the given name.Gets the data store managing this container.Gets the reference for this container.default URIgetURI()Returns the URI for this container, which can be used withDataStoreFactory.resolveContainer(java.net.URI).Returns all blobs stored in this container.Returns a stream of all blobs stored in this container.default StringtoJSON()Returns the contents of this container formatted as JSON.default StringReturns the contents of this container formatted as JSON.default StringReturns the contents of this container formatted as JSON.
-
Method Details
-
getDataStore
DataStore getDataStore()Gets the data store managing this container.- Returns:
- the data store
-
getReference
Reference getReference()Gets the reference for this container.- Returns:
- the reference
-
getBlob
Gets a reference to a blob with the given name.- Parameters:
name- the blob name- Returns:
- the blob reference
-
create
Creates the underlying, physical container. Containers are automatically created when writing a blob, so an explicit call to create the container is not required.- Throws:
DataStoreException- if an error occurred accessing the data store
-
exists
Returnstrueif the underlying, physical container exists.- Returns:
trueif the container exists;falseotherwise- Throws:
DataStoreException- if an error occurred accessing the data store
-
delete
Deletes this container if it exists, including all blobs contained within.- Returns:
trueif the container was deleted;falseif the container does not exist- Throws:
DataStoreException- if an error occurred accessing the data store
-
streamBlobs
Returns a stream of all blobs stored in this container. The caller must close the stream when finished.- Returns:
- a stream of blobs in this container
- Throws:
DataStoreException- if an error occurred accessing the data store
-
listBlobs
Returns all blobs stored in this container.- Returns:
- the blobs in this container
- Throws:
DataStoreException- if an error occurred accessing the data store
-
contains
Returnstrueif the blob identified by this name exists within this container.- Parameters:
name- the blob name- Returns:
trueif the blob exists;falseotherwise- Throws:
DataStoreException- if an error occurred accessing the data store
-
getURI
Returns the URI for this container, which can be used withDataStoreFactory.resolveContainer(java.net.URI).- Returns:
- the URI
-
toJSON
Returns the contents of this container formatted as JSON.- Returns:
- the JSON string
-
toJSON
Returns the contents of this container formatted as JSON.- Parameters:
baseURI- the base URI, which is used to produce URLs- Returns:
- the JSON string
-
toJSON
Returns the contents of this container formatted as JSON.- Parameters:
baseURI- the base URI, which is used to produce URLsfull- iftrue, output the full data (can produce large output)- Returns:
- the JSON string
-