public class BackupContents
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<Clip> |
clipItems |
private java.util.List<Label> |
labels |
Modifier | Constructor and Description |
---|---|
|
BackupContents() |
private |
BackupContents(java.util.List<Label> labels,
java.util.List<Clip> clipItems) |
Modifier and Type | Method and Description |
---|---|
static BackupContents |
get(byte[] data)
Get the contents from a raw byte array
|
java.lang.String |
getAsJSON()
Get our contents as a JSON string
|
java.util.List<Clip> |
getClipItems() |
static BackupContents |
getDB()
Get the database data
|
static java.lang.String |
getDBAsJSON()
Get the database data as a JSON string
|
java.util.List<Label> |
getLabels() |
private static long |
getLargestId(java.util.List<Label> labels)
Get the largest
Label PK in the list |
private int |
getPos(java.util.List<Clip> list,
java.lang.String text)
Get the position of the given text
|
void |
merge(android.content.Context context,
BackupContents contents)
Merge the contents of the given item with this
|
void |
replaceDB()
Replace the contents of the database
|
void |
setClipItems(java.util.List<Clip> clipItems) |
void |
setLabels(java.util.List<Label> labels) |
private static void |
updateLabelId(java.util.List<Clip> clips,
Label label)
|
@Expose private java.util.List<Label> labels
@Expose private java.util.List<Clip> clipItems
@NonNull public static BackupContents getDB()
public static java.lang.String getDBAsJSON()
public static BackupContents get(@NonNull byte[] data)
data
- raw contentprivate static long getLargestId(@NonNull java.util.List<Label> labels)
Label
PK in the listlabels
- label listprivate static void updateLabelId(@NonNull java.util.List<Clip> clips, @NonNull Label label)
clips
- clipItems listlabel
- label to chage@NonNull public java.util.List<Label> getLabels()
public void setLabels(@NonNull java.util.List<Label> labels)
@NonNull public java.util.List<Clip> getClipItems()
public void setClipItems(@NonNull java.util.List<Clip> clipItems)
public java.lang.String getAsJSON()
public void merge(@NonNull android.content.Context context, @NonNull BackupContents contents)
context
- A Contextcontents
- contents to mergepublic void replaceDB()
private int getPos(@NonNull java.util.List<Clip> list, @NonNull java.lang.String text)
list
- list to checktext
- text to check