/** * Describe the message specific properties to the given {@code stringBuilder}. Subclasses should override this * method, calling the super method and appending their own properties to the end (or beginning). * <p> * As convention, String values should be enclosed in single quotes, Objects in curly brackets and numeric values * may be appended without enclosing. All properties should be preceded by a comma when appending, or finish with a * comma when prefixing values. * * @param stringBuilder the builder to append data to */ protected void describeTo(StringBuilder stringBuilder) { stringBuilder.append("payload={") .append(getPayload()) .append('}') .append(", metadata={") .append(getMetaData()) .append('}') .append(", messageIdentifier='") .append(getIdentifier()) .append('\''); }
@Override public R getPayload() { if (isExceptional()) { throw new IllegalPayloadAccessException( "This result completed exceptionally, payload is not available. " + "Try calling 'exceptionResult' to see the cause of failure.", exception ); } return super.getPayload(); } }
/** * Describe the message specific properties to the given {@code stringBuilder}. Subclasses should override this * method, calling the super method and appending their own properties to the end (or beginning). * <p> * As convention, String values should be enclosed in single quotes, Objects in curly brackets and numeric values * may be appended without enclosing. All properties should be preceded by a comma when appending, or finish with a * comma when prefixing values. * * @param stringBuilder the builder to append data to */ protected void describeTo(StringBuilder stringBuilder) { stringBuilder.append("payload={") .append(getPayload()) .append('}') .append(", metadata={") .append(getMetaData()) .append('}') .append(", messageIdentifier='") .append(getIdentifier()) .append('\''); }
/** * Describe the message specific properties to the given {@code stringBuilder}. Subclasses should override this * method, calling the super method and appending their own properties to the end (or beginning). * <p> * As convention, String values should be enclosed in single quotes, Objects in curly brackets and numeric values * may be appended without enclosing. All properties should be preceded by a comma when appending, or finish with a * comma when prefixing values. * * @param stringBuilder the builder to append data to */ protected void describeTo(StringBuilder stringBuilder) { stringBuilder.append("payload={") .append(getPayload()) .append('}') .append(", metadata={") .append(getMetaData()) .append('}') .append(", messageIdentifier='") .append(getIdentifier()) .append('\''); }
@Override public R getPayload() { if (isExceptional()) { throw new IllegalPayloadAccessException( "This result completed exceptionally, payload is not available. " + "Try calling 'exceptionResult' to see the cause of failure.", exception ); } return super.getPayload(); } }