Class PoolLogger.Builder

  • Enclosing class:
    PoolLogger

    public static final class PoolLogger.Builder
    extends Object
    A builder for PoolLogger objects.
    Author:
    Rob Spoor
    • Method Detail

      • withLoggerName

        public PoolLogger.Builder withLoggerName​(String loggerName)
        Sets the name of the logger to use. The default is the name of the Pool class.
        Parameters:
        loggerName - The name of the logger to use.
        Returns:
        This builder.
        Throws:
        NullPointerException - If the given logger name is null.
      • withLoggerClass

        public PoolLogger.Builder withLoggerClass​(Class<?> loggerClass)
        Sets the name of the logger to use. This method is shorthand for calling withLoggerName(String) with the given class' fully qualified name.
        Parameters:
        loggerClass - The class to use for the name of the logger to use.
        Returns:
        This builder.
        Throws:
        NullPointerException - If the given logger class is null.
      • withMessagePrefix

        public PoolLogger.Builder withMessagePrefix​(String messagePrefix)
        Sets the message prefix to use. This is prepended to each logged message. The default is no prefix.
        Parameters:
        messagePrefix - The message prefix to use.
        Returns:
        This builder.
        Throws:
        NullPointerException - If the given message prefix is null.
      • withObjectPrefix

        public PoolLogger.Builder withObjectPrefix​(String objectPrefix)
        Sets the object prefix to use. This is prepended to object ids in each logged message. The default is object-.
        Parameters:
        objectPrefix - The object prefix to use.
        Returns:
        This builder.
        Throws:
        NullPointerException - If the given object prefix is null.