Class Recorder

  • Direct Known Subclasses:
    NoopRecorder

    @NotThreadSafe
    public class Recorder
    extends java.lang.Object
    A tool for recording information, which can be used to record the process of execution.
    • Constructor Summary

      Constructors 
      Constructor Description
      Recorder()
      Constructs a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Recorder noopRecorder()
      Gets a NoopRecorder that does not actually record anything.
      void record​(java.lang.String message)
      Records a message.
      void record​(java.lang.String format, java.lang.Object... arguments)
      Records a message with a format template and arguments.
      java.util.List<java.lang.String> takeRecords()
      Gets and clears the records recorded so far.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Recorder

        public Recorder()
        Constructs a new instance.
    • Method Detail

      • record

        public void record​(java.lang.String message)
        Records a message.
        Parameters:
        message - message
      • record

        public void record​(java.lang.String format,
                           java.lang.Object... arguments)
        Records a message with a format template and arguments.
        Parameters:
        format - the message format string
        arguments - the message string to be recorded
      • takeRecords

        public java.util.List<java.lang.String> takeRecords()
        Gets and clears the records recorded so far. After this, the recorder is empty.
        Returns:
        the records
      • noopRecorder

        public static Recorder noopRecorder()
        Gets a NoopRecorder that does not actually record anything.
        Returns:
        a NoopRecorder instance