Package com.dropbox.core.v2.team
Class UserSelectorArg
java.lang.Object
com.dropbox.core.v2.team.UserSelectorArg
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 return true. You can use tag() to determine the
tag associated with this instance.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic UserSelectorArgReturns an instance ofUserSelectorArgthat has its tag set toUserSelectorArg.Tag.EMAIL.booleanstatic UserSelectorArgexternalId(String value) Returns an instance ofUserSelectorArgthat has its tag set toUserSelectorArg.Tag.EXTERNAL_ID.This instance must be tagged asUserSelectorArg.Tag.EMAIL.This instance must be tagged asUserSelectorArg.Tag.EXTERNAL_ID.This instance must be tagged asUserSelectorArg.Tag.TEAM_MEMBER_ID.inthashCode()booleanisEmail()booleanbooleantag()Returns the tag for this instance.static UserSelectorArgteamMemberId(String value) Returns an instance ofUserSelectorArgthat has its tag set toUserSelectorArg.Tag.TEAM_MEMBER_ID.toString()Returns a String representation of this object formatted for easier readability.
-
Method Details
-
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 aswitchstatement to properly handle the different values for thisUserSelectorArg.- Returns:
- the tag for this instance.
-
isTeamMemberId
public boolean isTeamMemberId()- Returns:
trueif this instance is tagged asUserSelectorArg.Tag.TEAM_MEMBER_ID,falseotherwise.
-
teamMemberId
Returns an instance ofUserSelectorArgthat has its tag set toUserSelectorArg.Tag.TEAM_MEMBER_ID.None
- Parameters:
value- value to assign to this instance.- Returns:
- Instance of
UserSelectorArgwith its tag set toUserSelectorArg.Tag.TEAM_MEMBER_ID. - Throws:
IllegalArgumentException- ifvalueisnull.
-
getTeamMemberIdValue
This instance must be tagged asUserSelectorArg.Tag.TEAM_MEMBER_ID.- Returns:
- The
Stringvalue associated with this instance ifisTeamMemberId()istrue. - Throws:
IllegalStateException- IfisTeamMemberId()isfalse.
-
isExternalId
public boolean isExternalId()- Returns:
trueif this instance is tagged asUserSelectorArg.Tag.EXTERNAL_ID,falseotherwise.
-
externalId
Returns an instance ofUserSelectorArgthat has its tag set toUserSelectorArg.Tag.EXTERNAL_ID.None
- Parameters:
value- value to assign to this instance.- Returns:
- Instance of
UserSelectorArgwith its tag set toUserSelectorArg.Tag.EXTERNAL_ID. - Throws:
IllegalArgumentException- ifvalueis longer than 64 or isnull.
-
getExternalIdValue
This instance must be tagged asUserSelectorArg.Tag.EXTERNAL_ID.- Returns:
- The
Stringvalue associated with this instance ifisExternalId()istrue. - Throws:
IllegalStateException- IfisExternalId()isfalse.
-
isEmail
public boolean isEmail()- Returns:
trueif this instance is tagged asUserSelectorArg.Tag.EMAIL,falseotherwise.
-
email
- Parameters:
value- value to assign to this instance.- Returns:
- Instance of
UserSelectorArgwith its tag set toUserSelectorArg.Tag.EMAIL. - Throws:
IllegalArgumentException- ifvalueis 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
This instance must be tagged asUserSelectorArg.Tag.EMAIL.- Returns:
- The
Stringvalue associated with this instance ifisEmail()istrue. - Throws:
IllegalStateException- IfisEmail()isfalse.
-
hashCode
public int hashCode() -
equals
-
toString
-
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
-