Class MailHandler.TailNameFormatter

  • Enclosing class:
    MailHandler

    private static final class MailHandler.TailNameFormatter
    extends java.util.logging.Formatter
    Used for naming attachment file names and the main subject line.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String name
      The value used as the output.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TailNameFormatter​(java.lang.String name)
      Use the factory method instead of this constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Equals method.
      java.lang.String format​(java.util.logging.LogRecord record)  
      java.lang.String getTail​(java.util.logging.Handler h)  
      int hashCode()
      Hash code method.
      (package private) static java.util.logging.Formatter of​(java.lang.String name)
      Creates or gets a formatter from the given name.
      java.lang.String toString()  
      • Methods inherited from class java.util.logging.Formatter

        formatMessage, getHead
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        private final java.lang.String name
        The value used as the output.
    • Constructor Detail

      • TailNameFormatter

        private TailNameFormatter​(java.lang.String name)
        Use the factory method instead of this constructor.
        Parameters:
        name - any not null string.
    • Method Detail

      • of

        static java.util.logging.Formatter of​(java.lang.String name)
        Creates or gets a formatter from the given name. This method is used so class verification of assignments in MailHandler doesn't require loading this class which otherwise can occur when using the constructor. Default access to avoid generating extra class files.
        Parameters:
        name - any not null string.
        Returns:
        a formatter for that string.
        Since:
        JavaMail 1.5.6
      • format

        public final java.lang.String format​(java.util.logging.LogRecord record)
        Specified by:
        format in class java.util.logging.Formatter
      • getTail

        public final java.lang.String getTail​(java.util.logging.Handler h)
        Overrides:
        getTail in class java.util.logging.Formatter
      • equals

        public final boolean equals​(java.lang.Object o)
        Equals method.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - the other object.
        Returns:
        true if equal
        Since:
        JavaMail 1.4.4
      • hashCode

        public final int hashCode()
        Hash code method.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code.
        Since:
        JavaMail 1.4.4
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object