mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
927 B
Java
35 lines
927 B
Java
package com.todoroo.astrid.api;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import com.todoroo.andlib.utility.AndroidUtilities;
|
|
import com.todoroo.astrid.common.SyncProvider;
|
|
import com.todoroo.astrid.model.Metadata;
|
|
import com.todoroo.astrid.model.Task;
|
|
|
|
/**
|
|
* Container class for transmitting tasks and including local and remote
|
|
* metadata. Synchronization Providers can subclass this class if desired.
|
|
*
|
|
* @see {@link SyncProvider}
|
|
* @author Tim Su <tim@todoroo.com>
|
|
*
|
|
*/
|
|
public class TaskContainer {
|
|
public Task task;
|
|
public ArrayList<Metadata> metadata;
|
|
|
|
/**
|
|
* Check if the metadata contains anything with the given key
|
|
* @param key
|
|
* @return first match. or null
|
|
*/
|
|
public Metadata findMetadata(String key) {
|
|
for(Metadata item : metadata) {
|
|
if(AndroidUtilities.equals(key, item.getValue(Metadata.KEY)))
|
|
return item;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
} |