Class RdapSearchPattern
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic RdapSearchPattern
createFromLdhDomainName
(String searchQuery) Creates a SearchPattern using the provided domain search pattern in LDH format.static RdapSearchPattern
createFromLdhOrUnicodeDomainName
(String searchQuery) Creates a SearchPattern using the provided domain search pattern in LDH or Unicode format.static RdapSearchPattern
createFromUnicodeString
(String searchQuery) Creates a SearchPattern using the provided search pattern string in Unicode.boolean
Attempts to return the next string in sort order afterinitialString
.boolean
Checks a string to make sure that it matches the search pattern.
-
Method Details
-
getInitialString
-
getHasWildcard
public boolean getHasWildcard() -
getSuffix
-
getNextInitialString
Attempts to return the next string in sort order afterinitialString
. This can be used to convert a wildcard query into a range query, by looking for strings greater than or equal toinitialString
and less thannextInitialString
. -
createFromUnicodeString
Creates a SearchPattern using the provided search pattern string in Unicode.The search query might end in an asterix, in which case that asterix is considered a wildcard and can match 0 or more characters. Without that asterix - the match will be exact.
- Parameters:
searchQuery
- the string containing the partial match pattern, optionally ending in a wildcard asterix- Throws:
HttpException.UnprocessableEntityException
- ifpattern
has a wildcard not at the end of the query
-
createFromLdhDomainName
Creates a SearchPattern using the provided domain search pattern in LDH format.The domain search pattern can have a single wildcard asterix that can match 0 or more charecters. If such an asterix exists - it must be at the end of a domain label.
- Parameters:
searchQuery
- the string containing the partial match pattern- Throws:
HttpException.UnprocessableEntityException
- ifpattern
does not meet the requirements of RFC 7482
-
createFromLdhOrUnicodeDomainName
Creates a SearchPattern using the provided domain search pattern in LDH or Unicode format.The domain search pattern can have a single wildcard asterix that can match 0 or more charecters. If such an asterix exists - it must be at the end of a domain label.
In theory, according to RFC 9082 4.1 - we should make some checks about partial matching in unicode queries. We don't, but we might want to just disable partial matches for unicode inputs (meaning if it doesn't match LDH_PATTERN, then don't allow wildcard at all).
- Parameters:
searchQuery
- the string containing the partial match pattern- Throws:
HttpException.UnprocessableEntityException
- ifpattern
does not meet the requirements of RFC 7482
-
matches
Checks a string to make sure that it matches the search pattern.- Parameters:
string
- the string to be matched- Returns:
- true if the pattern matches the string
-