add new features

This commit is contained in:
hlq07 2018-05-27 01:11:16 +08:00
parent 62b2ad15b8
commit ce19ac0261
2 changed files with 27 additions and 6 deletions

View File

@ -42,9 +42,9 @@ public class TodoItem {
/**
* Value of a type of TodoItem indicating the "others" type.
* <p>
*
* required string properties: "type"(birth day, marriage day), "title", "description"
* <p>
*
* note: repeat every year
*/
public static final int ANNIVERSARY = 5;
@ -59,6 +59,14 @@ public class TodoItem {
*/
public static final int COURSE = 6;
/**
* Value of a type of TodoItem indicating the "others" type.
* <p>
* required string properties: "title", "location", "company", "quarter", "description"
* <p>
* note: the bgn and end should consist with the the first course time
*/
public static final int INTERVIEW = 7;
/**
@ -92,9 +100,9 @@ public class TodoItem {
/**
* Value of a name of possible string-type property index.
* <p>
* The corresponding value of stringProperties is formatted: "parent", "children";
* <p>
*
* The corresponding value of stringProperties is formatted: "parent", "child".
*
* If the instance have no {@code COMPOSITE}, then the corresponding value should be assumed as "parent".
*/
public static final String COMPOSITE = "composite";

View File

@ -51,7 +51,11 @@ public class TodoItemFactory {
}
public TodoItemFactory stringProperties(String index, String value) {
mStringProperties.put(index, value);
if (value != null) {
mStringProperties.put(index, value);
} else {
mStringProperties.remove(index);
}
return this;
}
@ -78,6 +82,15 @@ public class TodoItemFactory {
}
public TodoItemFactory copy(@NotNull TodoItem item) {
beginTime(item.getBgn());
endTime(item.getEnd());
stringProperties(item.getStringPropertiesMap());
type(item.getType());
personnel(Arrays.asList(item.getPersonnel()));
return this;
}
TodoItem buildId(long mId) {
if (mBgn == null) {
throw new IllegalStateException("beginTime method is never invoked");