/** * Utility class to filter field types provided by a host. * * @param targetHost the fields target host * @param filters optional filters, can be null * @return filtered field types of the target host * @throws FormatException */ public static LinkedHashMap<String, FieldBaseTypes> getFilteredFieldTypes( final FieldsHost targetHost, final List<FieldsFilter> filters) throws FormatException { LinkedHashMap<String, FieldBaseTypes> fieldTypes; if (targetHost != null) { fieldTypes = new LinkedHashMap<>(targetHost.getFieldTypes()); } else { fieldTypes = new LinkedHashMap<>(); } if (filters != null) { for (final FieldsFilter f : filters) { f.filterKnownFields(fieldTypes); } } return fieldTypes; }
private void filter(final Event event) { for (final FieldsFilter f : filters) { f.filter(event); } }