[Minor] code cleanup

This commit is contained in:
Robert von Burg 2018-06-26 17:04:36 +02:00
parent fd50661406
commit 858bf76d65
11 changed files with 66 additions and 52 deletions

View File

@ -1,12 +1,12 @@
/* /*
* Copyright 2013 Robert von Burg <eitch@eitchnet.ch> * Copyright 2013 Robert von Burg <eitch@eitchnet.ch>
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -38,10 +38,13 @@ public class BooleanParameter extends AbstractParameter<Boolean> {
/** /**
* Default constructors * Default constructors
* *
* @param id the id * @param id
* @param name the name * the id
* @param value the value * @param name
* the name
* @param value
* the value
*/ */
public BooleanParameter(String id, String name, Boolean value) { public BooleanParameter(String id, String name, Boolean value) {
super(id, name); super(id, name);
@ -73,7 +76,7 @@ public class BooleanParameter extends AbstractParameter<Boolean> {
/** /**
* Sets the value to false * Sets the value to false
* *
* @see Parameter#clear() * @see Parameter#clear()
*/ */
@Override @Override
@ -92,6 +95,11 @@ public class BooleanParameter extends AbstractParameter<Boolean> {
return StrolchValueType.BOOLEAN.getType(); return StrolchValueType.BOOLEAN.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.BOOLEAN;
}
@Override @Override
public BooleanParameter getClone() { public BooleanParameter getClone() {
BooleanParameter clone = new BooleanParameter(); BooleanParameter clone = new BooleanParameter();
@ -118,8 +126,4 @@ public class BooleanParameter extends AbstractParameter<Boolean> {
return this.getValue().compareTo(((BooleanParameter) o).getValue()); return this.getValue().compareTo(((BooleanParameter) o).getValue());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.BOOLEAN;
}
} }

View File

@ -98,6 +98,11 @@ public class DateParameter extends AbstractParameter<Date> {
return StrolchValueType.DATE.getType(); return StrolchValueType.DATE.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.DATE;
}
@Override @Override
public DateParameter getClone() { public DateParameter getClone() {
DateParameter clone = new DateParameter(); DateParameter clone = new DateParameter();
@ -124,8 +129,4 @@ public class DateParameter extends AbstractParameter<Date> {
return this.getValue().compareTo(((DateParameter) o).getValue()); return this.getValue().compareTo(((DateParameter) o).getValue());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.DATE;
}
} }

View File

@ -95,6 +95,11 @@ public class DurationParameter extends AbstractParameter<Long> {
return StrolchValueType.DURATION.getType(); return StrolchValueType.DURATION.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.DURATION;
}
@Override @Override
public DurationParameter getClone() { public DurationParameter getClone() {
DurationParameter clone = new DurationParameter(); DurationParameter clone = new DurationParameter();
@ -121,8 +126,4 @@ public class DurationParameter extends AbstractParameter<Long> {
return this.getValue().compareTo(((DurationParameter) o).getValue()); return this.getValue().compareTo(((DurationParameter) o).getValue());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.DURATION;
}
} }

View File

@ -134,6 +134,11 @@ public class FloatListParameter extends AbstractParameter<List<Double>> implemen
return StrolchValueType.FLOAT_LIST.getType(); return StrolchValueType.FLOAT_LIST.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.FLOAT_LIST;
}
@Override @Override
public FloatListParameter getClone() { public FloatListParameter getClone() {
FloatListParameter clone = new FloatListParameter(); FloatListParameter clone = new FloatListParameter();
@ -174,8 +179,4 @@ public class FloatListParameter extends AbstractParameter<List<Double>> implemen
return Integer.compare(this.getValue().size(), ((FloatListParameter) o).getValue().size()); return Integer.compare(this.getValue().size(), ((FloatListParameter) o).getValue().size());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.FLOAT_LIST;
}
} }

View File

@ -96,6 +96,11 @@ public class FloatParameter extends AbstractParameter<Double> {
return StrolchValueType.FLOAT.getType(); return StrolchValueType.FLOAT.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.FLOAT;
}
@Override @Override
public FloatParameter getClone() { public FloatParameter getClone() {
FloatParameter clone = new FloatParameter(); FloatParameter clone = new FloatParameter();
@ -122,8 +127,4 @@ public class FloatParameter extends AbstractParameter<Double> {
return this.getValue().compareTo(((FloatParameter) o).getValue()); return this.getValue().compareTo(((FloatParameter) o).getValue());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.FLOAT;
}
} }

View File

@ -134,6 +134,11 @@ public class IntegerListParameter extends AbstractParameter<List<Integer>> imple
return StrolchValueType.INTEGER_LIST.getType(); return StrolchValueType.INTEGER_LIST.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.INTEGER_LIST;
}
@Override @Override
public IntegerListParameter getClone() { public IntegerListParameter getClone() {
IntegerListParameter clone = new IntegerListParameter(); IntegerListParameter clone = new IntegerListParameter();
@ -174,8 +179,4 @@ public class IntegerListParameter extends AbstractParameter<List<Integer>> imple
return Integer.compare(this.getValue().size(), ((IntegerListParameter) o).getValue().size()); return Integer.compare(this.getValue().size(), ((IntegerListParameter) o).getValue().size());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.INTEGER_LIST;
}
} }

View File

@ -55,6 +55,11 @@ public class IntegerParameter extends AbstractParameter<Integer> {
return StrolchValueType.INTEGER.getType(); return StrolchValueType.INTEGER.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.INTEGER;
}
@Override @Override
public String getValueAsString() { public String getValueAsString() {
return Integer.toString(this.value); return Integer.toString(this.value);
@ -120,8 +125,4 @@ public class IntegerParameter extends AbstractParameter<Integer> {
return this.getValue().compareTo(((IntegerParameter) o).getValue()); return this.getValue().compareTo(((IntegerParameter) o).getValue());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.INTEGER;
}
} }

View File

@ -134,6 +134,11 @@ public class LongListParameter extends AbstractParameter<List<Long>> implements
return StrolchValueType.LONG_LIST.getType(); return StrolchValueType.LONG_LIST.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.LONG_LIST;
}
@Override @Override
public LongListParameter getClone() { public LongListParameter getClone() {
LongListParameter clone = new LongListParameter(); LongListParameter clone = new LongListParameter();
@ -174,8 +179,4 @@ public class LongListParameter extends AbstractParameter<List<Long>> implements
return Integer.compare(this.getValue().size(), ((LongListParameter) o).getValue().size()); return Integer.compare(this.getValue().size(), ((LongListParameter) o).getValue().size());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.LONG_LIST;
}
} }

View File

@ -94,6 +94,11 @@ public class LongParameter extends AbstractParameter<Long> {
return StrolchValueType.LONG.getType(); return StrolchValueType.LONG.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.LONG;
}
@Override @Override
public LongParameter getClone() { public LongParameter getClone() {
LongParameter clone = new LongParameter(); LongParameter clone = new LongParameter();
@ -120,8 +125,4 @@ public class LongParameter extends AbstractParameter<Long> {
return this.getValue().compareTo(((LongParameter) o).getValue()); return this.getValue().compareTo(((LongParameter) o).getValue());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.LONG;
}
} }

View File

@ -134,6 +134,11 @@ public class StringListParameter extends AbstractParameter<List<String>> impleme
return StrolchValueType.STRING_LIST.getType(); return StrolchValueType.STRING_LIST.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.STRING_LIST;
}
@Override @Override
public StringListParameter getClone() { public StringListParameter getClone() {
StringListParameter clone = new StringListParameter(); StringListParameter clone = new StringListParameter();
@ -174,8 +179,4 @@ public class StringListParameter extends AbstractParameter<List<String>> impleme
return Integer.compare(this.getValue().size(), ((StringListParameter) o).getValue().size()); return Integer.compare(this.getValue().size(), ((StringListParameter) o).getValue().size());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.STRING_LIST;
}
} }

View File

@ -55,6 +55,11 @@ public class StringParameter extends AbstractParameter<String> {
return StrolchValueType.STRING.getType(); return StrolchValueType.STRING.getType();
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.STRING;
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public String getValue() { public String getValue() {
@ -118,8 +123,4 @@ public class StringParameter extends AbstractParameter<String> {
return this.getValue().compareToIgnoreCase(((StringParameter) o).getValue()); return this.getValue().compareToIgnoreCase(((StringParameter) o).getValue());
} }
@Override
public StrolchValueType getValueType() {
return StrolchValueType.STRING;
}
} }