Package net.sf.eBus.util
Class LazyString
- java.lang.Object
- 
- net.sf.eBus.util.LazyString
 
- 
 @ThreadSafe public final class LazyString extends java.lang.ObjectDelaysStringgeneration untiltoString()method is called. This class is used to support lazy text generation inorg.slf4j.Loggerprior to version 2. (Note: slf4j does support lambda in version 2). Consider the following example:import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger sLogger = LoggerFactory.getLogger(MyClass.class); final byte[] data = new byte[50_000]; // Initialize data byte array. sLogger.debug("data contents:\n{}", new LazyString(() -> HexDump.dump(data, " ");- Author:
- Charles W. Rapp
 
- 
- 
Constructor SummaryConstructors Constructor Description LazyString(java.util.function.Supplier<java.lang.String> initializer)Creates a new, un-initialized lazy string instance using the givenStringsupplier to generate the text when needed.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringget()Returns initialized text.java.lang.StringtoString()
 
-