FormatValidator
public final class StringFormatValidator extends Object
Modifier and Type | Method | Description |
---|---|---|
int |
argumentCount() |
The number of arguments needed for the format.
|
String |
asFormat() |
Recreates the format using the internal formatting descriptors.
|
String |
detailMessage() |
A detail message if
FormatValidator.isValid() returns false , otherwise an empty string. |
String |
format() |
Returns the format string used for validation.
|
boolean |
isValid() |
Returns
true of the format is valid, otherwise false . |
static StringFormatValidator |
of(String format) |
Creates a string format.
|
static StringFormatValidator |
of(String format,
Object... parameters) |
Creates a string format.
|
String |
summaryMessage() |
A summary message if
FormatValidator.isValid() returns false , otherwise an empty string. |
String |
toString() |
|
static StringFormatValidator |
withTranslation(String format,
String translationFormat) |
Creates a string format.
|
public static final Pattern PATTERN
public static StringFormatValidator of(String format)
format
- the format.public static StringFormatValidator withTranslation(String format, String translationFormat)
format
- the format.translationFormat
- the format of the translationpublic static StringFormatValidator of(String format, Object... parameters)
format
- the format.parameters
- the parameters to validate against.public int argumentCount()
FormatValidator
public String format()
FormatValidator
public boolean isValid()
FormatValidator
true
of the format is valid, otherwise false
.true
of the format is valid, otherwise false
.public String asFormat()
public final String detailMessage()
FormatValidator
FormatValidator.isValid()
returns false
, otherwise an empty string.detailMessage
in interface FormatValidator
public final String summaryMessage()
FormatValidator
FormatValidator.isValid()
returns false
, otherwise an empty string.summaryMessage
in interface FormatValidator
Copyright © 2018. All rights reserved.