@Test(expected = IllegalArgumentException.class) public void testExtractingKeyNonExistingMetadataKeyShouldThrowAnException() { extractKey("foo-bar-axon-metadata"); }
@SuppressWarnings("ConstantConditions") public static String extractKey(String metaDataKey) { isTrue( metaDataKey != null && metaDataKey.startsWith(MESSAGE_METADATA + KEY_DELIMITER), () -> "Cannot extract Axon MetaData key from given String [" + metaDataKey + "]" ); return metaDataKey.substring((MESSAGE_METADATA + KEY_DELIMITER).length()); }
HeaderUtils { @SuppressWarnings("ConstantConditions") public static String extractKey(String metaDataKey) { isTrue( metaDataKey != null && metaDataKey.startsWith(MESSAGE_METADATA + KEY_DELIMITER), () -> "Cannot extract Axon MetaData key from given String [" + metaDataKey + "]" ); return metaDataKey.substring((MESSAGE_METADATA + KEY_DELIMITER).length()); } }
HeaderUtils { @SuppressWarnings("ConstantConditions") public static String extractKey(String metaDataKey) { isTrue( metaDataKey != null && metaDataKey.startsWith(MESSAGE_METADATA + KEY_DELIMITER), () -> "Cannot extract Axon MetaData key from given String [" + metaDataKey + "]" ); return metaDataKey.substring((MESSAGE_METADATA + KEY_DELIMITER).length()); } private  HeaderUtils(); }
HeaderUtils { @SuppressWarnings("ConstantConditions") public static String extractKey(String metaDataKey) { isTrue( metaDataKey != null && metaDataKey.startsWith(MESSAGE_METADATA + KEY_DELIMITER), () -> "Cannot extract Axon MetaData key from given String [" + metaDataKey + "]" ); return metaDataKey.substring((MESSAGE_METADATA + KEY_DELIMITER).length()); } private  HeaderUtils(); static Long asLong(byte[] value); static Long valueAsLong(Headers headers, String key); static String asString(byte[] value); static String valueAsString(Headers headers, String key); static String valueAsString(Headers headers, String key, String defaultValue); @SuppressWarnings("ConstantConditions") // Null check performed by `Assert.isTrue` static byte[] value(Headers headers, String key); static byte[] toBytes(Number value); static void addHeader(Headers headers, String key, Object value); static Set<String> keys(Headers headers); static String generateMetadataKey(String key); @SuppressWarnings("ConstantConditions") // Null check performed by `Assert.isTrue` call static String extractKey(String metaDataKey); static Map<String, Object> extractAxonMetadata(Headers headers); static Headers toHeaders(EventMessage<?> eventMessage,
                                    SerializedObject<byte[]> serializedObject,
                                    BiFunction<String, Object, RecordHeader> headerValueMapper); static BiFunction<String, Object, RecordHeader> byteMapper(); }
HeaderUtils { @SuppressWarnings("ConstantConditions") public static String extractKey(String metaDataKey) { isTrue( metaDataKey != null && metaDataKey.startsWith(MESSAGE_METADATA + KEY_DELIMITER), () -> "Cannot extract Axon MetaData key from given String [" + metaDataKey + "]" ); return metaDataKey.substring((MESSAGE_METADATA + KEY_DELIMITER).length()); } private  HeaderUtils(); static Long asLong(byte[] value); static Long valueAsLong(Headers headers, String key); static String asString(byte[] value); static String valueAsString(Headers headers, String key); static String valueAsString(Headers headers, String key, String defaultValue); @SuppressWarnings("ConstantConditions") // Null check performed by `Assert.isTrue` static byte[] value(Headers headers, String key); static byte[] toBytes(Number value); static void addHeader(Headers headers, String key, Object value); static Set<String> keys(Headers headers); static String generateMetadataKey(String key); @SuppressWarnings("ConstantConditions") // Null check performed by `Assert.isTrue` call static String extractKey(String metaDataKey); static Map<String, Object> extractAxonMetadata(Headers headers); static Headers toHeaders(EventMessage<?> eventMessage,
                                    SerializedObject<byte[]> serializedObject,
                                    BiFunction<String, Object, RecordHeader> headerValueMapper); static BiFunction<String, Object, RecordHeader> byteMapper();  }