Fluent builder for creating a new Organisation, produced by newOrganisationBuilder(). Set the properties needed for the new organisation (org id, title, contact and address details, org types and their extra field values) then call build() to create it as a child of the current account or of an explicit parent org.
Group: Builders
Methods
orgId(String orgId) · title(String title) · email(String email) · phone(String phone) · parentOrg(Organisation parentOrg) · orgTypes(List<OrgType> orgTypes) · address(String address) · addressLine2(String addressLine2) · city(String city) · addressState(String addressState) · postcode(String postcode) · country(String country) · extraFields(Map<String,String> extraFields) · build()
orgId(String orgId)
Returns: OrganisationBuilder
Sets the org id (path-safe identifier) for the new organisation. If not set, one is generated from the title.
| Parameter | Description |
|---|---|
orgId | the org id to use |
title(String title)
Returns: OrganisationBuilder
Sets the display title for the new organisation. Either title or orgId must be set before calling build().
| Parameter | Description |
|---|---|
title | the display title to use |
email(String email)
Returns: OrganisationBuilder
Sets the contact email address for the new organisation.
| Parameter | Description |
|---|---|
email | the email address to use |
phone(String phone)
Returns: OrganisationBuilder
Sets the contact phone number for the new organisation.
| Parameter | Description |
|---|---|
phone | the phone number to use |
parentOrg(Organisation parentOrg)
Returns: OrganisationBuilder
Sets the parent organisation to create the new organisation under. If not set, the current account's admin organisation is used.
| Parameter | Description |
|---|---|
parentOrg | the parent organisation to use |
orgTypes(List<OrgType> orgTypes)
Returns: OrganisationBuilder
Sets the organisation types to apply to the new organisation.
| Parameter | Description |
|---|---|
orgTypes | the org types to apply |
address(String address)
Returns: OrganisationBuilder
Sets the first address line for the new organisation.
| Parameter | Description |
|---|---|
address | the address line to use |
addressLine2(String addressLine2)
Returns: OrganisationBuilder
Sets the second address line for the new organisation.
| Parameter | Description |
|---|---|
addressLine2 | the address line to use |
city(String city)
Returns: OrganisationBuilder
Sets the city for the new organisation's address.
| Parameter | Description |
|---|---|
city | the city to use |
addressState(String addressState)
Returns: OrganisationBuilder
Sets the state or region for the new organisation's address.
| Parameter | Description |
|---|---|
addressState | the state or region to use |
postcode(String postcode)
Returns: OrganisationBuilder
Sets the postcode for the new organisation's address.
| Parameter | Description |
|---|---|
postcode | the postcode to use |
country(String country)
Returns: OrganisationBuilder
Sets the country for the new organisation's address.
| Parameter | Description |
|---|---|
country | the country to use |
extraFields(Map<String,String> extraFields)
Returns: OrganisationBuilder
Sets custom field values to apply to the new organisation, keyed by field name, matched against the extra fields defined on the org types being applied.
| Parameter | Description |
|---|---|
extraFields | the custom field values to apply |
build()
Returns: Organisation
Creates the organisation described by this builder: generates an org id from the title if none was set, creates it as a child of the configured parent (or the current account), applies contact and address details, applies the configured org types and their extra field values, and saves it.