From e4fcf459ba0977905952947ced7ed806d2295352 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Wed, 15 Jul 2020 09:49:03 +0200 Subject: [PATCH] [New] Added Parameter.isUomDefined() and .isInterpretationDefined() --- .../strolch/model/parameter/AbstractParameter.java | 10 ++++++++++ .../java/li/strolch/model/parameter/Parameter.java | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/li.strolch.model/src/main/java/li/strolch/model/parameter/AbstractParameter.java b/li.strolch.model/src/main/java/li/strolch/model/parameter/AbstractParameter.java index 54fd800ac..830d92fde 100644 --- a/li.strolch.model/src/main/java/li/strolch/model/parameter/AbstractParameter.java +++ b/li.strolch.model/src/main/java/li/strolch/model/parameter/AbstractParameter.java @@ -87,6 +87,11 @@ public abstract class AbstractParameter extends AbstractStrolchElement implem } } + @Override + public boolean isInterpretationDefined() { + return !INTERPRETATION_NONE.equals(this.interpretation); + } + @Override public String getUom() { return this.uom; @@ -102,6 +107,11 @@ public abstract class AbstractParameter extends AbstractStrolchElement implem } } + @Override + public boolean isUomDefined() { + return !UOM_NONE.equals(this.uom); + } + @Override public void setIndex(int index) { assertNotReadonly(); diff --git a/li.strolch.model/src/main/java/li/strolch/model/parameter/Parameter.java b/li.strolch.model/src/main/java/li/strolch/model/parameter/Parameter.java index bf3e49444..638fee0e0 100644 --- a/li.strolch.model/src/main/java/li/strolch/model/parameter/Parameter.java +++ b/li.strolch.model/src/main/java/li/strolch/model/parameter/Parameter.java @@ -124,6 +124,13 @@ public interface Parameter extends StrolchElement, Comparable> { */ void setUom(String uom); + /** + * Returns true if the interpretation is not {@link StrolchModelConstants#UOM_NONE} + * + * @return true if the interpretation is not {@link StrolchModelConstants#UOM_NONE} + */ + boolean isUomDefined(); + /** * Returns the index of this {@link Parameter}. This can be used to sort the parameters in a UI * @@ -166,6 +173,13 @@ public interface Parameter extends StrolchElement, Comparable> { */ void setInterpretation(String interpretation); + /** + * Returns true if the interpretation is not {@link StrolchModelConstants#INTERPRETATION_NONE} + * + * @return true if the interpretation is not {@link StrolchModelConstants#INTERPRETATION_NONE} + */ + boolean isInterpretationDefined(); + /** * The {@link ParameterizedElement} parent to which this {@link Parameter} belongs *