From 6f77a5bb8911150e727be589fbbdbf435c1ebc1f Mon Sep 17 00:00:00 2001 From: David Berkman Date: Mon, 14 Oct 2024 12:48:27 -0700 Subject: [PATCH] identifying batch parameters --- .../org/smallmind/batch/base/BatchParameter.java | 9 ++++++++- .../smallmind/batch/base/BatchParameters.java | 16 ++++++++-------- .../smallmind/batch/base/DateBatchParameter.java | 5 ++--- .../batch/base/DoubleBatchParameter.java | 5 ++--- .../smallmind/batch/base/LongBatchParameter.java | 5 ++--- .../batch/base/StringBatchParameter.java | 4 ++-- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/batch/base/src/main/java/org/smallmind/batch/base/BatchParameter.java b/batch/base/src/main/java/org/smallmind/batch/base/BatchParameter.java index 14d67d912..d58df84c9 100644 --- a/batch/base/src/main/java/org/smallmind/batch/base/BatchParameter.java +++ b/batch/base/src/main/java/org/smallmind/batch/base/BatchParameter.java @@ -35,10 +35,12 @@ public abstract class BatchParameter { private final T value; + private final boolean identifying; - public BatchParameter (T value) { + public BatchParameter (T value, boolean identifying) { this.value = value; + this.identifying = identifying; } public abstract ParameterType getType (); @@ -47,4 +49,9 @@ public T getValue () { return value; } + + public boolean isIdentifying () { + + return identifying; + } } diff --git a/batch/base/src/main/java/org/smallmind/batch/base/BatchParameters.java b/batch/base/src/main/java/org/smallmind/batch/base/BatchParameters.java index 3e15f774a..ed1d3e9c5 100644 --- a/batch/base/src/main/java/org/smallmind/batch/base/BatchParameters.java +++ b/batch/base/src/main/java/org/smallmind/batch/base/BatchParameters.java @@ -37,23 +37,23 @@ public class BatchParameters extends HashMap> { - public void putDate (String key, Date aDate) { + public void putDate (String key, Date aDate, boolean identifying) { - put(key, new DateBatchParameter(aDate)); + put(key, new DateBatchParameter(aDate, identifying)); } - public void putDouble (String key, Double aDouble) { + public void putDouble (String key, Double aDouble, boolean identifying) { - put(key, new DoubleBatchParameter(aDouble)); + put(key, new DoubleBatchParameter(aDouble, identifying)); } - public void putLong (String key, Long aLong) { + public void putLong (String key, Long aLong, boolean identifying) { - put(key, new LongBatchParameter(aLong)); + put(key, new LongBatchParameter(aLong, identifying)); } - public void putString (String key, String aString) { + public void putString (String key, String aString, boolean identifying) { - put(key, new StringBatchParameter(aString)); + put(key, new StringBatchParameter(aString, identifying)); } } diff --git a/batch/base/src/main/java/org/smallmind/batch/base/DateBatchParameter.java b/batch/base/src/main/java/org/smallmind/batch/base/DateBatchParameter.java index 9484d1588..33d8802e2 100644 --- a/batch/base/src/main/java/org/smallmind/batch/base/DateBatchParameter.java +++ b/batch/base/src/main/java/org/smallmind/batch/base/DateBatchParameter.java @@ -36,9 +36,9 @@ public class DateBatchParameter extends BatchParameter { - public DateBatchParameter (Date value) { + public DateBatchParameter (Date value, boolean identifying) { - super(value); + super(value, identifying); } @Override @@ -47,4 +47,3 @@ public ParameterType getType () { return ParameterType.DATE; } } - diff --git a/batch/base/src/main/java/org/smallmind/batch/base/DoubleBatchParameter.java b/batch/base/src/main/java/org/smallmind/batch/base/DoubleBatchParameter.java index a3f91330e..89d78bcc3 100644 --- a/batch/base/src/main/java/org/smallmind/batch/base/DoubleBatchParameter.java +++ b/batch/base/src/main/java/org/smallmind/batch/base/DoubleBatchParameter.java @@ -34,9 +34,9 @@ public class DoubleBatchParameter extends BatchParameter { - public DoubleBatchParameter (Double value) { + public DoubleBatchParameter (Double value, boolean identifying) { - super(value); + super(value, identifying); } @Override @@ -45,4 +45,3 @@ public ParameterType getType () { return ParameterType.DOUBLE; } } - diff --git a/batch/base/src/main/java/org/smallmind/batch/base/LongBatchParameter.java b/batch/base/src/main/java/org/smallmind/batch/base/LongBatchParameter.java index dfbf1a981..d2c6c947c 100644 --- a/batch/base/src/main/java/org/smallmind/batch/base/LongBatchParameter.java +++ b/batch/base/src/main/java/org/smallmind/batch/base/LongBatchParameter.java @@ -34,9 +34,9 @@ public class LongBatchParameter extends BatchParameter { - public LongBatchParameter (Long value) { + public LongBatchParameter (Long value, boolean identifying) { - super(value); + super(value, identifying); } @Override @@ -45,4 +45,3 @@ public ParameterType getType () { return ParameterType.LONG; } } - diff --git a/batch/base/src/main/java/org/smallmind/batch/base/StringBatchParameter.java b/batch/base/src/main/java/org/smallmind/batch/base/StringBatchParameter.java index 90d594cc7..2f7c5f4fa 100644 --- a/batch/base/src/main/java/org/smallmind/batch/base/StringBatchParameter.java +++ b/batch/base/src/main/java/org/smallmind/batch/base/StringBatchParameter.java @@ -34,9 +34,9 @@ public class StringBatchParameter extends BatchParameter { - public StringBatchParameter (String value) { + public StringBatchParameter (String value, boolean identifying) { - super(value); + super(value, identifying); } @Override