Module jakarta.mail

Class FlagTerm

java.lang.Object
jakarta.mail.search.SearchTerm
jakarta.mail.search.FlagTerm
All Implemented Interfaces:
Serializable

public final class FlagTerm extends SearchTerm
This class implements comparisons for Message Flags.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Flags
    Flags object containing the flags to test.
    private static final long
     
    private boolean
    Indicates whether to test for the presence or absence of the specified Flag.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FlagTerm(Flags flags, boolean set)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Equality comparison.
    Return the Flags to test.
    boolean
    Return true if testing whether the flags are set.
    int
    Compute a hashCode for this object.
    boolean
    The comparison method.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • set

      private boolean set
      Indicates whether to test for the presence or absence of the specified Flag. If true, then test whether all the specified flags are present, else test whether all the specified flags are absent.
    • flags

      private Flags flags
      Flags object containing the flags to test.
    • serialVersionUID

      private static final long serialVersionUID
      See Also:
  • Constructor Details

    • FlagTerm

      public FlagTerm(Flags flags, boolean set)
      Constructor.
      Parameters:
      flags - Flags object containing the flags to check for
      set - the flag setting to check for
  • Method Details

    • getFlags

      public Flags getFlags()
      Return the Flags to test.
      Returns:
      the flags
    • getTestSet

      public boolean getTestSet()
      Return true if testing whether the flags are set.
      Returns:
      true if testing whether the flags are set
    • match

      public boolean match(Message msg)
      The comparison method.
      Specified by:
      match in class SearchTerm
      Parameters:
      msg - The flag comparison is applied to this Message
      Returns:
      true if the comparson succeeds, otherwise false.
    • equals

      public boolean equals(Object obj)
      Equality comparison.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Compute a hashCode for this object.
      Overrides:
      hashCode in class Object