From 1701255350c06575e7597e19b8ef733e12c31664 Mon Sep 17 00:00:00 2001 From: Willem Date: Sat, 29 Oct 2016 03:37:50 +0200 Subject: [PATCH] Converted all api back to interfaces --- .../builder/UnitXCGroupJumpBuilder.java | 11 +- .../converter/UnitXConverterEngine.java | 6 +- .../unitxc/model/DefaultUnitXCGroupJump.java | 117 +++++++++++++++ .../DefaultUnitXCGroupJumpParameter.java | 79 +++++++++++ .../model/DefaultUnitXConverterResult.java | 133 ++++++++++++++++++ .../DefaultUnitXConverterResultStep.java | 103 ++++++++++++++ .../unitxc/model/UnitXCGroupJump.java | 67 +-------- .../model/UnitXCGroupJumpParameter.java | 42 +----- .../unitxc/model/UnitXConverterResult.java | 82 +---------- .../model/UnitXConverterResultStep.java | 57 +------- 10 files changed, 464 insertions(+), 233 deletions(-) create mode 100644 ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXCGroupJump.java create mode 100644 ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXCGroupJumpParameter.java create mode 100644 ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXConverterResult.java create mode 100644 ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXConverterResultStep.java diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCGroupJumpBuilder.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCGroupJumpBuilder.java index 5207214..a0273b4 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCGroupJumpBuilder.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/config/builder/UnitXCGroupJumpBuilder.java @@ -26,8 +26,9 @@ package net.forwardfire.unitxc.config.builder; import java.util.function.BiConsumer; +import net.forwardfire.unitxc.model.DefaultUnitXCGroupJump; +import net.forwardfire.unitxc.model.DefaultUnitXCGroupJumpParameter; import net.forwardfire.unitxc.model.UnitXCGroup; -import net.forwardfire.unitxc.model.UnitXCGroupJump; import net.forwardfire.unitxc.model.UnitXCGroupJumpParameter; /** @@ -36,10 +37,10 @@ import net.forwardfire.unitxc.model.UnitXCGroupJumpParameter; * @author Willem Cazander * @version 1.0 Apr 1, 2016 */ -public class UnitXCGroupJumpBuilder

extends AbstractUnitXCBuilder> { +public class UnitXCGroupJumpBuilder

extends AbstractUnitXCBuilder> { - public UnitXCGroupJumpBuilder(P parent, UnitXCGroup forGroup, String unitGroupId,BiConsumer parentBuilder) { - super(parent, new UnitXCGroupJump(), parentBuilder); + public UnitXCGroupJumpBuilder(P parent, UnitXCGroup forGroup, String unitGroupId,BiConsumer parentBuilder) { + super(parent, new DefaultUnitXCGroupJump(), parentBuilder); getValue().setUnitGroupId(unitGroupId); getValue().setId(forGroup.getId()+"_"+unitGroupId); } @@ -54,7 +55,7 @@ public class UnitXCGroupJumpBuilder

extends AbstractUnitXCBuilder addJumpParameter(String id,String unitGroupId) { - return make((v) -> v.addJumpParameter(new UnitXCGroupJumpParameter(id, unitGroupId))); + return make((v) -> v.addJumpParameter(new DefaultUnitXCGroupJumpParameter(id, unitGroupId))); } public UnitXConverterStepBuilder> createToGroupConverterSteps() { diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java index 8e719bb..94f3aa0 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/converter/UnitXConverterEngine.java @@ -35,6 +35,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import net.forwardfire.unitxc.UnitXCManager; +import net.forwardfire.unitxc.model.DefaultUnitXConverterResult; +import net.forwardfire.unitxc.model.DefaultUnitXConverterResultStep; import net.forwardfire.unitxc.model.UnitXCGroup; import net.forwardfire.unitxc.model.UnitXCGroupJump; import net.forwardfire.unitxc.model.UnitXCGroupJumpParameter; @@ -135,7 +137,7 @@ public final class UnitXConverterEngine { } long convertTime = System.currentTimeMillis()-startTime; - UnitXConverterResult result = new UnitXConverterResult(); + DefaultUnitXConverterResult result = new DefaultUnitXConverterResult(); // result.setStartValue(ctx.getStartValue()); result.setStartTypeId(fromType.getId()); result.setResultValue(ctx.getValue()); @@ -192,7 +194,7 @@ public final class UnitXConverterEngine { // System.out.println("runStep: "+step+" res: "+step.getStepReasons()); - UnitXConverterResultStep resultStep = new UnitXConverterResultStep(); + DefaultUnitXConverterResultStep resultStep = new DefaultUnitXConverterResultStep(); resultStep.setStartValue(valueOld); resultStep.setResultValue(getValue()); resultStep.setConvertTime(convertTime); diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXCGroupJump.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXCGroupJump.java new file mode 100644 index 0000000..6761af8 --- /dev/null +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXCGroupJump.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2013-2015, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.unitxc.model; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.Validate; + +import net.forwardfire.unitxc.model.step.UnitXConverterStep; + +/** + * The unit group jump. + * + * @author Willem Cazander + * @version 1.0 Apr 1, 2016 + */ +public class DefaultUnitXCGroupJump implements UnitXCGroupJump { + + private String id; + private String unitGroupId; + private final List toGroupConverterSteps; + private final List jumpParameters; + + public DefaultUnitXCGroupJump() { + toGroupConverterSteps = new ArrayList<>(); + jumpParameters = new ArrayList<>(); + } + + public UnitXCGroupJump validate() { + Validate.notBlank(id,"The id is blank"); + Validate.notBlank(unitGroupId,"The unitGroupId is blank of: "+id); + return this; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the toGroupId + */ + public String getUnitGroupId() { + return unitGroupId; + } + + /** + * @param unitGroupId the unitGroupId to set + */ + public void setUnitGroupId(String unitGroupId) { + this.unitGroupId = unitGroupId; + } + + /** + * @return the toGroupConverterSteps + */ + public List getToGroupConverterSteps() { + return toGroupConverterSteps; + } + + /** + * @param toGroupConverterSteps the toGroupConverterSteps to set + */ + public void setToBaseConverterSteps(List toGroupConverterSteps) { + this.toGroupConverterSteps.clear(); + this.toGroupConverterSteps.addAll(toGroupConverterSteps); + } + + /** + * @return the jumpParameters + */ + public List getJumpParameters() { + return jumpParameters; + } + + /** + * @param jumpParameters the jumpParameters to set + */ + public void setJumpParameters(List jumpParameters) { + this.jumpParameters.clear(); + this.jumpParameters.addAll(jumpParameters); + } + + public void addJumpParameter(UnitXCGroupJumpParameter jumpParameter) { + this.jumpParameters.add(Validate.notNull(jumpParameter)); + } +} diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXCGroupJumpParameter.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXCGroupJumpParameter.java new file mode 100644 index 0000000..b850908 --- /dev/null +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXCGroupJumpParameter.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2013-2015, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.unitxc.model; + +import org.apache.commons.lang3.Validate; + +/** + * The unit group jump. + * + * @author Willem Cazander + * @version 1.0 Apr 1, 2016 + */ +public class DefaultUnitXCGroupJumpParameter implements UnitXCGroupJumpParameter { + + private String id; + private String unitGroupId; + + public DefaultUnitXCGroupJumpParameter() { + } + + public DefaultUnitXCGroupJumpParameter(String id,String unitGroupId) { + setId(id); + setUnitGroupId(unitGroupId); + } + + public DefaultUnitXCGroupJumpParameter validate() { + Validate.notBlank(id,"The id is blank"); + Validate.notBlank(unitGroupId,"The unitGroup is blank of: "+id); + return this; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the unitGroupId + */ + public String getUnitGroupId() { + return unitGroupId; + } + + /** + * @param unitGroupId the unitGroupId to set + */ + public void setUnitGroupId(String unitGroupId) { + this.unitGroupId = unitGroupId; + } +} diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXConverterResult.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXConverterResult.java new file mode 100644 index 0000000..c3b0bf9 --- /dev/null +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXConverterResult.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2013-2015, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.unitxc.model; + +import java.util.List; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; + +/** + * Holds the convert result and meta steps how we got there. + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ +public class DefaultUnitXConverterResult implements UnitXConverterResult { + + private Double startValue; + private List resultSteps; + private Double resultValue; + private Long convertTime; + private String startTypeId; + private String resultTypeId; + + /** + * @return the startValue + */ + public Double getStartValue() { + return startValue; + } + + /** + * @param startValue the startValue to set + */ + public void setStartValue(Double startValue) { + this.startValue = startValue; + } + + /** + * @return the resultSteps + */ + public List getResultSteps() { + return resultSteps; + } + + /** + * @param resultSteps the resultSteps to set + */ + public void setResultSteps(List resultSteps) { + this.resultSteps = resultSteps; + } + + /** + * @return the resultValue + */ + public Double getResultValue() { + return resultValue; + } + + /** + * @param resultValue the resultValue to set + */ + public void setResultValue(Double resultValue) { + this.resultValue = resultValue; + } + + /** + * @return the convertTime + */ + public Long getConvertTime() { + return convertTime; + } + + /** + * @param convertTime the convertTime to set + */ + public void setConvertTime(Long convertTime) { + this.convertTime = convertTime; + } + + /** + * @return the startTypeId + */ + public String getStartTypeId() { + return startTypeId; + } + + /** + * @param startTypeId the startTypeId to set + */ + public void setStartTypeId(String startTypeId) { + this.startTypeId = startTypeId; + } + + /** + * @return the resultTypeId + */ + public String getResultTypeId() { + return resultTypeId; + } + + /** + * @param resultTypeId the resultTypeId to set + */ + public void setResultTypeId(String resultTypeId) { + this.resultTypeId = resultTypeId; + } + + @Override + public String toString() { + return ReflectionToStringBuilder.toString(this); + } +} diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXConverterResultStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXConverterResultStep.java new file mode 100644 index 0000000..e917f87 --- /dev/null +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/DefaultUnitXConverterResultStep.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2013-2015, Willem Cazander + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided + * that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list of conditions and the + * following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.forwardfire.unitxc.model; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; + +import net.forwardfire.unitxc.model.step.UnitXConverterStep; + +/** + * + * + * @author Willem Cazander + * @version 1.0 Oct 17, 2015 + */ +public class DefaultUnitXConverterResultStep implements UnitXConverterResultStep { + + private Double startValue; + private Double resultValue; + private Long convertTime; + private UnitXConverterStep convertStep; + + /** + * @return the startValue + */ + public Double getStartValue() { + return startValue; + } + + /** + * @param startValue the startValue to set + */ + public void setStartValue(Double startValue) { + this.startValue = startValue; + } + + /** + * @return the resultValue + */ + public Double getResultValue() { + return resultValue; + } + + /** + * @param resultValue the resultValue to set + */ + public void setResultValue(Double resultValue) { + this.resultValue = resultValue; + } + + /** + * @return the convertTime + */ + public Long getConvertTime() { + return convertTime; + } + + /** + * @param convertTime the convertTime to set + */ + public void setConvertTime(Long convertTime) { + this.convertTime = convertTime; + } + + /** + * @return the convertStep + */ + public UnitXConverterStep getConvertStep() { + return convertStep; + } + + /** + * @param convertStep the convertStep to set + */ + public void setConvertStep(UnitXConverterStep convertStep) { + this.convertStep = convertStep; + } + + @Override + public String toString() { + return ReflectionToStringBuilder.toString(this); + } +} diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupJump.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupJump.java index 46c82fd..7e92185 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupJump.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupJump.java @@ -36,82 +36,27 @@ import net.forwardfire.unitxc.model.step.UnitXConverterStep; * @author Willem Cazander * @version 1.0 Apr 1, 2016 */ -public class UnitXCGroupJump { +public interface UnitXCGroupJump { - private String id; - private String unitGroupId; - private final List toGroupConverterSteps; - private final List jumpParameters; - - public UnitXCGroupJump() { - toGroupConverterSteps = new ArrayList<>(); - jumpParameters = new ArrayList<>(); - } - - public UnitXCGroupJump validate() { - Validate.notBlank(id,"The id is blank"); - Validate.notBlank(unitGroupId,"The unitGroupId is blank of: "+id); - return this; - } + UnitXCGroupJump validate(); /** * @return the id */ - public String getId() { - return id; - } - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } + String getId(); /** * @return the toGroupId */ - public String getUnitGroupId() { - return unitGroupId; - } - - /** - * @param unitGroupId the unitGroupId to set - */ - public void setUnitGroupId(String unitGroupId) { - this.unitGroupId = unitGroupId; - } + String getUnitGroupId(); /** * @return the toGroupConverterSteps */ - public List getToGroupConverterSteps() { - return toGroupConverterSteps; - } - - /** - * @param toGroupConverterSteps the toGroupConverterSteps to set - */ - public void setToBaseConverterSteps(List toGroupConverterSteps) { - this.toGroupConverterSteps.clear(); - this.toGroupConverterSteps.addAll(toGroupConverterSteps); - } + List getToGroupConverterSteps(); /** * @return the jumpParameters */ - public List getJumpParameters() { - return jumpParameters; - } - - /** - * @param jumpParameters the jumpParameters to set - */ - public void setJumpParameters(List jumpParameters) { - this.jumpParameters.clear(); - this.jumpParameters.addAll(jumpParameters); - } - - public void addJumpParameter(UnitXCGroupJumpParameter jumpParameter) { - this.jumpParameters.add(Validate.notNull(jumpParameter)); - } + List getJumpParameters(); } diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupJumpParameter.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupJumpParameter.java index 6d4029c..8e9bdb0 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupJumpParameter.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXCGroupJumpParameter.java @@ -23,57 +23,23 @@ package net.forwardfire.unitxc.model; -import org.apache.commons.lang3.Validate; - /** * The unit group jump. * * @author Willem Cazander * @version 1.0 Apr 1, 2016 */ -public class UnitXCGroupJumpParameter { +public interface UnitXCGroupJumpParameter { - private String id; - private String unitGroupId; - - public UnitXCGroupJumpParameter() { - } - - public UnitXCGroupJumpParameter(String id,String unitGroupId) { - setId(id); - setUnitGroupId(unitGroupId); - } - - public UnitXCGroupJumpParameter validate() { - Validate.notBlank(id,"The id is blank"); - Validate.notBlank(unitGroupId,"The unitGroup is blank of: "+id); - return this; - } + UnitXCGroupJumpParameter validate(); /** * @return the id */ - public String getId() { - return id; - } - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } + String getId(); /** * @return the unitGroupId */ - public String getUnitGroupId() { - return unitGroupId; - } - - /** - * @param unitGroupId the unitGroupId to set - */ - public void setUnitGroupId(String unitGroupId) { - this.unitGroupId = unitGroupId; - } + String getUnitGroupId(); } diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResult.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResult.java index 3419cfb..da3a20c 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResult.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResult.java @@ -25,109 +25,41 @@ package net.forwardfire.unitxc.model; import java.util.List; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; - /** * Holds the convert result and meta steps how we got there. * * @author Willem Cazander * @version 1.0 Oct 17, 2015 */ -public class UnitXConverterResult { - - private Double startValue; - private List resultSteps; - private Double resultValue; - private Long convertTime; - private String startTypeId; - private String resultTypeId; +public interface UnitXConverterResult { /** * @return the startValue */ - public Double getStartValue() { - return startValue; - } - - /** - * @param startValue the startValue to set - */ - public void setStartValue(Double startValue) { - this.startValue = startValue; - } + Double getStartValue(); /** * @return the resultSteps */ - public List getResultSteps() { - return resultSteps; - } - - /** - * @param resultSteps the resultSteps to set - */ - public void setResultSteps(List resultSteps) { - this.resultSteps = resultSteps; - } + List getResultSteps(); /** * @return the resultValue */ - public Double getResultValue() { - return resultValue; - } - - /** - * @param resultValue the resultValue to set - */ - public void setResultValue(Double resultValue) { - this.resultValue = resultValue; - } + Double getResultValue(); /** * @return the convertTime */ - public Long getConvertTime() { - return convertTime; - } - - /** - * @param convertTime the convertTime to set - */ - public void setConvertTime(Long convertTime) { - this.convertTime = convertTime; - } + Long getConvertTime(); /** * @return the startTypeId */ - public String getStartTypeId() { - return startTypeId; - } - - /** - * @param startTypeId the startTypeId to set - */ - public void setStartTypeId(String startTypeId) { - this.startTypeId = startTypeId; - } + String getStartTypeId(); /** * @return the resultTypeId */ - public String getResultTypeId() { - return resultTypeId; - } - - /** - * @param resultTypeId the resultTypeId to set - */ - public void setResultTypeId(String resultTypeId) { - this.resultTypeId = resultTypeId; - } - - @Override - public String toString() { - return ReflectionToStringBuilder.toString(this); - } + String getResultTypeId(); } diff --git a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStep.java b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStep.java index 6266d15..d2c6fe1 100644 --- a/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStep.java +++ b/ff-unitxc-converter/src/main/java/net/forwardfire/unitxc/model/UnitXConverterResultStep.java @@ -23,8 +23,6 @@ package net.forwardfire.unitxc.model; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; - import net.forwardfire.unitxc.model.step.UnitXConverterStep; /** @@ -33,71 +31,26 @@ import net.forwardfire.unitxc.model.step.UnitXConverterStep; * @author Willem Cazander * @version 1.0 Oct 17, 2015 */ -public class UnitXConverterResultStep { - - private Double startValue; - private Double resultValue; - private Long convertTime; - private UnitXConverterStep convertStep; +public interface UnitXConverterResultStep { /** * @return the startValue */ - public Double getStartValue() { - return startValue; - } - - /** - * @param startValue the startValue to set - */ - public void setStartValue(Double startValue) { - this.startValue = startValue; - } + Double getStartValue(); /** * @return the resultValue */ - public Double getResultValue() { - return resultValue; - } - - /** - * @param resultValue the resultValue to set - */ - public void setResultValue(Double resultValue) { - this.resultValue = resultValue; - } + Double getResultValue(); /** * @return the convertTime */ - public Long getConvertTime() { - return convertTime; - } + Long getConvertTime(); - /** - * @param convertTime the convertTime to set - */ - public void setConvertTime(Long convertTime) { - this.convertTime = convertTime; - } /** * @return the convertStep */ - public UnitXConverterStep getConvertStep() { - return convertStep; - } - - /** - * @param convertStep the convertStep to set - */ - public void setConvertStep(UnitXConverterStep convertStep) { - this.convertStep = convertStep; - } - - @Override - public String toString() { - return ReflectionToStringBuilder.toString(this); - } + UnitXConverterStep getConvertStep(); }