- java.lang.Object
-
- swim.codec.Format
-
public final class Format extends Object
Text format utility functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringdebug(Object object)static voiddebug(Object object, Output<?> output)static Stringdebug(Object object, OutputSettings settings)Returns the developer-readableDisplaystring for the givemobject, output using the givensettings.static voiddebugChar(int character, Output<?> output)Writes the code points of the Java character literal for the givencharactertooutput.static voiddebugDouble(double value, Output<?> output)Writes the code points of the Java numeric literal for the givenvaluetooutput.static voiddebugFloat(float value, Output<?> output)Writes the code points of the Java numeric literal for the givenvaluetooutput.static voiddebugInt(int value, Output<?> output)Writes the code points of the Java numeric literal for the givenvaluetooutput.static voiddebugLong(long value, Output<?> output)Writes the code points of the Java numeric literal for the givenvaluetooutput.static voiddebugString(String string, Output<?> output)Writes the code points of the Java string literal for the givenstringtooutput.static Stringdisplay(Object object)static voiddisplay(Object object, Output<?> output)static Stringdisplay(Object object, OutputSettings settings)static voiddisplayDouble(double value, Output<?> output)Writes the code points of the numeric string for the givenvaluetooutput.static voiddisplayFloat(float value, Output<?> output)Writes the code points of the numeric string for the givenvaluetooutput.static voiddisplayInt(int value, Output<?> output)Writes the code points of the numeric string for the givenvaluetooutput.static voiddisplayLong(long value, Output<?> output)Writes the code points of the numeric string for the givenvaluetooutput.static StringlineSeparator()Returns the operting system specific string used to separate lines of text.
-
-
-
Method Detail
-
display
public static void display(Object object, Output<?> output)
Writes the code points of the human-readableDisplaystring for the givenobjecttooutput. Assumesoutputis a UnicodeOutputwriter with sufficient capacity. Delegates toDisplay.display(Output), ifobjectimplementsDisplay; otherwise writes the result ofObject.toString().- Throws:
OutputException- if theoutputexits the cont state before the full display string has been written.
-
display
public static String display(Object object, OutputSettings settings)
Returns the human-readableDisplaystring for the givemobject, output using the givensettings. Delegates toDisplay.display(Output), ifobjectimplementsDisplay; otherwise returns the result ofObject.toString().
-
display
public static String display(Object object)
- See Also:
display(Object, OutputSettings)
-
debug
public static void debug(Object object, Output<?> output)
Writes the code points of the developer-readableDebugstring for the givenobjecttooutput. Assumesoutputis a UnicodeOutputwriter with sufficient capacity. Delegates toDebug.debug(Output), ifobjectimplementsDebug; writes a Java string literal, ifobjectis aString, and writes a Java number literal, ifobjectis aNumber; otherwise writes the result ofObject.toString().- Throws:
OutputException- if theoutputexits the cont state before the full debug string has been written.
-
debug
public static String debug(Object object, OutputSettings settings)
Returns the developer-readableDisplaystring for the givemobject, output using the givensettings. Delegates toDebug.debug(Output), ifobjectimplementsDebug; returns a Java string literal, ifobjectis aString, and returns a Java number literal, ifobjectis aNumber; otherwise returns the result ofObject.toString().
-
debug
public static String debug(Object object)
- See Also:
debug(Object, OutputSettings)
-
displayInt
public static void displayInt(int value, Output<?> output)Writes the code points of the numeric string for the givenvaluetooutput.- Throws:
OutputException- if theoutputexits the cont state before the full numeric string has been written.
-
displayLong
public static void displayLong(long value, Output<?> output)Writes the code points of the numeric string for the givenvaluetooutput.- Throws:
OutputException- if theoutputexits the cont state before the full numeric string has been written.
-
displayFloat
public static void displayFloat(float value, Output<?> output)Writes the code points of the numeric string for the givenvaluetooutput.- Throws:
OutputException- if theoutputexits the cont state before the full numeric string has been written.
-
displayDouble
public static void displayDouble(double value, Output<?> output)Writes the code points of the numeric string for the givenvaluetooutput.- Throws:
OutputException- if theoutputexits the cont state before the full numeric string has been written.
-
debugInt
public static void debugInt(int value, Output<?> output)Writes the code points of the Java numeric literal for the givenvaluetooutput.- Throws:
OutputException- if theoutputexits the cont state before the full numeric literal has been written.
-
debugLong
public static void debugLong(long value, Output<?> output)Writes the code points of the Java numeric literal for the givenvaluetooutput.- Throws:
OutputException- if theoutputexits the cont state before the full numeric literal has been written.
-
debugFloat
public static void debugFloat(float value, Output<?> output)Writes the code points of the Java numeric literal for the givenvaluetooutput.- Throws:
OutputException- if theoutputexits the cont state before the full numeric literal has been written.
-
debugDouble
public static void debugDouble(double value, Output<?> output)Writes the code points of the Java numeric literal for the givenvaluetooutput.- Throws:
OutputException- if theoutputexits the cont state before the full numeric literal has been written.
-
debugChar
public static void debugChar(int character, Output<?> output)Writes the code points of the Java character literal for the givencharactertooutput.- Throws:
OutputException- if theoutputexits the cont state before the full character literal has been written.
-
debugString
public static void debugString(String string, Output<?> output)
Writes the code points of the Java string literal for the givenstringtooutput.- Throws:
OutputException- if theoutputexits the cont state before the full string literal has been written.
-
lineSeparator
public static String lineSeparator()
Returns the operting system specific string used to separate lines of text.
-
-