Package com.aoindustries.io.buffer
Class LoggingResult
- java.lang.Object
-
- com.aoindustries.io.buffer.LoggingResult
-
- All Implemented Interfaces:
BufferResult,Writable
public class LoggingResult extends Object implements BufferResult
Logs all write calls in a way that can be put into Java source code. This is used to capture real-world scenarios for unit testing. This class is not thread safe.- Author:
- AO Industries, Inc.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLoggingResult(BufferResult wrapped, Writer log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendTo(Encoder encoder, Appendable out)voidappendTo(Encoder encoder, Appendable out, long start, long end)voidappendTo(Appendable out)voidappendTo(Appendable out, long start, long end)longgetId()longgetLength()booleanisFastToString()StringtoString()LoggingResulttrim()Trims the contents of this result, as per rules ofStrings.isWhitespace(int), returning the instance that represents this result trimmed.voidwriteTo(Encoder encoder, Writer out)voidwriteTo(Encoder encoder, Writer out, long off, long len)voidwriteTo(Writer out)voidwriteTo(Writer out, long off, long len)
-
-
-
Constructor Detail
-
LoggingResult
protected LoggingResult(BufferResult wrapped, Writer log) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getId
public long getId()
-
getLength
public long getLength() throws IOException- Specified by:
getLengthin interfaceWritable- Throws:
IOException
-
isFastToString
public boolean isFastToString()
- Specified by:
isFastToStringin interfaceWritable
-
toString
public String toString()
-
writeTo
public void writeTo(Writer out) throws IOException
- Specified by:
writeToin interfaceWritable- Throws:
IOException
-
writeTo
public void writeTo(Writer out, long off, long len) throws IOException
- Specified by:
writeToin interfaceWritable- Throws:
IOException
-
writeTo
public void writeTo(Encoder encoder, Writer out) throws IOException
- Specified by:
writeToin interfaceWritable- Throws:
IOException
-
writeTo
public void writeTo(Encoder encoder, Writer out, long off, long len) throws IOException
- Specified by:
writeToin interfaceWritable- Throws:
IOException
-
appendTo
public void appendTo(Appendable out) throws IOException
- Specified by:
appendToin interfaceWritable- Throws:
IOException
-
appendTo
public void appendTo(Appendable out, long start, long end) throws IOException
- Specified by:
appendToin interfaceWritable- Throws:
IOException
-
appendTo
public void appendTo(Encoder encoder, Appendable out) throws IOException
- Specified by:
appendToin interfaceWritable- Throws:
IOException
-
appendTo
public void appendTo(Encoder encoder, Appendable out, long start, long end) throws IOException
- Specified by:
appendToin interfaceWritable- Throws:
IOException
-
trim
public LoggingResult trim() throws IOException
Description copied from interface:BufferResultTrims the contents of this result, as per rules ofStrings.isWhitespace(int), returning the instance that represents this result trimmed.- Specified by:
trimin interfaceBufferResult- Specified by:
trimin interfaceWritable- Throws:
IOException
-
-