Click or drag to resize
FilterBuilder Class
The FilterBuilder class is a utility that is intended to be used to create filters for eSales queries. The methods in this class are all static and return some kind of Filter limiting your search.
Examples
Working with the FilterBuilder
// create some simple attribute filters
Filter a = FilterBuilder.Attribute("artist", "Presley");
Filter b = FilterBuilder.Attribute("song", "Jumpin' Jack Flash");     
Filter c = FilterBuilder.Attribute("description", "Rock nostalgia");

Console.WriteLine("Created some attribute filters:"); 
Console.WriteLine(a);
Console.WriteLine(b);  
Console.WriteLine(c);

Console.WriteLine();

// lets combine them
Filter kingOfRock = FilterBuilder.And(a, c);
Console.WriteLine(kingOfRock);
Filter classic = FilterBuilder.And(b, c);
Console.WriteLine(classic);
Filter justCool = FilterBuilder.Or(a, b);
Console.WriteLine(justCool);
Filter coolOldie = FilterBuilder.And(justCool, c); 
Console.WriteLine(coolOldie);

Console.WriteLine();

// lets add some more stuff into the mix
Filter lamers = FilterBuilder.Attribute("artist", "Sofarock");
lamers = FilterBuilder.Or(lamers, FilterBuilder.Attribute("artist", "amazonics"));
Filter noLamers = FilterBuilder.Not(lamers);
Console.WriteLine(noLamers);

// combine more than 2 filters at once by simply supplying them all
Filter theOriginal = FilterBuilder.And(classic, noLamers, c);
Console.WriteLine(theOriginal);
Inheritance Hierarchy
SystemObject
  Apptus.ESales.ConnectorFilterBuilder

Namespace:  Apptus.ESales.Connector
Assembly:  Apptus.Esales.ConnectorApi (in Apptus.Esales.ConnectorApi.dll) Version: 4.4.1
Syntax
C#
public static class FilterBuilder

The FilterBuilder type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAnd(Filter)
Create a new AND filter to match the intersection of results that each of the specified operands would return.
Public methodStatic memberAnd(Filter, Filter)
Create a new AND filter to match the intersection of results that f1 and f2 would return.
Public methodStatic memberAttribute(String, String)
Create a new ATTRIBUTE filter, limiting the result to products where all processed parts (after tokenization and normalization) of the specified value are present within the given attribute.
Public methodStatic memberAttribute(String, String)
Create a new ATTRIBUTE filter, limiting the result to products where all processed parts (after tokenization and normalization) of the specified value are present within the given attribute.
Public methodStatic memberEmpty
Returns a EMPTY filter representing no results.
Public methodStatic memberFromString(String)
Create a new filter, limiting the result to products inside the specified filter. Parentheses will be added if this filter is part of a composite filter.
Public methodStatic memberFromString(String, Boolean)
Create a new filter, limiting the result to products inside the specified filter.
Public methodStatic memberIncremental(String, String)
Create a new INCREMENTAL filter, limiting the result to products where all processed parts (after tokenization and normalization) of the specified value are present within the given attribute. The last value token matches if any attribute contains a value to which it is a prefix (after tokenization).
Public methodStatic memberIncremental(String, String)
Create a new INCREMENTAL filter, limiting the result to products where all processed parts (after tokenization and normalization) of the specified value are present within the given attribute. The last value token matches if any attribute contains a value to which it is a prefix (after tokenization).
Public methodStatic memberNot
Create a new NOT filter matching every result that the given operand doesn't match.
Public methodStatic memberOr(Filter)
Create a new OR filter to match the union of results that each of the specified operands would return.
Public methodStatic memberOr(Filter, Filter)
Create a new OR filter to match the union of the results that f1 and f2 would return.
Public methodStatic memberRange(String, String, String)
Create a new RANGE filter, limiting the result to values between from (inclusive)and to (exclusive), for the specified attribute.
Public methodStatic memberRange(String, String, String)
Create a new RANGE filter, limiting the result to values between from (inclusive)and to (exclusive), for the specified attribute.
Public methodStatic memberRange(String, String, String, Boolean, Boolean)
Create a new RANGE filter, limiting the result to values between from and to, for the specified attribute. Whether or not the bounds should be considered inclusive or exclusive is determined by the specified fromInc and toInc parameters.
Public methodStatic memberRange(String, String, String, Boolean, Boolean)
Create a new RANGE filter, limiting the result to values between from and to, for the specified attribute. Whether or not the bounds should be considered inclusive or exclusive is determined by the specified fromInc and toInc parameters.
Public methodStatic memberUniverse
Return a UNIVERSE filter representing all results.
Top
See Also