for (IFilterFunction f : filters) {
if (f instanceof NameFilter) {
NameFilter nf = (NameFilter) f;
List<String> expressions = nf.getFilterExpression();
expressions.add(0, nf.getHierarchy().getUniqueName());
ThinFilter tf = new ThinFilter(FilterFlavour.Name, FilterOperator.EQUALS, FilterFunction.Filter, expressions);
tfs.add(tf);
}
if (f instanceof NameLikeFilter) {
NameLikeFilter nf = (NameLikeFilter) f;
List<String> expressions = nf.getFilterExpression();
expressions.add(0, nf.getHierarchy().getUniqueName());
ThinFilter tf = new ThinFilter(FilterFlavour.NameLike, FilterOperator.LIKE, FilterFunction.Filter, expressions);
tfs.add(tf);
}
if (f instanceof GenericFilter) {
GenericFilter nf = (GenericFilter) f;
List<String> expressions = new ArrayList<String>();
expressions.add(nf.getFilterExpression());
ThinFilter tf = new ThinFilter(FilterFlavour.Generic, null, FilterFunction.Filter, expressions);
tfs.add(tf);
}
if (f instanceof NFilter) {
NFilter nf = (NFilter) f;
List<String> expressions = new ArrayList<String>();
expressions.add(Integer.toString(nf.getN()));
if (nf.getFilterExpression() != null) {
expressions.add(nf.getFilterExpression());
}
FilterFunction type = FilterFunction.valueOf(nf.getFunctionType().toString());
ThinFilter tf = new ThinFilter(FilterFlavour.N, null, type, expressions);
tfs.add(tf);
}
}
return tfs;
}