Package com.dropbox.core.v2.team
Class UserSelectorArg
- java.lang.Object
-
- com.dropbox.core.v2.team.UserSelectorArg
-
public final class UserSelectorArg extends java.lang.Object
Argument for selecting a single user, either by team_member_id, external_id or email.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 returntrue
. You can usetag()
to determine the tag associated with this instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UserSelectorArg.Tag
Discriminating tag type forUserSelectorArg
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserSelectorArg
email(java.lang.String value)
Returns an instance ofUserSelectorArg
that has its tag set toUserSelectorArg.Tag.EMAIL
.boolean
equals(java.lang.Object obj)
static UserSelectorArg
externalId(java.lang.String value)
Returns an instance ofUserSelectorArg
that has its tag set toUserSelectorArg.Tag.EXTERNAL_ID
.java.lang.String
getEmailValue()
This instance must be tagged asUserSelectorArg.Tag.EMAIL
.java.lang.String
getExternalIdValue()
This instance must be tagged asUserSelectorArg.Tag.EXTERNAL_ID
.java.lang.String
getTeamMemberIdValue()
This instance must be tagged asUserSelectorArg.Tag.TEAM_MEMBER_ID
.int
hashCode()
boolean
isEmail()
boolean
isExternalId()
boolean
isTeamMemberId()
UserSelectorArg.Tag
tag()
Returns the tag for this instance.static UserSelectorArg
teamMemberId(java.lang.String value)
Returns an instance ofUserSelectorArg
that has its tag set toUserSelectorArg.Tag.TEAM_MEMBER_ID
.java.lang.String
toString()
java.lang.String
toStringMultiline()
Returns a String representation of this object formatted for easier readability.
-
-
-
Method Detail
-
tag
public UserSelectorArg.Tag tag()
Returns the tag for this instance.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 returntrue
. Callers are recommended to use the tag value in aswitch
statement to properly handle the different values for thisUserSelectorArg
.- Returns:
- the tag for this instance.
-
isTeamMemberId
public boolean isTeamMemberId()
- Returns:
true
if this instance is tagged asUserSelectorArg.Tag.TEAM_MEMBER_ID
,false
otherwise.
-
teamMemberId
public static UserSelectorArg teamMemberId(java.lang.String value)
Returns an instance ofUserSelectorArg
that has its tag set toUserSelectorArg.Tag.TEAM_MEMBER_ID
.None
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
UserSelectorArg
with its tag set toUserSelectorArg.Tag.TEAM_MEMBER_ID
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.
-
getTeamMemberIdValue
public java.lang.String getTeamMemberIdValue()
This instance must be tagged asUserSelectorArg.Tag.TEAM_MEMBER_ID
.- Returns:
- The
String
value associated with this instance ifisTeamMemberId()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisTeamMemberId()
isfalse
.
-
isExternalId
public boolean isExternalId()
- Returns:
true
if this instance is tagged asUserSelectorArg.Tag.EXTERNAL_ID
,false
otherwise.
-
externalId
public static UserSelectorArg externalId(java.lang.String value)
Returns an instance ofUserSelectorArg
that has its tag set toUserSelectorArg.Tag.EXTERNAL_ID
.None
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
UserSelectorArg
with its tag set toUserSelectorArg.Tag.EXTERNAL_ID
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
is longer than 64 or isnull
.
-
getExternalIdValue
public java.lang.String getExternalIdValue()
This instance must be tagged asUserSelectorArg.Tag.EXTERNAL_ID
.- Returns:
- The
String
value associated with this instance ifisExternalId()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisExternalId()
isfalse
.
-
isEmail
public boolean isEmail()
- Returns:
true
if this instance is tagged asUserSelectorArg.Tag.EMAIL
,false
otherwise.
-
email
public static UserSelectorArg email(java.lang.String value)
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
UserSelectorArg
with its tag set toUserSelectorArg.Tag.EMAIL
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
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 isnull
.
-
getEmailValue
public java.lang.String getEmailValue()
This instance must be tagged asUserSelectorArg.Tag.EMAIL
.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toStringMultiline
public java.lang.String toStringMultiline()
Returns a String representation of this object formatted for easier readability.The returned String may contain newlines.
- Returns:
- Formatted, multiline String representation of this object
-
-