Exemplo n.º 1
0
  public Metadata encodeMetadata() {
    Metadata meta = new Metadata();
    meta.put(FN_START, mStart.getDateTimePartString(false));
    if (mHasEnd) meta.put(FN_END, mEnd.getDateTimePartString(false));
    else meta.put(FN_DURATION, mDuration);

    return meta;
  }
Exemplo n.º 2
0
 private static String getEncodedMetadata(ScheduledTask task) {
   boolean hasProperties = false;
   Metadata metadata = new Metadata();
   Set<String> keys = task.getPropertyNames();
   for (String key : keys) {
     hasProperties = true;
     metadata.put(key, task.getProperty(key));
   }
   if (!hasProperties) {
     return null;
   }
   return metadata.toString();
 }