com.mcdermottroe.exemplar.ui.cli
Class ConsoleFormatter

java.lang.Object
  extended by java.util.logging.Formatter
      extended by com.mcdermottroe.exemplar.ui.cli.ConsoleFormatter
All Implemented Interfaces:
Copyable<ConsoleFormatter>, Comparable<ConsoleFormatter>

public class ConsoleFormatter
extends Formatter
implements Comparable<ConsoleFormatter>, Copyable<ConsoleFormatter>

A Formatter for messages which are output to the console.

Since:
0.2

Constructor Summary
ConsoleFormatter()
           
 
Method Summary
 int compareTo(ConsoleFormatter other)
          Implement Comparable.compareTo(Object).
 boolean equals(Object o)
          
 String format(LogRecord record)
          Format a log record so that it can be sent to the console.
 ConsoleFormatter getCopy()
          Creates a deep copy of the current object and returns it.
 int hashCode()
          
 
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleFormatter

public ConsoleFormatter()
Method Detail

format

public String format(LogRecord record)
Format a log record so that it can be sent to the console.

Specified by:
format in class Formatter
Parameters:
record - The LogRecord to format for the console.
Returns:
A String suitable for the console.

compareTo

public int compareTo(ConsoleFormatter other)
Implement Comparable.compareTo(Object).

Specified by:
compareTo in interface Comparable<ConsoleFormatter>
Parameters:
other - The ConsoleFormatter to compare with.
Returns:
A result as defined by Comparable.compareTo(Object).

getCopy

public ConsoleFormatter getCopy()
Creates a deep copy of the current object and returns it.

Specified by:
getCopy in interface Copyable<ConsoleFormatter>
Returns:
A deep copy of the current object.

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object