public class Clip extends java.lang.Object implements AdapterItem, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private long |
date |
private static java.lang.String |
DESC_LABEL |
private java.lang.String |
device |
private boolean |
fav |
private long |
id |
private java.util.List<Label> |
labels
The Labels - TODO this should be done with Relation or something
|
private java.util.List<java.lang.Long> |
labelsId
PK's of the labels - only used for backup/restore
|
private boolean |
remote |
private java.lang.String |
text |
static java.lang.String |
TEXT_PLAIN |
Constructor and Description |
---|
Clip() |
Clip(Clip clip,
java.util.List<Label> labels,
java.util.List<java.lang.Long> labelsId) |
Clip(long id,
java.lang.String text,
long date,
boolean fav,
boolean remote,
java.lang.String device) |
Clip(java.lang.String text,
long date,
boolean fav,
boolean remote,
java.lang.String device) |
Modifier and Type | Method and Description |
---|---|
void |
addLabel(Label label)
Add a Label if it doesn't exist
|
void |
addLabels(java.util.List<Label> labels)
Add labels if they don't exist
|
void |
doShare(android.content.Context ctxt,
android.view.View view)
Share the Clip with other apps
|
boolean |
equals(java.lang.Object o) |
long |
getDate() |
java.lang.String |
getDevice() |
boolean |
getFav() |
long |
getId() |
java.util.List<Label> |
getLabels() |
java.util.List<java.lang.Long> |
getLabelsId() |
boolean |
getRemote() |
java.lang.String |
getText() |
int |
hashCode() |
private boolean |
hasLabel(Label label)
Do we have the given label
|
static boolean |
isWhitespace(Clip clip)
Is a
Clip all whitespace |
void |
removeLabel(Label label)
Remove a Label if it exists
|
void |
send(android.content.Context cntxt)
Send to our devices
|
void |
setDate(long date) |
void |
setDevice(java.lang.String device) |
void |
setFav(java.lang.Boolean fav) |
void |
setId(long id) |
void |
setLabels(java.util.List<Label> labels) |
void |
setRemote(java.lang.Boolean remote) |
void |
setText(java.lang.String text) |
java.lang.String |
toString() |
void |
updateLabelId(Label label)
Update the label id with the id of the given label
|
public static final java.lang.String TEXT_PLAIN
private static final java.lang.String DESC_LABEL
private long id
@Expose private java.lang.String text
@Expose private long date
@Expose private boolean fav
@Expose private boolean remote
@Expose private java.lang.String device
@Expose @NonNull private java.util.List<Label> labels
@Expose @NonNull private java.util.List<java.lang.Long> labelsId
public Clip()
public Clip(java.lang.String text, long date, boolean fav, boolean remote, java.lang.String device)
public Clip(long id, java.lang.String text, long date, boolean fav, boolean remote, java.lang.String device)
public static boolean isWhitespace(@Nullable Clip clip)
Clip
all whitespaceclip
- itempublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public long getId()
getId
in interface AdapterItem
public void setId(long id)
public java.lang.String getText()
public void setText(java.lang.String text)
public long getDate()
public void setDate(long date)
public boolean getFav()
public void setFav(java.lang.Boolean fav)
public boolean getRemote()
public void setRemote(java.lang.Boolean remote)
public java.lang.String getDevice()
public void setDevice(java.lang.String device)
@NonNull public java.util.List<Label> getLabels()
public void setLabels(@Nullable java.util.List<Label> labels)
@NonNull public java.util.List<java.lang.Long> getLabelsId()
public void send(android.content.Context cntxt)
cntxt
- A Contextpublic void addLabel(@NonNull Label label)
label
- Labelpublic void removeLabel(@NonNull Label label)
label
- Labelpublic void addLabels(@NonNull java.util.List<Label> labels)
labels
- Labelspublic void updateLabelId(@NonNull Label label)
label
- label with new idpublic void doShare(android.content.Context ctxt, @Nullable android.view.View view)
ctxt
- A contextview
- The View
that is requesting the shareprivate boolean hasLabel(@NonNull Label label)
label
- a label