Enum Class MessageTemplates.TwoArgTemplate
java.lang.Object
java.lang.Enum<MessageTemplates.TwoArgTemplate>
io.github.chrimle.exceptionfactory.MessageTemplates.TwoArgTemplate
- All Implemented Interfaces:
Serializable
,Comparable<MessageTemplates.TwoArgTemplate>
,Constable
- Enclosing class:
- MessageTemplates
Template requiring TWO template specifiers to format a message.
- Since:
- 0.1.0
- Author:
- Chrimle
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionExample:Example:Example:Example:Example:Example:Example:Example:Example:Example:Example:Example:Example: -
Method Summary
Modifier and TypeMethodDescription@NotNull String
Creates a formattedString
from thetemplate
andarg
.Returns thetemplate
of this constant.Returns the enum constant of this class with the specified name.static MessageTemplates.TwoArgTemplate[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MUST_BE_AT_LEAST
Example:"`example` MUST be at least `42`"
- Since:
- 0.1.0
-
MUST_BE_AT_MOST
Example:"`example` MUST be at most `42`"
- Since:
- 0.1.0
-
MUST_BE_EQUAL_TO
Example:"`actual` MUST be equal to `expected`"
- Since:
- 0.2.0
- See Also:
-
MUST_BE_GREATER_THAN
Example:"`example` MUST be greater than `42`"
- Since:
- 0.1.0
-
MUST_BE_INSTANCE_OF
Example:"`example` MUST be an instance of `ExampleClass`"
- Since:
- 0.2.0
- See Also:
-
MUST_BE_LESS_THAN
Example:"`example` MUST be less than `42`"
- Since:
- 0.1.0
-
MUST_BE_OF_LENGTH
Example:"`example` MUST be of length `42`"
- Since:
- 0.2.0
-
MUST_BE_OF_SIZE
Example:"`example` MUST be of size `42`"
- Since:
- 0.2.0
-
MUST_CONTAIN
Example:"`example` MUST contain `ex`"
- Since:
- 0.1.0
-
MUST_MATCH_REGEX
Example:"`example` MUST match RegEx `.*`"
- Since:
- 0.1.0
-
MUST_NOT_BE_EQUAL_TO
Example:"`example` MUST NOT be equal to `example`"
- Since:
- 0.1.0
-
MUST_NOT_BE_INSTANCE_OF
Example:"`example` MUST NOT be an instance of `ExampleClass`"
- Since:
- 0.2.0
- See Also:
-
MUST_NOT_CONTAIN
Example:"`example` MUST NOT contain `ex`"
- Since:
- 0.1.0
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getTemplate
Returns thetemplate
of this constant.- Returns:
- the
template
. - Since:
- 0.1.0
-
format
Creates a formattedString
from thetemplate
andarg
.- Parameters:
argOne
- to be used as the first template specifier.argTwo
- to be used as the second template specifier.- Returns:
- the formatted String.
- Since:
- 0.1.0
-