org.apache.james.mailboxmanager.util
Class MessageResultUtils

java.lang.Object
  extended by org.apache.james.mailboxmanager.util.MessageResultUtils

public class MessageResultUtils
extends java.lang.Object


Constructor Summary
MessageResultUtils()
           
 
Method Summary
static java.util.List getAll(java.util.Iterator iterator)
          Gets all header lines.
static java.util.List getMatching(java.util.Collection names, java.util.Iterator iterator)
          Gets header lines whose header names matches (ignoring case) any of those given.
static java.util.List getMatching(java.lang.String[] names, java.util.Iterator iterator)
          Gets header lines whose header names matches (ignoring case) any of those given.
static MessageResult.Header getMatching(java.lang.String name, java.util.Iterator iterator)
          Gets a header matching the given name.
static java.util.List getNotMatching(java.util.Collection names, java.util.Iterator iterator)
          Gets header lines whose header names matches (ignoring case) any of those given.
static java.util.List getNotMatching(java.lang.String[] names, java.util.Iterator iterator)
          Gets header lines whose header name fails to match (ignoring case) all of the given names.
static boolean isBodyContentIncluded(MessageResult message)
          Is MessageResult.FetchGroup.BODY_CONTENT included in these results?
static boolean isFlagsIncluded(MessageResult message)
          Is MessageResult.FetchGroup.FLAGS included in these results?
static boolean isFullContentIncluded(MessageResult message)
          Is MessageResult.FetchGroup.FULL_CONTENT included in these results?
static boolean isHeadersIncluded(MessageResult message)
          Is MessageResult.FetchGroup.HEADERS included in these results?
static boolean isIncluded(MessageResult message, int datum)
          Is the given datum included in these results?
static boolean isInternalDateIncluded(MessageResult message)
          Is MessageResult.FetchGroup.INTERNAL_DATE included in these results?
static boolean isSizeIncluded(MessageResult message)
          Is MessageResult.FetchGroup.SIZE included in these results?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageResultUtils

public MessageResultUtils()
Method Detail

getAll

public static java.util.List getAll(java.util.Iterator iterator)
Gets all header lines.

Parameters:
iterator - MessageResult.Header Iterator
Returns:
List of MessageResult.Header's, in their natural order
Throws:
javax.mail.MessagingException

getMatching

public static java.util.List getMatching(java.lang.String[] names,
                                         java.util.Iterator iterator)
                                  throws javax.mail.MessagingException
Gets header lines whose header names matches (ignoring case) any of those given.

Parameters:
names - header names to be matched, not null
iterator - MessageResult.Header Iterator
Returns:
List of MessageResult.Header's, in their natural order
Throws:
javax.mail.MessagingException

getMatching

public static java.util.List getMatching(java.util.Collection names,
                                         java.util.Iterator iterator)
                                  throws javax.mail.MessagingException
Gets header lines whose header names matches (ignoring case) any of those given.

Parameters:
names - header names to be matched, not null
iterator - MessageResult.Header Iterator
Returns:
List of MessageResult.Header's, in their natural order
Throws:
javax.mail.MessagingException

getNotMatching

public static java.util.List getNotMatching(java.util.Collection names,
                                            java.util.Iterator iterator)
                                     throws javax.mail.MessagingException
Gets header lines whose header names matches (ignoring case) any of those given.

Parameters:
names - header names to be matched, not null
iterator - MessageResult.Header Iterator
Returns:
List of MessageResult.Header's, in their natural order
Throws:
javax.mail.MessagingException

getMatching

public static MessageResult.Header getMatching(java.lang.String name,
                                               java.util.Iterator iterator)
                                        throws javax.mail.MessagingException
Gets a header matching the given name. The matching is case-insensitive.

Parameters:
name - name to be matched, not null
iterator - Iterator of MessageResult.Header's, not null
Returns:
MessageResult.Header, or null if the header does not exist
Throws:
javax.mail.MessagingException

getNotMatching

public static java.util.List getNotMatching(java.lang.String[] names,
                                            java.util.Iterator iterator)
                                     throws javax.mail.MessagingException
Gets header lines whose header name fails to match (ignoring case) all of the given names.

Parameters:
names - header names, not null
iterator - MessageResult.Header Iterator
Returns:
List of @MessageResult.Header's, in their natural order
Throws:
javax.mail.MessagingException

isIncluded

public static boolean isIncluded(MessageResult message,
                                 int datum)
Is the given datum included in these results?

Parameters:
message - MessageResult, possibly null
datum - MessageResult datum constant
Returns:
true if MessageResult includes the given datum, false if MessageResult is null or does not contain this datum

isBodyContentIncluded

public static boolean isBodyContentIncluded(MessageResult message)
Is MessageResult.FetchGroup.BODY_CONTENT included in these results?

Parameters:
message - MessageResult, possibly null
Returns:
true if MessageResult includes BODY_CONTENT, false if MessageResult is null or does not contain BODY_CONTENT
See Also:
isIncluded(MessageResult, int)

isFlagsIncluded

public static boolean isFlagsIncluded(MessageResult message)
Is MessageResult.FetchGroup.FLAGS included in these results?

Parameters:
message - MessageResult, possibly null
Returns:
true if MessageResult includes FLAGS, false if MessageResult is null or does not contain FLAGS
See Also:
isIncluded(MessageResult, int)

isFullContentIncluded

public static boolean isFullContentIncluded(MessageResult message)
Is MessageResult.FetchGroup.FULL_CONTENT included in these results?

Parameters:
message - MessageResult, possibly null
Returns:
true if MessageResult includes FULL_CONTENT, false if MessageResult is null or does not contain FULL_CONTENT
See Also:
isIncluded(MessageResult, int)

isHeadersIncluded

public static boolean isHeadersIncluded(MessageResult message)
Is MessageResult.FetchGroup.HEADERS included in these results?

Parameters:
message - MessageResult, possibly null
Returns:
true if MessageResult includes HEADERS, false if MessageResult is null or does not contain HEADERS
See Also:
isIncluded(MessageResult, int)

isInternalDateIncluded

public static boolean isInternalDateIncluded(MessageResult message)
Is MessageResult.FetchGroup.INTERNAL_DATE included in these results?

Parameters:
message - MessageResult, possibly null
Returns:
true if MessageResult includes INTERNAL_DATE, false if MessageResult is null or does not contain INTERNAL_DATE
See Also:
isIncluded(MessageResult, int)

isSizeIncluded

public static boolean isSizeIncluded(MessageResult message)
Is MessageResult.FetchGroup.SIZE included in these results?

Parameters:
message - MessageResult, possibly null
Returns:
true if MessageResult includes SIZE, false if MessageResult is null or does not contain SIZE
See Also:
isIncluded(MessageResult, int)


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.