mirror of https://github.com/tasks/tasks
Remove TagMetadata, TagMemberMetadata
parent
387f871f86
commit
ac24473b2e
@ -1,95 +0,0 @@
|
|||||||
package com.todoroo.astrid.data;
|
|
||||||
|
|
||||||
import android.content.ContentValues;
|
|
||||||
|
|
||||||
import com.todoroo.andlib.data.AbstractModel;
|
|
||||||
import com.todoroo.andlib.data.Property;
|
|
||||||
import com.todoroo.andlib.data.Property.LongProperty;
|
|
||||||
import com.todoroo.andlib.data.Property.StringProperty;
|
|
||||||
import com.todoroo.andlib.data.Table;
|
|
||||||
import com.todoroo.andlib.data.TodorooCursor;
|
|
||||||
|
|
||||||
public class TagMetadata extends AbstractModel {
|
|
||||||
|
|
||||||
public static final Table TABLE = new Table("tag_metadata", TagMetadata.class);
|
|
||||||
|
|
||||||
// --- properties
|
|
||||||
|
|
||||||
/** ID */
|
|
||||||
public static final LongProperty ID = new LongProperty(
|
|
||||||
TABLE, ID_PROPERTY_NAME);
|
|
||||||
|
|
||||||
/** Tag local id */
|
|
||||||
public static final LongProperty TAG_ID = new LongProperty(
|
|
||||||
TABLE, "tag_id");
|
|
||||||
|
|
||||||
/** Tag uuid */
|
|
||||||
public static final StringProperty TAG_UUID = new StringProperty(
|
|
||||||
TABLE, "tag_uuid");
|
|
||||||
|
|
||||||
/** Metadata Key */
|
|
||||||
public static final StringProperty KEY = new StringProperty(
|
|
||||||
TABLE, "key");
|
|
||||||
|
|
||||||
/** Metadata Text Value Column 1 */
|
|
||||||
public static final StringProperty VALUE1 = new StringProperty(
|
|
||||||
TABLE, "value");
|
|
||||||
|
|
||||||
/** Unixtime metadata was deleted/tombstoned */
|
|
||||||
public static final LongProperty DELETION_DATE = new LongProperty(
|
|
||||||
TABLE, "deleted");
|
|
||||||
|
|
||||||
/** List of all properties for this model */
|
|
||||||
public static final Property<?>[] PROPERTIES = generateProperties(TagMetadata.class);
|
|
||||||
|
|
||||||
|
|
||||||
/** Default values container */
|
|
||||||
private static final ContentValues defaultValues = new ContentValues();
|
|
||||||
|
|
||||||
static {
|
|
||||||
defaultValues.put(DELETION_DATE.name, 0L);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ContentValues getDefaultValues() {
|
|
||||||
return defaultValues;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TagMetadata() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public TagMetadata(TodorooCursor<TagMetadata> cursor) {
|
|
||||||
this();
|
|
||||||
readPropertiesFromCursor(cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void readFromCursor(TodorooCursor<TagMetadata> cursor) {
|
|
||||||
super.readPropertiesFromCursor(cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getId() {
|
|
||||||
return getIdHelper(ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- parcelable helpers
|
|
||||||
|
|
||||||
private static final Creator<TagMetadata> CREATOR = new ModelCreator<>(TagMetadata.class);
|
|
||||||
|
|
||||||
public void setKey(String key) {
|
|
||||||
setValue(KEY, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTagUUID(String tagUuid) {
|
|
||||||
setValue(TAG_UUID, tagUuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTagID(Long tagId) {
|
|
||||||
setValue(TAG_ID, tagId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeletionDate(Long deletionDate) {
|
|
||||||
setValue(DELETION_DATE, deletionDate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.todoroo.astrid.tags;
|
|
||||||
|
|
||||||
import com.todoroo.andlib.data.Property.StringProperty;
|
|
||||||
import com.todoroo.astrid.data.TagMetadata;
|
|
||||||
|
|
||||||
public class TagMemberMetadata {
|
|
||||||
|
|
||||||
public static final String KEY = "tag-members"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
public static final StringProperty USER_UUID = new StringProperty(
|
|
||||||
TagMetadata.TABLE, TagMetadata.VALUE1.name);
|
|
||||||
|
|
||||||
public static TagMetadata newMemberMetadata(long tagId, String tagUuid, String userUuid) {
|
|
||||||
TagMetadata m = new TagMetadata();
|
|
||||||
m.setKey(KEY);
|
|
||||||
m.setTagID(tagId);
|
|
||||||
m.setTagUUID(tagUuid);
|
|
||||||
m.setValue(USER_UUID, userUuid);
|
|
||||||
m.setDeletionDate(0L);
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue