Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Properties; public class Main { /** * Don't add this property if it's equal to its default value. */ public static void setProperty(Properties p, String name, String value, String def) { if (!def.equals(value) && value != null) { p.setProperty(name, value); } } }