Converted all api back to interfaces
This commit is contained in:
parent
be484ade4e
commit
1701255350
|
@ -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<P> extends AbstractUnitXCBuilder<P,UnitXCGroupJump,UnitXCGroupJumpBuilder<P>> {
|
||||
public class UnitXCGroupJumpBuilder<P> extends AbstractUnitXCBuilder<P,DefaultUnitXCGroupJump,UnitXCGroupJumpBuilder<P>> {
|
||||
|
||||
public UnitXCGroupJumpBuilder(P parent, UnitXCGroup forGroup, String unitGroupId,BiConsumer<P, UnitXCGroupJump> parentBuilder) {
|
||||
super(parent, new UnitXCGroupJump(), parentBuilder);
|
||||
public UnitXCGroupJumpBuilder(P parent, UnitXCGroup forGroup, String unitGroupId,BiConsumer<P, DefaultUnitXCGroupJump> parentBuilder) {
|
||||
super(parent, new DefaultUnitXCGroupJump(), parentBuilder);
|
||||
getValue().setUnitGroupId(unitGroupId);
|
||||
getValue().setId(forGroup.getId()+"_"+unitGroupId);
|
||||
}
|
||||
|
@ -54,7 +55,7 @@ public class UnitXCGroupJumpBuilder<P> extends AbstractUnitXCBuilder<P,UnitXCGro
|
|||
}
|
||||
|
||||
public UnitXCGroupJumpBuilder<P> 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<UnitXCGroupJumpBuilder<P>> createToGroupConverterSteps() {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<UnitXConverterStep> toGroupConverterSteps;
|
||||
private final List<UnitXCGroupJumpParameter> 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<UnitXConverterStep> getToGroupConverterSteps() {
|
||||
return toGroupConverterSteps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param toGroupConverterSteps the toGroupConverterSteps to set
|
||||
*/
|
||||
public void setToBaseConverterSteps(List<UnitXConverterStep> toGroupConverterSteps) {
|
||||
this.toGroupConverterSteps.clear();
|
||||
this.toGroupConverterSteps.addAll(toGroupConverterSteps);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the jumpParameters
|
||||
*/
|
||||
public List<UnitXCGroupJumpParameter> getJumpParameters() {
|
||||
return jumpParameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jumpParameters the jumpParameters to set
|
||||
*/
|
||||
public void setJumpParameters(List<UnitXCGroupJumpParameter> jumpParameters) {
|
||||
this.jumpParameters.clear();
|
||||
this.jumpParameters.addAll(jumpParameters);
|
||||
}
|
||||
|
||||
public void addJumpParameter(UnitXCGroupJumpParameter jumpParameter) {
|
||||
this.jumpParameters.add(Validate.notNull(jumpParameter));
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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<UnitXConverterResultStep> 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<UnitXConverterResultStep> getResultSteps() {
|
||||
return resultSteps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resultSteps the resultSteps to set
|
||||
*/
|
||||
public void setResultSteps(List<UnitXConverterResultStep> 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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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<UnitXConverterStep> toGroupConverterSteps;
|
||||
private final List<UnitXCGroupJumpParameter> 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<UnitXConverterStep> getToGroupConverterSteps() {
|
||||
return toGroupConverterSteps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param toGroupConverterSteps the toGroupConverterSteps to set
|
||||
*/
|
||||
public void setToBaseConverterSteps(List<UnitXConverterStep> toGroupConverterSteps) {
|
||||
this.toGroupConverterSteps.clear();
|
||||
this.toGroupConverterSteps.addAll(toGroupConverterSteps);
|
||||
}
|
||||
List<UnitXConverterStep> getToGroupConverterSteps();
|
||||
|
||||
/**
|
||||
* @return the jumpParameters
|
||||
*/
|
||||
public List<UnitXCGroupJumpParameter> getJumpParameters() {
|
||||
return jumpParameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jumpParameters the jumpParameters to set
|
||||
*/
|
||||
public void setJumpParameters(List<UnitXCGroupJumpParameter> jumpParameters) {
|
||||
this.jumpParameters.clear();
|
||||
this.jumpParameters.addAll(jumpParameters);
|
||||
}
|
||||
|
||||
public void addJumpParameter(UnitXCGroupJumpParameter jumpParameter) {
|
||||
this.jumpParameters.add(Validate.notNull(jumpParameter));
|
||||
}
|
||||
List<UnitXCGroupJumpParameter> getJumpParameters();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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<UnitXConverterResultStep> 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<UnitXConverterResultStep> getResultSteps() {
|
||||
return resultSteps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resultSteps the resultSteps to set
|
||||
*/
|
||||
public void setResultSteps(List<UnitXConverterResultStep> resultSteps) {
|
||||
this.resultSteps = resultSteps;
|
||||
}
|
||||
List<UnitXConverterResultStep> 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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue