コード例 #1
0
 protected Bundle makeAltBundle(Bundle bundle) {
   ListBundleFormat format = new ListBundleFormat();
   Bundle alt = new ListBundle(format);
   for (int i = 0; i < columns.length; i++) {
     BundleField field = format.getField(columns[i]);
     alt.setValue(field, bundle.getValue(bundle.getFormat().getField(columns[i])));
   }
   return alt;
 }
コード例 #2
0
ファイル: FieldValueList.java プロジェクト: jhorwit2/hydra
 public boolean updateBundleWithMapAppend(Bundle bundle) {
   for (FieldValue fv : list) {
     ValueObject oldValue = bundle.getValue(fv.field);
     ValueMap newValue;
     if (oldValue == null) {
       newValue = ValueFactory.createMap();
     } else if (oldValue instanceof ValueMap) {
       newValue = (ValueMap) oldValue;
     } else {
       newValue = ValueFactory.createMap();
       newValue.put(oldValue.asString().asNative(), oldValue);
     }
     newValue.put(fv.value.asString().asNative(), fv.value);
     bundle.setValue(fv.field, newValue);
   }
   return !list.isEmpty();
 }
コード例 #3
0
ファイル: FieldValueList.java プロジェクト: jhorwit2/hydra
 public boolean updateBundleWithListAppend(Bundle bundle) {
   for (FieldValue fv : list) {
     ValueObject oldValue = bundle.getValue(fv.field);
     ValueArray newValue;
     if (oldValue == null) {
       newValue = ValueFactory.createArray(1);
     } else if (oldValue instanceof ValueArray) {
       newValue = (ValueArray) oldValue;
     } else {
       newValue = ValueFactory.createArray(2);
       newValue.add(oldValue);
     }
     newValue.add(fv.value);
     bundle.setValue(fv.field, newValue);
   }
   return !list.isEmpty();
 }
コード例 #4
0
 protected void mergeBundles(Bundle orig, Bundle nBundle) {
   for (BundleField bf : nBundle) {
     orig.setValue(orig.getFormat().getField(bf.getName()), nBundle.getValue(bf));
   }
 }