StoreBytesData.Builder

  • StoreBytesData.Builder facilitates the creation of StoreBytesData objects for storing data with Block Store.

  • It allows you to specify the data (bytes), an associated key, and whether the data should be backed up to the cloud.

  • If a key is not explicitly set using setKey, the data is stored under a default key (BlockstoreClient.DEFAULT_BYTES_DATA_KEY).

  • The build() method finalizes the builder configuration and returns the constructed StoreBytesData object.

public static final class StoreBytesData.Builder extends Object

A builder for StoreBytesData objects.

Public Constructor Summary

Builder()
Constructor for the StoreBytesData.Builder class.

Public Method Summary

StoreBytesData
build()
Builds and returns the StoreBytesData object.
StoreBytesData.Builder
setBytes(byte[] bytes)
Sets the raw bytes to be stored with Block Store.
StoreBytesData.Builder
setKey(String key)
Sets the key with which the bytes are associated with.
StoreBytesData.Builder
setShouldBackupToCloud(boolean shouldBackupToCloud)
Sets whether the bytes to be stored should be backed up to the cloud in the next sync.

Inherited Method Summary

Public Constructors

public Builder ()

Constructor for the StoreBytesData.Builder class.

Public Methods

public StoreBytesData build ()

Builds and returns the StoreBytesData object.

public StoreBytesData.Builder setBytes (byte[] bytes)

Sets the raw bytes to be stored with Block Store. See BlockstoreClient.MAX_SIZE for the maximum size allowed for a key-bytes entry.

public StoreBytesData.Builder setKey (String key)

Sets the key with which the bytes are associated with. See BlockstoreClient.MAX_SIZE for the maximum size allowed for a key-bytes entry.

If setKey is never invoked, the bytes will be associated with the default key BlockstoreClient.DEFAULT_BYTES_DATA_KEY when stored into Block Store.

public StoreBytesData.Builder setShouldBackupToCloud (boolean shouldBackupToCloud)

Sets whether the bytes to be stored should be backed up to the cloud in the next sync.