/** * Get an int property. * @param type The type. * @return Returns the parsed int value, 0 if not set. */ public static int getIntProperty(Properties[] props, String type) { Property prop = getLatestProperty(props, type); return prop==null? 0: Integer.parseInt(prop.getValue()); }
/** * Get an int property. * @param type The type. * @return Returns the parsed int value, 0 if not set. */ public int getIntProperty(String type) { Property prop = getLatestProperty(type); return prop==null? 0: Integer.parseInt(prop.getValue()); }
/** * Get a boolean property. * @param type The type. * @return Returns false if the property is not set. */ public boolean getBooleanProperty(String type) { Property prop = getLatestProperty(type); //return prop!=null && Boolean.parseBoolean(prop.getValue()); return prop!=null && Boolean.valueOf(prop.getValue()).booleanValue(); }
/** * Get a long property. * @param type The type. * @return Returns the parsed long value, 0 if not set. */ public static long getLongProperty(Properties[] props, String type) { Property prop = getLatestProperty(props, type); return prop==null? 0: Long.parseLong(prop.getValue()); }
/** * Get a double property. * @param type The type. * @return Returns the parsed double value, 0 if not set. */ public double getDoubleProperty(String type) { Property prop = getLatestProperty(type); return prop==null? 0: Double.parseDouble(prop.getValue()); }
/** * Get a boolean property. * @param type The type. * @return Returns false if the property is not set. */ public static boolean getBooleanProperty(Properties[] props, String type) { Property prop = getLatestProperty(props, type); return prop!=null && Boolean.valueOf(prop.getValue()).booleanValue(); }
/** * Get a string property. * @param type The type. * @return Returns the string value or null if not set. */ public static String getStringProperty(Properties[] props, String type) { Property prop = getLatestProperty(props, type); return prop==null? null: prop.getValue(); }
/** * Get a long property. * @param type The type. * @return Returns the parsed long value, 0 if not set. */ public long getLongProperty(String type) { Property prop = getLatestProperty(type); return prop==null? 0: Long.parseLong(prop.getValue()); }
/** * Get a string property. * @param type The type. * @return Returns the string value or null if not set. */ public String getStringProperty(String type) { Property prop = getLatestProperty(type); return prop==null? null: prop.getValue(); }