Package org.robolectric.shadows
Class BackupDataEntity
java.lang.Object
org.robolectric.shadows.BackupDataEntity
Represents a key value pair in
ShadowBackupDataInput and ShadowBackupDataOutput.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BackupDataEntityConstructs a new entity where the size of the value is the entire array.static BackupDataEntityConstructs a new entity.static BackupDataEntityConstructs a pair with a string value.static BackupDataEntityConstructs a new entity with the given key but a negative size.abstract byte[]data()The byte array of data in a backup entity.abstract intdataSize()The size of data in a backup entity.abstract Stringkey()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
-