public final class Formatter
extends java.lang.Object
toString
method.
If this throws an exception, Formatter creates its own string
representation of the object, containing its class name and
the contents of its fields.Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
format() |
Formats the message with the given objects.
|
static Formatter |
of(java.lang.String message,
java.lang.Object... objects) |
Factory method.
|
public static Formatter of(java.lang.String message, java.lang.Object... objects)
message
- The string that will be formatted.
The substring %% represents the location where each
object's will string representation will be inserted.objects
- The objects whose string representation will be inserted
into the message string.Formatter
.public java.lang.String format()
java.lang.IllegalStateException
- if the number of %%'s in the message does
not match the number of objects.Copyright © 2018. All Rights Reserved.