ImapQueryBuilder

Inheritance: java.lang.Object, com.aspose.email.MailQueryBuilder

public final class ImapQueryBuilder extends MailQueryBuilder

Represents the builder of search expression that used by IMAP protocol.

Constructors

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

Methods

Method Description
getMessageSize() Gets messages with an specified size.
getUniqueId() Unique identifier
getESearchParameters() Gets or sets ESEARCH Parameters This method works only if server supports ESEARCH extension.
setESearchParameters(ESearchOptions value) Gets or sets ESEARCH Parameters This method works only if server supports ESEARCH extension.
getModSeq() Modification sequence
hasFlags(ImapMessageFlags flags) Search messages with the specified flags.
hasNoFlags(ImapMessageFlags flags) Search messages with the unspecified flags.
hasHeader(String fieldName, String fieldValue) Search messages that have a header with the specified field-name and that contains the specified string in the text of the header (what comes after the colon).
customSearch(String fieldValue) Search messages according to extended server search syntax.

ImapQueryBuilder(Charset defaultEncoding)

public ImapQueryBuilder(Charset defaultEncoding)

Initializes a new instance of the ImapQueryBuilder class.

Parameters:

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

ImapQueryBuilder()

public ImapQueryBuilder()

Initializes a new instance of the ImapQueryBuilder class.

getMessageSize()

public final IntComparisonField getMessageSize()

Gets messages with an specified size.

Value: The IntComparisonField that represents a message size.

Returns: IntComparisonField

getUniqueId()

public final SequenceSetField getUniqueId()

Unique identifier

Returns: SequenceSetField

getESearchParameters()

public final ESearchOptions getESearchParameters()

Gets or sets ESEARCH Parameters This method works only if server supports ESEARCH extension. Please, read more https://tools.ietf.org/html/rfc4315

Returns: ESearchOptions

setESearchParameters(ESearchOptions value)

public final void setESearchParameters(ESearchOptions value)

Gets or sets ESEARCH Parameters This method works only if server supports ESEARCH extension. Please, read more https://tools.ietf.org/html/rfc4315

Parameters:

Parameter Type Description
value ESearchOptions

getModSeq()

public final ModificationSequenceField getModSeq()

Modification sequence

Returns: ModificationSequenceField

hasFlags(ImapMessageFlags flags)

public final MailQuery hasFlags(ImapMessageFlags flags)

Search messages with the specified flags.

Parameters:

Parameter Type Description
flags ImapMessageFlags The flags.

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

hasNoFlags(ImapMessageFlags flags)

public final MailQuery hasNoFlags(ImapMessageFlags flags)

Search messages with the unspecified flags.

Parameters:

Parameter Type Description
flags ImapMessageFlags The flags.

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

hasHeader(String fieldName, String fieldValue)

public final MailQuery hasHeader(String fieldName, String fieldValue)

Search messages that have a header with the specified field-name and that contains the specified string in the text of the header (what comes after the colon). If the string to search is zero-length, this matches all messages that have a header line with the specified field-name regardless of the contents.

Parameters:

Parameter Type Description
fieldName java.lang.String Name of the field.
fieldValue java.lang.String The field value.

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

customSearch(String fieldValue)

public final MailQuery customSearch(String fieldValue)

Search messages according to extended server search syntax.

Parameters:

Parameter Type Description
fieldValue java.lang.String The field value.

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