class LdapFilter {

    String filterString() {
        if (isSerialNumberSearch()) {
            return String.format(Locale.US, "(serialNumber=%s)", query);
        } else {
            return String.format(Locale.US, "(cn=*%s*)", query);
        }
    }

      LdapFilter(String query);

}