Class Msg

  • All Implemented Interfaces:
    java.util.function.Supplier<java.lang.Object>, org.apache.logging.log4j.util.StringBuilderFormattable

    public final class Msg
    extends java.lang.Object
    implements java.util.function.Supplier<java.lang.Object>, org.apache.logging.log4j.util.StringBuilderFormattable
    Message holder object for use with lazy logging.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void formatTo​(java.lang.StringBuilder buffer)  
      java.lang.Object get()  
      static Msg make​(java.util.function.Supplier<?> supplier)  
      static <T> Msg make​(T value, java.util.function.Function<T,​?> action)  
      static <T> Msg makeNullable​(T value, java.util.function.Function<T,​?> action)  
      static java.lang.StringBuilder stringBuilder()  
      java.lang.String toString()  
      static java.lang.String toString​(java.util.function.UnaryOperator<java.lang.StringBuilder> fn)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • make

        public static Msg make​(java.util.function.Supplier<?> supplier)
      • make

        public static <T> Msg make​(T value,
                                   @Nonnull
                                   java.util.function.Function<T,​?> action)
      • makeNullable

        public static <T> Msg makeNullable​(@Nullable
                                           T value,
                                           @Nonnull
                                           java.util.function.Function<T,​?> action)
      • toString

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

        public void formatTo​(java.lang.StringBuilder buffer)
        Specified by:
        formatTo in interface org.apache.logging.log4j.util.StringBuilderFormattable
      • stringBuilder

        public static java.lang.StringBuilder stringBuilder()
      • toString

        public static java.lang.String toString​(java.util.function.UnaryOperator<java.lang.StringBuilder> fn)
      • get

        public java.lang.Object get()
        Specified by:
        get in interface java.util.function.Supplier<java.lang.Object>