public DoubleSizeConstraint(OperationContext context, Storage storage) throws InvalidInputException { super(context, storage, Double.class); this.minSize = storage.get(KEY_MIN_SIZE, Double.class, -1.0); this.maxSize = storage.get(KEY_MAX_SIZE, Double.class, -1.0); if (minSize == -1 && maxSize == -1) { throw new InvalidInputException("Neither min-size nor max-size is set."); } else if (maxSize != -1 && maxSize < minSize) { throw new InvalidInputException( "Max length is smaller than min length. (min: " + minSize + " max: " + maxSize + ")"); } }