Returns a list of `BeanSpec` for all fields including super class fields.

@param filter
a function to filter out fields that are not needed.
@return the fields spec list
177310
public List<BeanSpec> fields($.Predicate<Field> filter) {
        List<BeanSpec> retVal = new ArrayList<>();
        BeanSpec current = this;
        Class<?> rawType = rawType();
        if ($.isSimpleType(rawType)) {
            return C.list();
        }
        Type[] typeDeclarations = rawType.getTypeParameters();
        Map<String, Class> typeImplLookup = null;
        while (null != current && current.isNotObject()) {
            Type[] fieldTypeParams = null;
            Type[] classTypeParams;
            Map<String, Type> typeParamsMapping = new HashMap<>();
            for (Field field : current.rawType().getDeclaredFields()) {
                if (!filter.test(field)) {
                    continue;
                }
                Type fieldGenericType = field.getGenericType();
                if (fieldGenericType instanceof ParameterizedType) {
                    if (null == fieldTypeParams) {
                        fieldTypeParams = ((ParameterizedType) fieldGenericType).getActualTypeArguments();
                        if (fieldTypeParams != null && fieldTypeParams.length > 0) {
                            classTypeParams = current.rawType().getTypeParameters();
                            if (classTypeParams != null && classTypeParams.length > 0) {
                                List<Type> classTypeImpls = current.typeParams();
                                for (int i = 0; i < classTypeParams.length; ++i) {
                                    if (i >= classTypeImpls.size()) {
                                        break;
                                    }
                                    Type classTypeParam = classTypeParams[i];
                                    if (classTypeParam instanceof TypeVariable) {
                                        typeParamsMapping.put(((TypeVariable) classTypeParam).getName(), classTypeImpls.get(i));
                                    }
                                }
                            }
                        }
                    }
                    boolean updated = false;
                    if (!typeParamsMapping.isEmpty()) {
                        for (int i = 0; i < fieldTypeParams.length; ++i) {
                            Type typeArg = fieldTypeParams[i];
                            if (typeArg instanceof TypeVariable) {
                                String name = ((TypeVariable) typeArg).getName();
                                Type typeImpl = typeParamsMapping.get(name);
                                if (null != typeImpl && $.ne(typeImpl, typeArg)) {
                                    updated = true;
                                    fieldTypeParams[i] = typeImpl;
                                }
                            }
                        }
                    }
                    if (updated) {
                        fieldGenericType = new ParameterizedTypeImpl(fieldTypeParams, ((ParameterizedType) fieldGenericType).getOwnerType(), ((ParameterizedType) fieldGenericType).getRawType());
                    }
                    retVal.add(beanSpecOf(field, fieldGenericType));
                } else if (fieldGenericType instanceof TypeVariable) {
                    if (null == typeImplLookup) {
                        typeImplLookup = Generics.buildTypeParamImplLookup(this.rawType);
                        if (null != fieldTypeImplLookup) {
                            typeImplLookup.putAll(fieldTypeImplLookup);
                        }
                    }
                    TypeVariable fieldType = (TypeVariable) fieldGenericType;
                    Class clazz = typeImplLookup.get(fieldType.getName());
                    if (null != clazz) {
                        retVal.add(of(field, fieldGenericType, injector, typeImplLookup));
                    } else {
                        boolean added = false;
                        for (int i = typeDeclarations.length - 1; i >= 0; --i) {
                            if (typeDeclarations[i].equals(fieldGenericType)) {
                                fieldGenericType = current.typeParams().get(i);
                                retVal.add(of(field, fieldGenericType, injector, typeImplLookup));
                                added = true;
                                break;
                            }
                        }
                        if (!added) {
                            throw new InjectException("Cannot infer field type: " + field);
                        }
                    }
                } else if (fieldGenericType instanceof GenericArrayType) {
                    if (null == typeImplLookup) {
                        typeImplLookup = Generics.buildTypeParamImplLookup(this.rawType);
                    }
                    retVal.add(of(field, injector(), typeImplLookup));
                } else {
                    retVal.add(of(field, injector()));
                }
            }
            current = current.parent();
            if (null != current) {
                typeDeclarations = current.rawType.getTypeParameters();
            }
        }
        return retVal;
    }
822391
public static List<ModelAnnotation> buildAnnotationList(final Element element, final AnnotationFilter filter) {
		final List<ModelAnnotation> annotationList=new ArrayList<>();
		
		forEachAnnotations(element, filter, new AnnotationFoundListener() {

			@Override
			public void onAcceptAnnotation(Element executableMethod, String annotationClassName, Map<String, String> attributes) {
				ModelAnnotation annotation = new ModelAnnotation(annotationClassName, attributes);
				
				annotationList.add(annotation);
			}
		});
		
		return annotationList;
	}
564118
public List<MarcField> filterValue(Pattern pattern) {
        return marcFields.stream().map(field ->
                field.matchValue(pattern)).filter(Objects::nonNull).collect(Collectors.toList());
    }
1185633
@Override
    public List<CallDetailRecord> getCallDetailRecords(CallDetailRecordFilter filter) {

        final SqlSession session = sessions.openSession();

        try {
            final List<Map<String, Object>> results = session.selectList(namespace + "getCallDetailRecordByUsingFilters",
                    filter);
            final List<CallDetailRecord> cdrs = new ArrayList<CallDetailRecord>();

            if (results != null && !results.isEmpty()) {
                for (final Map<String, Object> result : results) {
                    cdrs.add(toCallDetailRecord(result));
                }
            }
            return cdrs;
        } finally {
            session.close();
        }
    }
57157
public static appfwfieldtype[] get_filtered(nitro_service service, String filter) throws Exception{
		appfwfieldtype obj = new appfwfieldtype();
		options option = new options();
		option.set_filter(filter);
		appfwfieldtype[] response = (appfwfieldtype[]) obj.getfiltered(service, option);
		return response;
	}
401918
@Override
  public SortedMap<String, Gauge> getGauges(MetricFilter filter) {
    return getSimplyNamedMetrics(Gauge.class, Optional.of(filter));
  }
504525
public List<String> getFilterParameters() {
        final List<String> parameters = new ArrayList<>();
        filterKeysToValues.forEach((filterKey, filterValues) -> {
            filterValues.forEach(filterValue -> {
                final String parameterString = String.format("%s:%s", filterKey, filterValue);
                parameters.add(parameterString);
            });
        });

        return parameters;
    }
482450
public static Set<String> getAttributeNames(
            final Class<?> classToInspect, final Predicate<Field> filter) {
        Set<String> allFields = new HashSet<>();
        getAllAttributes(classToInspect, allFields, FIELD_TO_NAME, filter);
        return allFields;
    }
98480
public List<WebAppFilterMapping> getFilterMappings(final String filterName) {
		final Set<WebAppFilterMapping> webAppFilterMappings = filterMappings
				.get(filterName);
		if (webAppFilterMappings == null) {
			return new ArrayList<>();
		}
		return new ArrayList<>(webAppFilterMappings);
	}
72400
public static List<Method> getPublicMethods(Class<?> clazz, Filter<Method> filter) {
		if (null == clazz) {
			return null;
		}

		final Method[] methods = getPublicMethods(clazz);
		List<Method> methodList;
		if (null != filter) {
			methodList = new ArrayList<>();
			for (Method method : methods) {
				if (filter.accept(method)) {
					methodList.add(method);
				}
			}
		} else {
			methodList = CollectionUtil.newArrayList(methods);
		}
		return methodList;
	}
378468
private FieldDoc[] fields(boolean filter, boolean enumConstants) {
        List<FieldDocImpl> fields = List.nil();
        for (Symbol sym : tsym.members().getSymbols(NON_RECURSIVE)) {
            if (sym != null && sym.kind == VAR) {
                VarSymbol s = (VarSymbol)sym;
                boolean isEnum = ((s.flags() & Flags.ENUM) != 0) &&
                                 !env.legacyDoclet;
                if (isEnum == enumConstants &&
                        (!filter || env.shouldDocument(s))) {
                    fields = fields.prepend(env.getFieldDoc(s));
                }
            }
        }
        return fields.toArray(new FieldDocImpl[fields.length()]);
    }
896848
@Override
	public M filter(BiPredicate<? super K, ? super V> filter) {
		MapBuilder<K, V, M> builder = builder();
		for (java.util.Map.Entry<K, V> entry : entrySet()) {
			if(filter.test(entry.getKey(), entry.getValue())) {
				builder.put(entry.getKey(), entry.getValue());
			}
		}
		return builder.build();
	}
890326
public static mps[] get_filtered(nitro_service service, String filter) throws Exception
	{
		mps obj = new mps();
		options option = new options();
		option.set_filter(filter);
		mps[] response = (mps[]) obj.getfiltered(service, option);
		return response;
	}
1305306
public static br[] get_filtered(nitro_service service, String filter) throws Exception
	{
		br obj = new br();
		options option = new options();
		option.set_filter(filter);
		br[] response = (br[]) obj.getfiltered(service, option);
		return response;
	}
248352
@Override
    public Iterable<T> findAll(EntityFilter<T> filter) {
        List<T> results = new ArrayList<>();
        for (T object : findAll()) {
            if (filter.accept(object)) {
                results.add(object);
            }
        }
        return results;
    }
172939
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
  public List<Filter> instanceTagNamesToFilters() {
    return tagsUtils.getAwsTagNames().map(Stream::of).orElseGet(Stream::empty)
        .map(tagNames -> new Tuple<>(tagNames, tagsUtils.getInstanceTags()))
        .flatMap(namesAndTags -> namesAndTags.getVal2()
            .stream()
            .filter(tag -> namesAndTags.getVal1().contains(tag.getKey())))
        .map(tag -> new Filter("tag:" + tag.getKey(), Collections.singletonList(tag.getValue())))
        .collect(Collectors.toList());
  }
778083
public Map<String, Object> getModuleFieldsFilters() {
        final Map<String, Object> params = new HashMap<String, Object>();

        for(final Filter filter: filters){
            params.putAll(filter.moduleFilterFields());
        }

        return params;
    }