com.hurence.logisland.record.Record.getAllFields()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(147)

本文整理了Java中com.hurence.logisland.record.Record.getAllFields方法的一些代码示例,展示了Record.getAllFields的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.getAllFields方法的具体详情如下:
包路径:com.hurence.logisland.record.Record
类名称:Record
方法名:getAllFields

Record.getAllFields介绍

暂无

代码示例

代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin

@Override
public Collection<Record> process(ProcessContext context, Collection<Record> records) {
  try {
    List<String> fieldsToRemove = Lists.newArrayList(
        context.getPropertyValue(FIELDS_TO_REMOVE).asString().split(","));
    for (Record record : records) {
      new ArrayList<>(record.getAllFields()).forEach(field -> {
        String fieldName = field.getName();
        if (fieldsToRemove.contains(fieldName)) {
          record.removeField(fieldName);
        }
      });
    }
  } catch (Exception ex) {
    logger.warn("issue while trying to remove field list {} :  {}",
        context.getPropertyValue(FIELDS_TO_REMOVE).asString(),
        ex.toString());
  }
  return records;
}

代码示例来源:origin: com.hurence.logisland/logisland-solr-client-service-api

public SolrInputDocument toSolrInputDocument(Record record, String uniqueKey) {
  SolrInputDocument document = createNewSolrInputDocument();
  document.addField(uniqueKey, record.getId());
  for (Field field : record.getAllFields()) {
    if (field.isReserved()) {
      continue;
    }
    document.addField(field.getName(), field.getRawValue());
  }
  return document;
}

代码示例来源:origin: com.hurence.logisland/logisland-common-processors-plugin

List<Field> leafFields = rootRecord.getAllFields().stream()
    .filter(field -> field.getType().equals(FieldType.RECORD) &&
        !field.getName().equals(FieldDictionary.RECORD_TYPE) &&
    .collect(Collectors.toList());
List<Field> rootFields = rootRecord.getAllFields().stream()
    .filter(field -> !field.getType().equals(FieldType.RECORD))
    .collect(Collectors.toList());

相关文章