Package org.robolectric.shadows
Class BackupDataEntity
java.lang.Object
org.robolectric.shadows.BackupDataEntity
Represents a key value pair in
ShadowBackupDataInput
and ShadowBackupDataOutput
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic BackupDataEntity
Constructs a new entity where the size of the value is the entire array.static BackupDataEntity
Constructs a new entity.static BackupDataEntity
Constructs a pair with a string value.static BackupDataEntity
Constructs a new entity with the given key but a negative size.abstract byte[]
data()
The byte array of data in a backup entity.abstract int
dataSize()
The size of data in a backup entity.abstract String
key()
The header key for a backup entity.
-
Constructor Details
-
BackupDataEntity
public BackupDataEntity()
-
-
Method Details
-
key
The header key for a backup entity. -
dataSize
public abstract int dataSize()The size of data in a backup entity. -
data
public abstract byte[] data()The byte array of data in a backup entity. -
createDeletedEntity
Constructs a new entity with the given key but a negative size. This represents a deleted pair. -
create
Constructs a pair with a string value. The value will be converted to a byte array inStandardCharsets.UTF_8
. -
create
Constructs a new entity where the size of the value is the entire array. -
create
Constructs a new entity.- Parameters:
key
- the key of the pairdata
- the value to associate with the keydataSize
- the length of the value in bytes
-