MailQueryBuilder

Inheritance: java.lang.Object

public class MailQueryBuilder

Represents the builder of search expression.


Note: By default, the result is the intersection (AND function) of all the messages that match those keys. To join keys by OR function, please, use Or() method of this class

Constructors

Constructor Description
MailQueryBuilder() Initializes a new instance of the MailQueryBuilder class.
MailQueryBuilder(Charset defaultEncoding) Initializes a new instance of the MailQueryBuilder class.

Methods

Method Description
getTo() Gets the field that allows to find messages that contain the specified string in the envelope structure’s TO field.
getText() Gets the field that allows to find the messages that contain the specified string in the headers (subject, from, to, cc) and body of the message.
getBcc() Gets the field that allows to find messages that contain the specified string in the envelope structure’s BCC field.
getBody() Gets the field that allows to find messages that contain the specified string in the body of the message.
getCc() Gets the field that allows to find messages that contain the specified string in the envelope structure’s CC field.
getFrom() Gets the field that allows to find messages that contain the specified string in the envelope structure’s FROM field.
getSubject() Gets the field that allows to find messages that contain the specified string in the envelope structure’s SUBJECT field.
getDefaultEncoding() Gets default encoding (charset) for query builder
getInternalDate() Gets the field that allows to find messages by internal date.
getSentDate() Gets the field that allows to find messages by sent date.
or(MailQuery query1, MailQuery query2) Search messages that match either search key.
getQuery() Gets the query.

MailQueryBuilder()

public MailQueryBuilder()

Initializes a new instance of the MailQueryBuilder class.

MailQueryBuilder(Charset defaultEncoding)

public MailQueryBuilder(Charset defaultEncoding)

Initializes a new instance of the MailQueryBuilder class.

Parameters:

Parameter Type Description
defaultEncoding java.nio.charset.Charset Contains default encoding (charset) for query builder.

getTo()

public final StringComparisonField getTo()

Gets the field that allows to find messages that contain the specified string in the envelope structure’s TO field.

Value: The DateComparisonField that represents TO search field.

Returns: StringComparisonField

getText()

public final StringComparisonField getText()

Gets the field that allows to find the messages that contain the specified string in the headers (subject, from, to, cc) and body of the message.

Value: The DateComparisonField that represents text header or body search fields.

Returns: StringComparisonField

getBcc()

public final StringComparisonField getBcc()

Gets the field that allows to find messages that contain the specified string in the envelope structure’s BCC field.

Value: The DateComparisonField that represents BCC search field.

Returns: StringComparisonField

getBody()

public final StringComparisonField getBody()

Gets the field that allows to find messages that contain the specified string in the body of the message.

Value: The DateComparisonField that represents body search field.

Returns: StringComparisonField

getCc()

public final StringComparisonField getCc()

Gets the field that allows to find messages that contain the specified string in the envelope structure’s CC field.

Value: The DateComparisonField that represents cc search field.

Returns: StringComparisonField

getFrom()

public final StringComparisonField getFrom()

Gets the field that allows to find messages that contain the specified string in the envelope structure’s FROM field.

Value: The DateComparisonField that represents from search field.

Returns: StringComparisonField

getSubject()

public final StringComparisonField getSubject()

Gets the field that allows to find messages that contain the specified string in the envelope structure’s SUBJECT field.

Value: The DateComparisonField that represents subject search field.

Returns: StringComparisonField

getDefaultEncoding()

public final Charset getDefaultEncoding()

Gets default encoding (charset) for query builder

Returns: java.nio.charset.Charset

getInternalDate()

public final DateComparisonField getInternalDate()

Gets the field that allows to find messages by internal date.

Value: The DateComparisonField that represents internal date search field.

Returns: DateComparisonField

getSentDate()

public final DateComparisonField getSentDate()

Gets the field that allows to find messages by sent date.

Value: The DateComparisonField that represents sent date search field.

Returns: DateComparisonField

or(MailQuery query1, MailQuery query2)

public MailQuery or(MailQuery query1, MailQuery query2)

Search messages that match either search key. Provides disjunction between two expressions (OR).

Parameters:

Parameter Type Description
query1 MailQuery The query1.
query2 MailQuery The query2.

Returns: MailQuery - MailQuery that represents search query (one searching criterion).

getQuery()

public MailQuery getQuery()

Gets the query.

Returns: MailQuery - MailQuery that represents search query.