private void validateThingId(final String thingIdFromMessage, final DittoHeaders dittoHeaders) { final Validator thingIdValidator = IdValidator.newInstance(thingId, THING_ID_REGEX); if (!thingIdValidator.isValid()) { throw ThingIdInvalidException.newBuilder(thingId).dittoHeaders(dittoHeaders).build(); } if (!thingId.equals(thingIdFromMessage)) { final String descTemplate = "It does not match the 'thingId' from the Message the command" + " transports (<{0}>). Please ensure that they are equal."; throw ThingIdInvalidException.newBuilder(thingId) .description(MessageFormat.format(descTemplate, thingIdFromMessage)) .dittoHeaders(dittoHeaders).build(); } }
private void validateThingId(final String thingIdFromMessage, final DittoHeaders dittoHeaders) { final Validator thingIdValidator = IdValidator.newInstance(thingId, THING_ID_REGEX); if (!thingIdValidator.isValid()) { throw ThingIdInvalidException.newBuilder(thingId).dittoHeaders(dittoHeaders).build(); } if (!thingId.equals(thingIdFromMessage)) { final String descTemplate = "It does not match the 'thingId' from the Message the command" + " transports (<{0}>). Please ensure that they are equal."; throw ThingIdInvalidException.newBuilder(thingId) .description(MessageFormat.format(descTemplate, thingIdFromMessage)) .dittoHeaders(dittoHeaders).build(); } }