All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xson.web.util.PropertyUtils Maven / Gradle / Ivy

Go to download

xco-web is an easy to use control layer framework, is part of the SOA system, using xml language to describe the controller.

The newest version!
package org.xson.web.util;

import java.util.Map;

public class PropertyUtils {

	public static int getIntValue(Map properties, String key, int defaultValue) {
		if (properties.containsKey(key)) {
			return Integer.parseInt(properties.get(key));
		}
		return defaultValue;
	}

	public static long getLongValue(Map properties, String key, long defaultValue) {
		if (properties.containsKey(key)) {
			return Long.parseLong(properties.get(key));
		}
		return defaultValue;
	}

	public static boolean getBooleanValue(Map properties, String key, boolean defaultValue) {
		if (properties.containsKey(key)) {
			return Boolean.parseBoolean(properties.get(key));
		}
		return defaultValue;
	}

	public static String getStringValue(Map properties, String key, String defaultValue) {
		if (properties.containsKey(key)) {
			return properties.get(key);
		}
		return defaultValue;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy