public class Size implements Comparable<Size> {
private int max = 240;
- private int min = 20;
+ private int min = 40;
private int size;
Size() {
setSize(size);
}
+ public int getMin() {
+ return min;
+ }
+
+ public int getMax() {
+ return max;
+ }
+
public int getSize() {
return size;
}
if (validateSize(size)) {
this.size = size;
} else {
- throw new IllegalArgumentException("Size must be between " + this.min + " and " + this.max);
+ throw new IllegalArgumentException("Size must be between " + this.getMin() + " and " + this.getMax());
}
}
private boolean validateSize(int size) {
- return (size >= min && size <= max);
+ return (size >= getMin() && size <= getMax());
}
@Override