Beispiel #1
0
  public DbRecordRequest withConditionallyUpdateFields(RecordStruct source, String... pairs) {
    for (int i = 0; i < (pairs.length - 1); i += 2) {
      if (source.hasField(pairs[i])) this.withUpdateField(pairs[i + 1], source.getField(pairs[i]));
    }

    return this;
  }
Beispiel #2
0
  public DbRecordRequest withConditionallySetList(RecordStruct source, String sname, String dname) {
    if (!source.hasField(sname)) return this;

    this.sets.addItem(
        new RecordStruct()
            .withField("Field", dname)
            .withField("Values", source.getFieldAsList(sname)));

    return this;
  }