From 8eb86b4bb71cc64ffaffdb2f975aa0dd5b4f429c Mon Sep 17 00:00:00 2001 From: Anthony Bargnesi Date: Thu, 22 Sep 2016 13:41:11 -0400 Subject: [PATCH] added example project --- .gitignore | 1 + example/pom.xml | 24 +++++++++++++++++++ .../src/main/java/com/myproject/Behavior.java | 10 ++++++++ .../java/com/myproject/NumberTranslator.java | 8 +++++++ 4 files changed, 43 insertions(+) create mode 100644 example/pom.xml create mode 100644 example/src/main/java/com/myproject/Behavior.java create mode 100644 example/src/main/java/com/myproject/NumberTranslator.java diff --git a/.gitignore b/.gitignore index 000f0ea..a47ec35 100755 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /target/ /.idea/ dependency-reduced-pom.xml +/example/target diff --git a/example/pom.xml b/example/pom.xml new file mode 100644 index 0000000..e3d0312 --- /dev/null +++ b/example/pom.xml @@ -0,0 +1,24 @@ + + 4.0.0 + com.myproject + myproject + 0.0 + jar + MyProject + MyProject + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.8 + 1.8 + UTF-8 + + + + + diff --git a/example/src/main/java/com/myproject/Behavior.java b/example/src/main/java/com/myproject/Behavior.java new file mode 100644 index 0000000..d35ce27 --- /dev/null +++ b/example/src/main/java/com/myproject/Behavior.java @@ -0,0 +1,10 @@ +package com.myproject; + +public interface Behavior { + + String translate(Object obj); + + default String serialize(Object obj) { + return obj.toString(); + } +} diff --git a/example/src/main/java/com/myproject/NumberTranslator.java b/example/src/main/java/com/myproject/NumberTranslator.java new file mode 100644 index 0000000..b0cb6c4 --- /dev/null +++ b/example/src/main/java/com/myproject/NumberTranslator.java @@ -0,0 +1,8 @@ +package com.myproject; + +public class NumberTranslator implements Behavior { + + public String translate(Object obj) { + return serialize(obj); + } +} -- 2.20.1