Builds a set of match criteria for finding organisations, used by OrganisationManager.findMatching and OrganisationManager.findMatchingES. Created via OrganisationManager.newOrgMatchRequest, then populated using the fluent setter methods for the fields to match on (org id, title, email, address and so on) and the match type to apply to text fields. Criteria can be nested via newSubCriteria and combined with and or or.


Properties

PropertyReturnsDescription
addressStringThe address criterion set on this request.
addressLine2StringThe second address line criterion set on this request.
cityStringThe city criterion set on this request.
combineWithAndbooleanWhether this request's criteria, and any nested sub-criteria, are combined with AND rather than OR.
countryStringThe country criterion set on this request.
deletedBooleanWhether this request is restricted to deleted or to non-deleted organisations.
emailStringThe email address criterion set on this request.
matchTypeMatchTypeThe text match type applied to the text criteria on this request, such as title, email and address.
orgIdStringThe org id criterion set on this request.
orgTypesList<OrgType>The set of org types a matching organisation must belong to one of, built up via addOrgType.
phoneStringThe phone number field on this request. Note that the phone builder method does not actually populate this field (see phone), so this getter typically returns null even after calling phone.
postcodeStringThe postcode criterion set on this request.
requestsList<OrgMatchRequest>The nested sub-requests added via newSubCriteria, whose own criteria are combined into this request's match.
stateStringThe state criterion set on this request.
titleStringThe title criterion set on this request.

Methods

findMatching() · getMatchType() · maxResults(Integer i) · matchType(MatchType matchType) · matchTypeEquals() · matchTypeEqualsCaseInsensitive() · matchTypeStartsWith() · matchTypeStartsWith(boolean caseSensitive) · deleted(boolean b) · entityIds(List<Long> ids) · orgId(String s) · title(String s) · email(String s) · phone(String s) · address(String s) · addressLine2(String s) · city(String s) · state(String s) · postcode(String s) · country(String s) · addOrgType(OrgType orgType) · and() · or() · newSubCriteria() · isCombineWithAnd() · getDeleted() · getOrgId() · getTitle() · getEmail() · getPhone() · getAddress() · getAddressLine2() · getCity() · getState() · getPostcode() · getCountry() · getRequests() · getOrgTypes() · hasCriteria()

findMatching()

Returns: List<Organisation>

Runs this request against the current account's organisations and returns the matches. Equivalent to calling OrganisationManager.findMatching with this request. This is a database query, so it may be expensive on large accounts.

getMatchType()

Returns: MatchType

The text match type applied to the text criteria on this request, such as title, email and address.

maxResults(Integer i)

Returns: OrgMatchRequest

Sets the maximum number of organisations to return.

ParameterDescription
ithe maximum number of results, or null for no limit

matchType(MatchType matchType)

Returns: OrgMatchRequest

Sets the text match type applied to the text criteria on this request, such as title, email and address.

ParameterDescription
matchTypethe match type to apply

matchTypeEquals()

Returns: OrgMatchRequest

Sets the text match type to case-sensitive exact equals.

matchTypeEqualsCaseInsensitive()

Returns: OrgMatchRequest

Sets the text match type to case-insensitive exact equals.

matchTypeStartsWith()

Returns: OrgMatchRequest

Sets the text match type to case-insensitive starts-with.

matchTypeStartsWith(boolean caseSensitive)

Returns: OrgMatchRequest

Sets the text match type to starts-with, with case sensitivity as given by caseSensitive.

ParameterDescription
caseSensitivetrue for a case-sensitive starts-with match, false for a case-insensitive one

deleted(boolean b)

Returns: OrgMatchRequest

Restricts the match to deleted organisations, or to non-deleted organisations.

ParameterDescription
btrue to match only deleted organisations, false to match only non-deleted organisations

entityIds(List<Long> ids)

Returns: OrgMatchRequest

Restricts the match to organisations with one of the given entity ids.

ParameterDescription
idsthe entity ids to match

orgId(String s)

Returns: OrgMatchRequest

Sets the org id to match. Logs the value at info level. Ignored if s is blank.

ParameterDescription
sthe org id to match

title(String s)

Returns: OrgMatchRequest

Sets the title to match. Ignored if s is blank.

ParameterDescription
sthe title to match

email(String s)

Returns: OrgMatchRequest

Sets the email address to match. Ignored if s is blank.

ParameterDescription
sthe email address to match

phone(String s)

Returns: OrgMatchRequest

Intended to set the phone number to match, but the current implementation sets the org id criterion instead (the same field set by orgId), so calling this does not filter on phone number. Ignored if s is blank.

ParameterDescription
sthe value assigned to the org id criterion

address(String s)

Returns: OrgMatchRequest

Sets the first address line to match. Ignored if s is blank.

ParameterDescription
sthe address to match

addressLine2(String s)

Returns: OrgMatchRequest

Sets the second address line to match. Ignored if s is blank.

ParameterDescription
sthe second address line to match

city(String s)

Returns: OrgMatchRequest

Sets the city to match. Ignored if s is blank.

ParameterDescription
sthe city to match

state(String s)

Returns: OrgMatchRequest

Sets the state to match. Ignored if s is blank.

ParameterDescription
sthe state to match

postcode(String s)

Returns: OrgMatchRequest

Sets the postcode to match. Ignored if s is blank.

ParameterDescription
sthe postcode to match

country(String s)

Returns: OrgMatchRequest

Sets the country to match. Ignored if s is blank.

ParameterDescription
sthe country to match

addOrgType(OrgType orgType)

Returns: OrgMatchRequest

Adds an org type that a matching organisation must have one of. Can be called more than once to match any of several org types. Ignored if orgType is null.

ParameterDescription
orgTypethe org type to add to the set of acceptable org types

and()

Returns: OrgMatchRequest

Sets this request's criteria, and any sub-criteria added via newSubCriteria, to be combined with AND.

or()

Returns: OrgMatchRequest

Sets this request's criteria, and any sub-criteria added via newSubCriteria, to be combined with OR.

newSubCriteria()

Returns: OrgMatchRequest

Creates a new, empty sub-request, adds it to this request's list of nested criteria, and returns it so it can be populated. The sub-request's own criteria are combined with the parent's other criteria according to and or or.

isCombineWithAnd()

Returns: boolean

Whether this request's criteria, and any nested sub-criteria, are combined with AND rather than OR.

getDeleted()

Returns: Boolean

Whether this request is restricted to deleted or to non-deleted organisations.

getOrgId()

Returns: String

The org id criterion set on this request.

getTitle()

Returns: String

The title criterion set on this request.

getEmail()

Returns: String

The email address criterion set on this request.

getPhone()

Returns: String

The phone number field on this request. Note that the phone builder method does not actually populate this field (see phone), so this getter typically returns null even after calling phone.

getAddress()

Returns: String

The address criterion set on this request.

getAddressLine2()

Returns: String

The second address line criterion set on this request.

getCity()

Returns: String

The city criterion set on this request.

getState()

Returns: String

The state criterion set on this request.

getPostcode()

Returns: String

The postcode criterion set on this request.

getCountry()

Returns: String

The country criterion set on this request.

getRequests()

Returns: List<OrgMatchRequest>

The nested sub-requests added via newSubCriteria, whose own criteria are combined into this request's match.

getOrgTypes()

Returns: List<OrgType>

The set of org types a matching organisation must belong to one of, built up via addOrgType.

hasCriteria()

Returns: boolean

Whether this request has any criteria set, either directly or via a nested sub-request. Used to decide whether the request is worth running as a search.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.