Here you can find the source of getIntInRange(Properties props, String name, int defaultValue, int min, int max)
public static int getIntInRange(Properties props, String name, int defaultValue, int min, int max)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static int getIntInRange(Properties props, String name, int defaultValue, int min, int max) { int v = defaultValue; if (props.containsKey(name)) { v = Integer.valueOf(props.getProperty(name)); }/*from w w w. j a v a 2s. co m*/ if (v >= min && v <= max) { return v; } throw new IllegalArgumentException(name + " has value " + v + " which is not in the range"); } }