| Modifier and Type | Method and Description |
|---|---|
static Protocol<Printer.Fn<?>> |
defaultPrinterProtocol()
Return the default printer
Protocol. |
static Protocol.Builder<Printer.Fn<?>> |
defaultProtocolBuilder()
Returns a
Protocol.Builder
configured to produce a Protocol which knows how to print
these types of values:
BigDecimal
BigInteger
Boolean
Byte (as an integer)
CharSequence (as a string literal)
Character (as a character literal)
Date (as #inst)
Double
Float
GregorianCalendar (as #inst)
Integer
Keyword
List
Long
Map
Set
Short (as an integer)
Symbol
Tag
TaggedValue
Timestamp (as #inst)
UUID (as #uuid)
|
static Printer |
newPrinter(Appendable out)
Return a new Printer with the default printing
protocol.
|
static Printer |
newPrinter(Protocol<Printer.Fn<?>> fns,
Appendable out)
Return a new Printer with the printing protocol given as
fns. |
static Protocol<Printer.Fn<?>> |
prettyPrinterProtocol() |
static Protocol.Builder<Printer.Fn<?>> |
prettyProtocolBuilder() |
static String |
printString(Object ednValue)
Print
ednValue to a new String using the default
printing protocol. |
static String |
printString(Protocol<Printer.Fn<?>> fns,
Object ednValue)
Print
ednValue to a new String using the printing
protocol given as fns. |
public static Printer newPrinter(Appendable out)
out. Printer.close() will close out, provided out implements Closeable.out - to which values will be printed. Never null.public static String printString(Object ednValue)
ednValue to a new String using the default
printing protocol.ednValue - the value to be returned as a String in edn syntax.public static String printString(Protocol<Printer.Fn<?>> fns, Object ednValue)
ednValue to a new String using the printing
protocol given as fns.fns - a Protocol which knows how to print all the classes
of objects that we'll be asking our Printer to print.
Never null. Never null.ednValue - the value to be returned as a String in edn syntax.public static Printer newPrinter(Protocol<Printer.Fn<?>> fns, Appendable out)
fns. Everything the printer prints will be appended to writer. Printer.close() will close out, if
out implements Closeable.fns - a Protocol which knows how to print all the classes
of objects that we'll be asking our Printer to print.
Never null. Never null.out - to which values will be printed. Never null.public static Protocol.Builder<Printer.Fn<?>> defaultProtocolBuilder()
Protocol.Builder
configured to produce a Protocol which knows how to print
these types of values:
BigDecimalBigIntegerBooleanByte (as an integer)CharSequence (as a string literal)Character (as a character literal)Date (as #inst)DoubleFloatGregorianCalendar (as #inst)IntegerKeywordListLongMapSetShort (as an integer)SymbolTagTaggedValueTimestamp (as #inst)UUID (as #uuid)public static Protocol<Printer.Fn<?>> defaultPrinterProtocol()
Protocol. This is equivalent
to defaultProtocolBuilder().build().Protocol, never null.public static Protocol.Builder<Printer.Fn<?>> prettyProtocolBuilder()
public static Protocol<Printer.Fn<?>> prettyPrinterProtocol()
Copyright © 2019. All rights reserved.