private static String replace(String s, String key, String value) {
        if (value != null) {
            s = s.replace(key, value);
        } else {
            s = s.replaceAll("[, ]*" + key, "");
        }
        return s;
    }
Available parameters:

%p - postcode
%c - country
%s - state
%d - district
%t - settlement (town)
%u - suburb
%r - street (road)
%h - house
%f - formatted address
src/main/java/org/traccar/geocoder/AddressFormat.java