Converts a {@link ParaObject} to DynamoDB row.
@param <P> type of object
@param so an object
@param filter used to filter out fields on update.
@return a row representation of the given object.
348666
protected static <P extends ParaObject> Map<String, AttributeValue> toRow(P so, Class<? extends Annotation> filter) {
		HashMap<String, AttributeValue> row = new HashMap<>();
		if (so == null) {
			return row;
		}
		for (Map.Entry<String, Object> entry : ParaObjectUtils.getAnnotatedFields(so, filter).entrySet()) {
			Object value = entry.getValue();
			if (value != null && !StringUtils.isBlank(value.toString())) {
				row.put(entry.getKey(), new AttributeValue(value.toString()));
			}
		}
		if (so.getVersion() != null && so.getVersion() > 0) {
			row.put(Config._VERSION, new AttributeValue().withN(so.getVersion().toString()));
		} else {
			row.remove(Config._VERSION);
		}
		return row;
	}
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;
    }
361782
@Override
	public SqlFilterManager addSqlFilter(final SqlFilter filter) {
		if (filter == null) {
			throw new IllegalArgumentException("filter is null.");
		}
		filters.add(filter);
		return this;
	}
941765
private static List<Object> convertToList(ParameterBinding binding, Iterable<?> params) {
        return StreamSupport.stream(params.spliterator(), false).map(binding::toColumnValue).collect(Collectors.toList());
    }
452378
public static boolean typesMatch(ParaObject so) {
		return (so == null) ? false : so.getClass().equals(toClass(so.getType()));
	}
474579
@SuppressWarnings("unchecked")
	public Object toJdbc(final Object object, final Connection connection) {
		if (object == null) {
			return null;
		}
		for (@SuppressWarnings("rawtypes")
		BindParameterMapper parameterMapper : mappers) {
			if (parameterMapper.canAccept(object)) {
				return parameterMapper.toJdbc(object, connection, this);
			}
		}

		if (object instanceof Boolean || object instanceof Byte || object instanceof Short || object instanceof Integer
				|| object instanceof Long || object instanceof Float || object instanceof Double
				|| object instanceof BigDecimal || object instanceof String

				|| object instanceof byte[]

				|| object instanceof java.sql.Date || object instanceof java.sql.Time
				|| object instanceof java.sql.Timestamp || object instanceof java.sql.Array
				|| object instanceof java.sql.Ref || object instanceof java.sql.Blob || object instanceof java.sql.Clob
				|| object instanceof java.sql.SQLXML

				|| object instanceof java.sql.Struct) {
			return object;
		}

		for (@SuppressWarnings("rawtypes")
		BindParameterMapper parameterMapper : DEFAULT_MAPPERS) {
			if (parameterMapper.canAccept(object)) {
				return parameterMapper.toJdbc(object, connection, this);
			}
		}
		return object;
	}
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;
    }
940436
@SneakyThrows
    public Collection<GitObject> getObjectsInRepository(final TreeFilter filter) {
        val repository = this.gitInstance.getRepository();
        val head = repository.resolve(Constants.HEAD);

        try (val walk = new RevWalk(repository)) {
            val commit = walk.parseCommit(head);
            val tree = commit.getTree();
            try (val treeWalk = new TreeWalk(repository)) {
                treeWalk.addTree(tree);
                treeWalk.setRecursive(true);
                treeWalk.setFilter(filter);
                val list = new ArrayList<GitObject>();
                while (treeWalk.next()) {
                    val object = readObject(treeWalk);
                    list.add(object);
                }
                return list;
            }
        }
    }
729127
@Override
    public T filter(Filter<ArchivePath> filter) {
        return this.shallowCopy(filter).as(getActualClass());
    }
1365826
public static cmppolicy[] get_filtered(nitro_service service, String filter) throws Exception{
		cmppolicy obj = new cmppolicy();
		options option = new options();
		option.set_filter(filter);
		cmppolicy[] response = (cmppolicy[]) obj.getfiltered(service, option);
		return response;
	}
1078117
public static <T> T[] filter(T array[], Filter<T> filter){
        List<T> filteredList = new ArrayList<T>(array.length);
        for(T element: array){
            if(filter.select(element))
                filteredList.add(element);
        }
        @SuppressWarnings("unchecked")
        T filteredArray[] = (T[])Array.newInstance(array.getClass().getComponentType(), filteredList.size());
        return filteredList.toArray(filteredArray);
    }
422424
public void filterTable(String filter) {

        m_container.removeAllContainerFilters();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
            m_container.addContainerFilter(
                new Or(
                    new SimpleStringFilter(PROP_NAME, filter, true, false),
                    new SimpleStringFilter(PROP_DESCRIPTION, filter, true, false)));
        }
        if ((getValue() != null) & !((Set<CmsUUID>)getValue()).isEmpty()) {
            setCurrentPageFirstItemId(((Set<CmsUUID>)getValue()).iterator().next());
        }
    }
964572
@Override
    public Iterator<Object[]> getDataByFilter(DataProviderFilter dataFilter) {
        Preconditions.checkArgument(resource != null, "File resource cannot be null");
        logger.entering(dataFilter);
        Class<?> arrayType;
        JsonReader reader = null;
        try {
            reader = new JsonReader(getReader(resource));
            arrayType = Array.newInstance(resource.getCls(), 0).getClass();
            Gson myJson = new Gson();
            Object[] mappedData = myJson.fromJson(reader, arrayType);
            return prepareDataAsObjectArrayList(mappedData, dataFilter).iterator();
        } catch (Exception e) {
            throw new DataProviderException(e.getMessage(), e);
        } finally {
            IOUtils.closeQuietly(reader);
        }
    }
680501
public static <T> List<T> filter(Collection<T> c, Filter<T> filter){
        if(c.size()==0)
            return Collections.emptyList();

        List<T> filteredList = new ArrayList<T>(c.size());
        for(T element: c){
            if(filter.select(element))
                filteredList.add(element);
        }
        return filteredList;
    }
252342
public static Map<String,Map<String, String>> parseFilter(String filter) {
        return parseFilter(filter, true, DEFAULT_FILTER_KEY);
    }
166472
public TypedQuery<Long> count(Filter filter) {
        CriteriaQuery<Long> query = cb.createQuery(Long.class);
        Root<T> from = query.from(getEntityClass());

        if (filter != null) {
            Predicate where = new CriteriaMapper(from, cb).create(filter);
            query.where(where);
        }

        return getEntityManager().createQuery(query.select(cb.count(from)));
    }
389552
private <T> T privateMarshallIntoObject(
            AttributeTransformer.Parameters<T> parameters) {

        Class<T> clazz = parameters.getModelClass();
        Map<String, AttributeValue> values = untransformAttributes(parameters);

        final DynamoDBMapperTableModel<T> model = getTableModel(clazz, parameters.getMapperConfig());
        return model.unconvert(values);
    }