@MessageBundle(projectCode="CW") @BaseUrl(value="errors/") public interface ErrorMessages
| Modifier and Type | Field and Description |
|---|---|
static ErrorMessages |
MESSAGES
The static message instance.
|
| Modifier and Type | Method and Description |
|---|---|
CloseException |
closeFailure(Throwable cause,
Closeable c)
Creates an exception indicating a failure to close the
Closeable |
CloseException |
closeFailure(Throwable cause,
Closeable c,
Throwable... errors)
Creates an exception indicating a failure to close the
Closeable |
IllegalArgumentException |
invalidValue(Object value)
Creates an exception indicating the value is invalid.
|
Supplier<String> |
nullParam(String name)
Creates a message indicating the parameter is
null. |
<T extends RuntimeException> |
operationFailed(BiFunction<String,IOException,T> fn,
IOException cause,
String name)
Uses the producer function to create the returned exception indicating the operation has failed.
|
<T extends RuntimeException> |
operationFailed(Function<String,T> fn,
String name)
Uses the producer function to create the returned exception indicating the operation has failed.
|
String |
version(int major,
int minor,
int macro,
String rel)
Returns the internationalized version message.
|
static final ErrorMessages MESSAGES
@Message(value="Version %d.%d.%d.%s") String version(int major, int minor, int macro, String rel)
major - the major versionminor - the minor versionmacro - the macro versionrel - the release suffix, e.g. Beta1, Final@Message(id=1, value="Value \'%s\' is invalid") IllegalArgumentException invalidValue(Object value)
value - the invalid valueIllegalStateException for the error@Message(id=2, value="Failure closing %s") CloseException closeFailure(@Cause Throwable cause, @Param @Pos(value=1) Closeable c)
Closeablecause - the cause of the errorc - the closeable that failedCloseException for the errorCloseException closeFailure(@Cause Throwable cause, @Param @Pos(value=1) Closeable c, @Suppressed Throwable... errors)
Closeablecause - the cause of the errorc - the closeable that failederrors - errors that should be added as suppressed exceptions.CloseException for the error@Message(id=3, value="Parameter %s cannot be null") @ResolutionDoc(suffix=".html") Supplier<String> nullParam(String name)
null.
This can be used to lazily format the message for null checks like
Objects.requireNonNull(Object, Supplier).
name - the name of the parameter@Message(id=4, value="Operation %s failed.") <T extends RuntimeException> T operationFailed(@Producer Function<String,T> fn, String name)
The formatted value of the message will be the parameter for the functions apply method.
T - the type of the exception to return, must be assignable to a RuntimeExceptionfn - the function to produce the returned exceptionname - the name of the operation that failed<T extends RuntimeException> T operationFailed(@Producer BiFunction<String,IOException,T> fn, @Cause IOException cause, String name)
The formatted value of the message will be the first parameter for the functions BiFunction.apply(Object, Object) apply} method. The second parameter will be the cause.
T - the type of the exception to return, must be assignable to a RuntimeExceptionfn - the function to produce the returned exceptioncause - the cause of the exception to pass to the functionname - the name of the operation that failedCopyright © 2025 JBoss by Red Hat. All rights reserved.