protected static < K , V > void addOrRemoveProperty ( Map < K , V > props , K key , V value ) { if ( value == null ) { // Generic properties have already been added to the map. Remove them // so they aren't confused with the builtin properties. props . remove ( key ) ; } else { props . put ( key , value ) ; } }
Add the specified property if the value is non - null or remove it from the map if it is null .