Package com.dropbox.core.v2.team
Class UserSelectorArg
- java.lang.Object
-
- com.dropbox.core.v2.team.UserSelectorArg
-
public final class UserSelectorArg extends java.lang.ObjectArgument 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 classUserSelectorArg.TagDiscriminating tag type forUserSelectorArg.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserSelectorArgemail(java.lang.String value)Returns an instance ofUserSelectorArgthat has its tag set toUserSelectorArg.Tag.EMAIL.booleanequals(java.lang.Object obj)static UserSelectorArgexternalId(java.lang.String value)Returns an instance ofUserSelectorArgthat has its tag set toUserSelectorArg.Tag.EXTERNAL_ID.java.lang.StringgetEmailValue()This instance must be tagged asUserSelectorArg.Tag.EMAIL.java.lang.StringgetExternalIdValue()This instance must be tagged asUserSelectorArg.Tag.EXTERNAL_ID.java.lang.StringgetTeamMemberIdValue()This instance must be tagged asUserSelectorArg.Tag.TEAM_MEMBER_ID.inthashCode()booleanisEmail()booleanisExternalId()booleanisTeamMemberId()UserSelectorArg.Tagtag()Returns the tag for this instance.static UserSelectorArgteamMemberId(java.lang.String value)Returns an instance ofUserSelectorArgthat has its tag set toUserSelectorArg.Tag.TEAM_MEMBER_ID.java.lang.StringtoString()java.lang.StringtoStringMultiline()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 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
public static UserSelectorArg teamMemberId(java.lang.String value)
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:
java.lang.IllegalArgumentException- ifvalueisnull.
-
getTeamMemberIdValue
public java.lang.String getTeamMemberIdValue()
This instance must be tagged asUserSelectorArg.Tag.TEAM_MEMBER_ID.- Returns:
- The
Stringvalue associated with this instance ifisTeamMemberId()istrue. - Throws:
java.lang.IllegalStateException- IfisTeamMemberId()isfalse.
-
isExternalId
public boolean isExternalId()
- Returns:
trueif this instance is tagged asUserSelectorArg.Tag.EXTERNAL_ID,falseotherwise.
-
externalId
public static UserSelectorArg externalId(java.lang.String value)
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:
java.lang.IllegalArgumentException- ifvalueis longer than 64 or isnull.
-
getExternalIdValue
public java.lang.String getExternalIdValue()
This instance must be tagged asUserSelectorArg.Tag.EXTERNAL_ID.- Returns:
- The
Stringvalue associated with this instance ifisExternalId()istrue. - Throws:
java.lang.IllegalStateException- IfisExternalId()isfalse.
-
isEmail
public boolean isEmail()
- Returns:
trueif this instance is tagged asUserSelectorArg.Tag.EMAIL,falseotherwise.
-
email
public static UserSelectorArg email(java.lang.String value)
- Parameters:
value- value to assign to this instance.- Returns:
- Instance of
UserSelectorArgwith its tag set toUserSelectorArg.Tag.EMAIL. - Throws:
java.lang.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
public java.lang.String getEmailValue()
This instance must be tagged asUserSelectorArg.Tag.EMAIL.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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
-
-