Class SpaceAllocation
This class is an open 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.
Open unions may be extended in the future with additional tags. If a new
tag is introduced that this SDK does not recognized, the OTHER value
will be used.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpaceAllocationCatch-all used for unknown tag values returned by the Dropbox servers. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe user's space allocation applies only to their individual account.The user shares space with other members of their team.inthashCode()static SpaceAllocationReturns an instance ofSpaceAllocationthat has its tag set toSpaceAllocation.Tag.INDIVIDUAL.booleanbooleanisOther()booleanisTeam()tag()Returns the tag for this instance.static SpaceAllocationteam(TeamSpaceAllocation value) Returns an instance ofSpaceAllocationthat has its tag set toSpaceAllocation.Tag.TEAM.toString()Returns a String representation of this object formatted for easier readability.
-
Field Details
-
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.Receiving a catch-all value typically indicates this SDK version is not up to date. Consider updating your SDK version to handle the new tags.
-
-
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 thisSpaceAllocation.If a tag returned by the server is unrecognized by this SDK, the
SpaceAllocation.Tag.OTHERvalue will be used.- Returns:
- the tag for this instance.
-
isIndividual
public boolean isIndividual()- Returns:
trueif this instance is tagged asSpaceAllocation.Tag.INDIVIDUAL,falseotherwise.
-
individual
Returns an instance ofSpaceAllocationthat has its tag set toSpaceAllocation.Tag.INDIVIDUAL.The user's space allocation applies only to their individual account.
- Parameters:
value- value to assign to this instance.- Returns:
- Instance of
SpaceAllocationwith its tag set toSpaceAllocation.Tag.INDIVIDUAL. - Throws:
IllegalArgumentException- ifvalueisnull.
-
getIndividualValue
The user's space allocation applies only to their individual account.This instance must be tagged as
SpaceAllocation.Tag.INDIVIDUAL.- Returns:
- The
IndividualSpaceAllocationvalue associated with this instance ifisIndividual()istrue. - Throws:
IllegalStateException- IfisIndividual()isfalse.
-
isTeam
public boolean isTeam()- Returns:
trueif this instance is tagged asSpaceAllocation.Tag.TEAM,falseotherwise.
-
team
Returns an instance ofSpaceAllocationthat has its tag set toSpaceAllocation.Tag.TEAM.The user shares space with other members of their team.
- Parameters:
value- value to assign to this instance.- Returns:
- Instance of
SpaceAllocationwith its tag set toSpaceAllocation.Tag.TEAM. - Throws:
IllegalArgumentException- ifvalueisnull.
-
getTeamValue
The user shares space with other members of their team.This instance must be tagged as
SpaceAllocation.Tag.TEAM.- Returns:
- The
TeamSpaceAllocationvalue associated with this instance ifisTeam()istrue. - Throws:
IllegalStateException- IfisTeam()isfalse.
-
isOther
public boolean isOther()- Returns:
trueif this instance is tagged asSpaceAllocation.Tag.OTHER,falseotherwise.
-
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
-