Class AbstractLogEntry.Builder<R extends AbstractLogEntry,T extends AbstractLogEntry.Builder<R,T>>

java.lang.Object
io.helidon.webserver.accesslog.AbstractLogEntry.Builder<R,T>
Type Parameters:
R - The type of your log entry
T - The type of your builder
All Implemented Interfaces:
Builder<T,R>, Supplier<R>
Direct Known Subclasses:
HeaderLogEntry.Builder, HostLogEntry.Builder, RequestLineLogEntry.Builder, SizeLogEntry.Builder, StatusLogEntry.Builder, TimestampLogEntry.Builder, TimeTakenLogEntry.Builder, UserLogEntry.Builder
Enclosing class:
AbstractLogEntry

protected abstract static class AbstractLogEntry.Builder<R extends AbstractLogEntry,T extends AbstractLogEntry.Builder<R,T>> extends Object implements Builder<T,R>
A fluent API builder for AbstractLogEntry. Extend this class to implement your own log entries.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Create a new instance, no side effects.
  • Method Summary

    Modifier and Type
    Method
    Description
    lPad(int length)
    Apply left padding to fill the defined length.
    maxLength(int maxLength)
    Configure maximal length of the output written.
    Apply no padding on the output.
    rPad(int length)
    Apply right padding to fill the defined length.
    sanitize(boolean sanitize)
    Configure output sanitization.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.helidon.common.Builder

    build, get, identity, update
  • Constructor Details

    • Builder

      protected Builder()
      Create a new instance, no side effects.
  • Method Details

    • noPad

      public T noPad()
      Apply no padding on the output. This is the default.
      Returns:
      updated builder instance
    • rPad

      public T rPad(int length)
      Apply right padding to fill the defined length. Padding uses spaces. If log entry length is bigger than padding length, log entry is returned as is
      Parameters:
      length - length to pad to
      Returns:
      updated builder instance
    • lPad

      public T lPad(int length)
      Apply left padding to fill the defined length. Padding uses spaces. If log entry length is bigger than padding length, log entry is returned as is
      Parameters:
      length - length to pad to
      Returns:
      updated builder instance
    • sanitize

      public T sanitize(boolean sanitize)
      Configure output sanitization. In case the sanitized output differs from original value, the output will be prefixed with an exclamation mark.
      Parameters:
      sanitize - whether to sanitize output (for log entries that are based on text from HTTP request).
      Returns:
      updated builder instance
    • maxLength

      public T maxLength(int maxLength)
      Configure maximal length of the output written. Modified output will be prefixed with an exclamation mark.
      Parameters:
      maxLength - maximal length to write
      Returns:
      updated builder instance