@Override
    public StringBuffer format(Object o, StringBuffer stringBuffer, FieldPosition fieldPosition) {
        Address address = (Address) o;
        String result = format;

        result = replace(result, "%p", address.getPostcode());
        result = replace(result, "%c", address.getCountry());
        result = replace(result, "%s", address.getState());
        result = replace(result, "%d", address.getDistrict());
        result = replace(result, "%t", address.getSettlement());
        result = replace(result, "%u", address.getSuburb());
        result = replace(result, "%r", address.getStreet());
        result = replace(result, "%h", address.getHouse());
        result = replace(result, "%f", address.getFormattedAddress());

        result = result.replaceAll("^[, ]*", "");

        return stringBuffer.append(result);
    }
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