public Record convertFields(Record publication) { for (String fieldName : fieldMap.keySet()) { String md = null; if (fieldMap != null) { md = this.fieldMap.get(fieldName); } if (StringUtils.isBlank(md)) { continue; } else { md = md.trim(); } if (publication.isMutable()) { List<Value> values = publication.getValues(fieldName); publication.makeMutable().removeField(fieldName); publication.makeMutable().addField(md, values); } } return publication; } }
public Record convertFields(Record publication) { for (String fieldName : fieldMap.keySet()) { String md = null; if (fieldMap != null) { md = this.fieldMap.get(fieldName); } if (StringUtils.isBlank(md)) { continue; } else { md = md.trim(); } if (publication.isMutable()) { List<Value> values = publication.getValues(fieldName); publication.makeMutable().removeField(fieldName); publication.makeMutable().addField(md, values); } } return publication; }
public Record convertFields(Record publication) { for (String fieldName : fieldMap.keySet()) { String md = null; if (fieldMap != null) { md = this.fieldMap.get(fieldName); } if (StringUtils.isBlank(md)) { continue; } else { md = md.trim(); } if (publication.isMutable()) { List<Value> values = publication.getValues(fieldName); publication.makeMutable().removeField(fieldName); publication.makeMutable().addField(md, values); } } return publication; }
public Record convertFields(Record publication) { for (String fieldName : fieldMap.keySet()) { String md = null; if (fieldMap != null) { md = this.fieldMap.get(fieldName); } if (StringUtils.isBlank(md)) { continue; } else { md = md.trim(); } if (publication.isMutable()) { List<Value> values = publication.getValues(fieldName); publication.makeMutable().removeField(fieldName); publication.makeMutable().addField(md, values); } } return publication; }
public Record convertFields(Record publication) { for (String fieldName : fieldMap.keySet()) { String md = null; if (fieldMap != null) { md = this.fieldMap.get(fieldName); } if (StringUtils.isBlank(md)) { continue; } else { md = md.trim(); } if (publication.isMutable()) { List<Value> values = publication.getValues(fieldName); publication.makeMutable().removeField(fieldName); publication.makeMutable().addField(md, values); } } return publication; }
public List<Record> convertFields(List<Record> recordSet, Map<String, String> fieldMap) { List<Record> result = new ArrayList<Record>(); for (Record publication : recordSet) { for (String fieldName : fieldMap.keySet()) { String md = null; if (fieldMap != null) { md = fieldMap.get(fieldName); } if (StringUtils.isBlank(md)) { continue; } else { md = md.trim(); } if (publication.isMutable()) { List<Value> values = publication.getValues(md); publication.makeMutable().removeField(md); publication.makeMutable().addField(fieldName, values); } } result.add(publication); } return result; } }
/** * Executes this {@link ProcessingStep}. * <br> * <br> * For each {@link Record} contained in the {@link RecordSet} * given as argument, converts it to {@link MutableRecord} calls * {@link AbstractModifier#modify}, and adds the modified record * in the return result. * * @see ProcessingStep#execute * * @param recs The initial set of records * @return A {@link RecordSet} containing the modified records */ @Override public RecordSet execute(RecordSet recs) { RecordSet ret = new RecordSet(); Record modified_record; for (Record rec : recs) { modified_record = this.modify(rec.makeMutable()); ret.addRecord(modified_record); } return recs; }
record.makeMutable().addValue( SubmissionLookupService.PROVIDER_NAME_FIELD, new StringValue(providerName)); recordSet.addRecord(rec); if (rec.isMutable()) { rec.makeMutable().addValue( SubmissionLookupService.PROVIDER_NAME_FIELD, new StringValue(providerName));