public final class MemberAddResult extends Object
This class is a tagged union. Tagged unions instances are always
associated to a specific tag. This means only one of the isAbc()
methods will return true
. You can use tag()
to determine the
tag associated with this instance.
Modifier and Type | Class and Description |
---|---|
static class |
MemberAddResult.Tag
Discriminating tag type for
MemberAddResult . |
Modifier and Type | Method and Description |
---|---|
static MemberAddResult |
duplicateExternalMemberId(String value)
Returns an instance of
MemberAddResult that has its tag set to
MemberAddResult.Tag.DUPLICATE_EXTERNAL_MEMBER_ID . |
boolean |
equals(Object obj) |
static MemberAddResult |
freeTeamMemberLimitReached(String value)
Returns an instance of
MemberAddResult that has its tag set to
MemberAddResult.Tag.FREE_TEAM_MEMBER_LIMIT_REACHED . |
String |
getDuplicateExternalMemberIdValue()
A user with the given external member ID already exists on the team
(including in recoverable state).
|
String |
getFreeTeamMemberLimitReachedValue()
Team is already full.
|
TeamMemberInfo |
getSuccessValue()
Describes a user that was successfully added to the team.
|
String |
getTeamLicenseLimitValue()
Team is already full.
|
String |
getUserAlreadyOnTeamValue()
User is already on this team.
|
String |
getUserAlreadyPairedValue()
User is already paired.
|
String |
getUserCreationFailedValue()
User creation has failed.
|
String |
getUserMigrationFailedValue()
User migration has failed.
|
String |
getUserOnAnotherTeamValue()
User is already on another team.
|
int |
hashCode() |
boolean |
isDuplicateExternalMemberId()
Returns
true if this instance has the tag MemberAddResult.Tag.DUPLICATE_EXTERNAL_MEMBER_ID , false otherwise. |
boolean |
isFreeTeamMemberLimitReached()
Returns
true if this instance has the tag MemberAddResult.Tag.FREE_TEAM_MEMBER_LIMIT_REACHED , false otherwise. |
boolean |
isSuccess()
|
boolean |
isTeamLicenseLimit()
|
boolean |
isUserAlreadyOnTeam()
Returns
true if this instance has the tag MemberAddResult.Tag.USER_ALREADY_ON_TEAM , false otherwise. |
boolean |
isUserAlreadyPaired()
|
boolean |
isUserCreationFailed()
Returns
true if this instance has the tag MemberAddResult.Tag.USER_CREATION_FAILED , false otherwise. |
boolean |
isUserMigrationFailed()
Returns
true if this instance has the tag MemberAddResult.Tag.USER_MIGRATION_FAILED , false otherwise. |
boolean |
isUserOnAnotherTeam()
Returns
true if this instance has the tag MemberAddResult.Tag.USER_ON_ANOTHER_TEAM , false otherwise. |
static MemberAddResult |
success(TeamMemberInfo value)
Returns an instance of
MemberAddResult that has its tag set to
MemberAddResult.Tag.SUCCESS . |
MemberAddResult.Tag |
tag()
Returns the tag for this instance.
|
static MemberAddResult |
teamLicenseLimit(String value)
Returns an instance of
MemberAddResult that has its tag set to
MemberAddResult.Tag.TEAM_LICENSE_LIMIT . |
String |
toString() |
String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
static MemberAddResult |
userAlreadyOnTeam(String value)
Returns an instance of
MemberAddResult that has its tag set to
MemberAddResult.Tag.USER_ALREADY_ON_TEAM . |
static MemberAddResult |
userAlreadyPaired(String value)
Returns an instance of
MemberAddResult that has its tag set to
MemberAddResult.Tag.USER_ALREADY_PAIRED . |
static MemberAddResult |
userCreationFailed(String value)
Returns an instance of
MemberAddResult that has its tag set to
MemberAddResult.Tag.USER_CREATION_FAILED . |
static MemberAddResult |
userMigrationFailed(String value)
Returns an instance of
MemberAddResult that has its tag set to
MemberAddResult.Tag.USER_MIGRATION_FAILED . |
static MemberAddResult |
userOnAnotherTeam(String value)
Returns an instance of
MemberAddResult that has its tag set to
MemberAddResult.Tag.USER_ON_ANOTHER_TEAM . |
public MemberAddResult.Tag tag()
This class is a tagged union. Tagged unions instances are always
associated to a specific tag. This means only one of the isXyz()
methods will return true
. Callers are recommended to use the tag
value in a switch
statement to properly handle the different
values for this MemberAddResult
.
public boolean isSuccess()
true
if this instance is tagged as MemberAddResult.Tag.SUCCESS
,
false
otherwise.public static MemberAddResult success(TeamMemberInfo value)
MemberAddResult
that has its tag set to
MemberAddResult.Tag.SUCCESS
.
Describes a user that was successfully added to the team.
value
- value to assign to this instance.MemberAddResult
with its tag set to MemberAddResult.Tag.SUCCESS
.IllegalArgumentException
- if value
is null
.public TeamMemberInfo getSuccessValue()
This instance must be tagged as MemberAddResult.Tag.SUCCESS
.
TeamMemberInfo
value associated with this instance if
isSuccess()
is true
.IllegalStateException
- If isSuccess()
is false
.public boolean isTeamLicenseLimit()
true
if this instance is tagged as MemberAddResult.Tag.TEAM_LICENSE_LIMIT
, false
otherwise.public static MemberAddResult teamLicenseLimit(String value)
MemberAddResult
that has its tag set to
MemberAddResult.Tag.TEAM_LICENSE_LIMIT
.
Team is already full. The organization has no available licenses.
value
- value to assign to this instance.MemberAddResult
with its tag set to MemberAddResult.Tag.TEAM_LICENSE_LIMIT
.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$
",
or is null
.public String getTeamLicenseLimitValue()
This instance must be tagged as MemberAddResult.Tag.TEAM_LICENSE_LIMIT
.
String
value associated with this instance if isTeamLicenseLimit()
is true
.IllegalStateException
- If isTeamLicenseLimit()
is false
.public boolean isFreeTeamMemberLimitReached()
true
if this instance has the tag MemberAddResult.Tag.FREE_TEAM_MEMBER_LIMIT_REACHED
, false
otherwise.true
if this instance is tagged as MemberAddResult.Tag.FREE_TEAM_MEMBER_LIMIT_REACHED
, false
otherwise.public static MemberAddResult freeTeamMemberLimitReached(String value)
MemberAddResult
that has its tag set to
MemberAddResult.Tag.FREE_TEAM_MEMBER_LIMIT_REACHED
.
Team is already full. The free team member limit has been reached.
value
- value to assign to this instance.MemberAddResult
with its tag set to MemberAddResult.Tag.FREE_TEAM_MEMBER_LIMIT_REACHED
.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$
",
or is null
.public String getFreeTeamMemberLimitReachedValue()
This instance must be tagged as MemberAddResult.Tag.FREE_TEAM_MEMBER_LIMIT_REACHED
.
String
value associated with this instance if isFreeTeamMemberLimitReached()
is true
.IllegalStateException
- If isFreeTeamMemberLimitReached()
is false
.public boolean isUserAlreadyOnTeam()
true
if this instance has the tag MemberAddResult.Tag.USER_ALREADY_ON_TEAM
, false
otherwise.true
if this instance is tagged as MemberAddResult.Tag.USER_ALREADY_ON_TEAM
, false
otherwise.public static MemberAddResult userAlreadyOnTeam(String value)
MemberAddResult
that has its tag set to
MemberAddResult.Tag.USER_ALREADY_ON_TEAM
.
User is already on this team. The provided email address is associated with a user who is already a member of (including in recoverable state) or invited to the team.
value
- value to assign to this instance.MemberAddResult
with its tag set to MemberAddResult.Tag.USER_ALREADY_ON_TEAM
.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$
",
or is null
.public String getUserAlreadyOnTeamValue()
This instance must be tagged as MemberAddResult.Tag.USER_ALREADY_ON_TEAM
.
String
value associated with this instance if isUserAlreadyOnTeam()
is true
.IllegalStateException
- If isUserAlreadyOnTeam()
is false
.public boolean isUserOnAnotherTeam()
true
if this instance has the tag MemberAddResult.Tag.USER_ON_ANOTHER_TEAM
, false
otherwise.true
if this instance is tagged as MemberAddResult.Tag.USER_ON_ANOTHER_TEAM
, false
otherwise.public static MemberAddResult userOnAnotherTeam(String value)
MemberAddResult
that has its tag set to
MemberAddResult.Tag.USER_ON_ANOTHER_TEAM
.
User is already on another team. The provided email address is associated with a user that is already a member or invited to another team.
value
- value to assign to this instance.MemberAddResult
with its tag set to MemberAddResult.Tag.USER_ON_ANOTHER_TEAM
.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$
",
or is null
.public String getUserOnAnotherTeamValue()
This instance must be tagged as MemberAddResult.Tag.USER_ON_ANOTHER_TEAM
.
String
value associated with this instance if isUserOnAnotherTeam()
is true
.IllegalStateException
- If isUserOnAnotherTeam()
is false
.public boolean isUserAlreadyPaired()
true
if this instance is tagged as MemberAddResult.Tag.USER_ALREADY_PAIRED
, false
otherwise.public static MemberAddResult userAlreadyPaired(String value)
MemberAddResult
that has its tag set to
MemberAddResult.Tag.USER_ALREADY_PAIRED
.
User is already paired.
value
- value to assign to this instance.MemberAddResult
with its tag set to MemberAddResult.Tag.USER_ALREADY_PAIRED
.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$
",
or is null
.public String getUserAlreadyPairedValue()
This instance must be tagged as MemberAddResult.Tag.USER_ALREADY_PAIRED
.
String
value associated with this instance if isUserAlreadyPaired()
is true
.IllegalStateException
- If isUserAlreadyPaired()
is false
.public boolean isUserMigrationFailed()
true
if this instance has the tag MemberAddResult.Tag.USER_MIGRATION_FAILED
, false
otherwise.true
if this instance is tagged as MemberAddResult.Tag.USER_MIGRATION_FAILED
, false
otherwise.public static MemberAddResult userMigrationFailed(String value)
MemberAddResult
that has its tag set to
MemberAddResult.Tag.USER_MIGRATION_FAILED
.
User migration has failed.
value
- value to assign to this instance.MemberAddResult
with its tag set to MemberAddResult.Tag.USER_MIGRATION_FAILED
.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$
",
or is null
.public String getUserMigrationFailedValue()
This instance must be tagged as MemberAddResult.Tag.USER_MIGRATION_FAILED
.
String
value associated with this instance if isUserMigrationFailed()
is true
.IllegalStateException
- If isUserMigrationFailed()
is
false
.public boolean isDuplicateExternalMemberId()
true
if this instance has the tag MemberAddResult.Tag.DUPLICATE_EXTERNAL_MEMBER_ID
, false
otherwise.true
if this instance is tagged as MemberAddResult.Tag.DUPLICATE_EXTERNAL_MEMBER_ID
, false
otherwise.public static MemberAddResult duplicateExternalMemberId(String value)
MemberAddResult
that has its tag set to
MemberAddResult.Tag.DUPLICATE_EXTERNAL_MEMBER_ID
.
A user with the given external member ID already exists on the team (including in recoverable state).
value
- value to assign to this instance.MemberAddResult
with its tag set to MemberAddResult.Tag.DUPLICATE_EXTERNAL_MEMBER_ID
.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$
",
or is null
.public String getDuplicateExternalMemberIdValue()
This instance must be tagged as MemberAddResult.Tag.DUPLICATE_EXTERNAL_MEMBER_ID
.
String
value associated with this instance if isDuplicateExternalMemberId()
is true
.IllegalStateException
- If isDuplicateExternalMemberId()
is
false
.public boolean isUserCreationFailed()
true
if this instance has the tag MemberAddResult.Tag.USER_CREATION_FAILED
, false
otherwise.true
if this instance is tagged as MemberAddResult.Tag.USER_CREATION_FAILED
, false
otherwise.public static MemberAddResult userCreationFailed(String value)
MemberAddResult
that has its tag set to
MemberAddResult.Tag.USER_CREATION_FAILED
.
User creation has failed.
value
- value to assign to this instance.MemberAddResult
with its tag set to MemberAddResult.Tag.USER_CREATION_FAILED
.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]*.[A-Za-z]{2,15}$
",
or is null
.public String getUserCreationFailedValue()
This instance must be tagged as MemberAddResult.Tag.USER_CREATION_FAILED
.
String
value associated with this instance if isUserCreationFailed()
is true
.IllegalStateException
- If isUserCreationFailed()
is false
.public String toStringMultiline()
The returned String may contain newlines.