From ba6ff916679a2a63d2c1acd0b9cb8f2a15e0dd87 Mon Sep 17 00:00:00 2001 From: Milad Date: Thu, 30 May 2024 10:30:35 +0200 Subject: [PATCH 1/2] add camel --- pom.xml | 6 +++++ src/main/java/com/mycompany/app/App.java | 1 + .../com/mycompany/app/CamelConverters.java | 26 +++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 src/main/java/com/mycompany/app/CamelConverters.java diff --git a/pom.xml b/pom.xml index 2c2ed37..4d1c82e 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,12 @@ 5.10.2 test + + + org.apache.camel + camel-core + 4.0.5 + \ No newline at end of file diff --git a/src/main/java/com/mycompany/app/App.java b/src/main/java/com/mycompany/app/App.java index 77cf3e0..bf4b07e 100644 --- a/src/main/java/com/mycompany/app/App.java +++ b/src/main/java/com/mycompany/app/App.java @@ -9,5 +9,6 @@ public class App public static void main( String[] args ) { System.out.println( "Hello World!" ); + } } diff --git a/src/main/java/com/mycompany/app/CamelConverters.java b/src/main/java/com/mycompany/app/CamelConverters.java new file mode 100644 index 0000000..9a0f208 --- /dev/null +++ b/src/main/java/com/mycompany/app/CamelConverters.java @@ -0,0 +1,26 @@ +package com.mycompany.app; + +import java.util.Date; +import org.apache.camel.Converter; + +/** + * Custom Camel type converters. + */ +@Converter +public final class CamelConverters { + /** + * Returns a {@link Date} with the given {@link Integer} value (cast as a long) as the underlying timestamp value, + * or {@code null} if the given Integer is {@code null}. + */ + @Converter + public static Date toDate(Integer integer) { + if (integer == null) { + return null; + } + return new Date(integer.longValue()); + } + + private CamelConverters() throws IllegalAccessException { + throw new IllegalAccessException(); + } +} From 229fe032741f93e67d2a5aa7d45cbe5986c462cd Mon Sep 17 00:00:00 2001 From: Milad Date: Thu, 30 May 2024 10:31:10 +0200 Subject: [PATCH 2/2] bump version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4d1c82e..3d41403 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.mycompany.app my-app jar - 1.0-SNAPSHOT + 1.1-SNAPSHOT my-app http://maven.apache.org