- 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 String
debug(Object object)
static void
debug(Object object, Output<?> output)
static String
debug(Object object, OutputSettings settings)
Returns the developer-readableDisplay
string for the givemobject
, output using the givensettings
.static void
debugChar(int character, Output<?> output)
Writes the code points of the Java character literal for the givencharacter
tooutput
.static void
debugDouble(double value, Output<?> output)
Writes the code points of the Java numeric literal for the givenvalue
tooutput
.static void
debugFloat(float value, Output<?> output)
Writes the code points of the Java numeric literal for the givenvalue
tooutput
.static void
debugInt(int value, Output<?> output)
Writes the code points of the Java numeric literal for the givenvalue
tooutput
.static void
debugLong(long value, Output<?> output)
Writes the code points of the Java numeric literal for the givenvalue
tooutput
.static void
debugString(String string, Output<?> output)
Writes the code points of the Java string literal for the givenstring
tooutput
.static String
display(Object object)
static void
display(Object object, Output<?> output)
static String
display(Object object, OutputSettings settings)
static void
displayDouble(double value, Output<?> output)
Writes the code points of the numeric string for the givenvalue
tooutput
.static void
displayFloat(float value, Output<?> output)
Writes the code points of the numeric string for the givenvalue
tooutput
.static void
displayInt(int value, Output<?> output)
Writes the code points of the numeric string for the givenvalue
tooutput
.static void
displayLong(long value, Output<?> output)
Writes the code points of the numeric string for the givenvalue
tooutput
.static String
lineSeparator()
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-readableDisplay
string for the givenobject
tooutput
. Assumesoutput
is a UnicodeOutput
writer with sufficient capacity. Delegates toDisplay.display(Output)
, ifobject
implementsDisplay
; otherwise writes the result ofObject.toString()
.- Throws:
OutputException
- if theoutput
exits the cont state before the full display string has been written.
-
display
public static String display(Object object, OutputSettings settings)
Returns the human-readableDisplay
string for the givemobject
, output using the givensettings
. Delegates toDisplay.display(Output)
, ifobject
implementsDisplay
; 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-readableDebug
string for the givenobject
tooutput
. Assumesoutput
is a UnicodeOutput
writer with sufficient capacity. Delegates toDebug.debug(Output)
, ifobject
implementsDebug
; writes a Java string literal, ifobject
is aString
, and writes a Java number literal, ifobject
is aNumber
; otherwise writes the result ofObject.toString()
.- Throws:
OutputException
- if theoutput
exits the cont state before the full debug string has been written.
-
debug
public static String debug(Object object, OutputSettings settings)
Returns the developer-readableDisplay
string for the givemobject
, output using the givensettings
. Delegates toDebug.debug(Output)
, ifobject
implementsDebug
; returns a Java string literal, ifobject
is aString
, and returns a Java number literal, ifobject
is 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 givenvalue
tooutput
.- Throws:
OutputException
- if theoutput
exits 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 givenvalue
tooutput
.- Throws:
OutputException
- if theoutput
exits 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 givenvalue
tooutput
.- Throws:
OutputException
- if theoutput
exits 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 givenvalue
tooutput
.- Throws:
OutputException
- if theoutput
exits 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 givenvalue
tooutput
.- Throws:
OutputException
- if theoutput
exits 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 givenvalue
tooutput
.- Throws:
OutputException
- if theoutput
exits 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 givenvalue
tooutput
.- Throws:
OutputException
- if theoutput
exits 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 givenvalue
tooutput
.- Throws:
OutputException
- if theoutput
exits 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 givencharacter
tooutput
.- Throws:
OutputException
- if theoutput
exits 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 givenstring
tooutput
.- Throws:
OutputException
- if theoutput
exits 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.
-
-