public final class PathRoot
extends java.lang.Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
PathRoot.Serializer
For internal use only.
|
static class |
PathRoot.Tag
Discriminating tag type for
PathRoot . |
Modifier and Type | Field and Description |
---|---|
static PathRoot |
HOME
Paths are relative to the authenticating user's home namespace, whether
or not that user belongs to a team.
|
static PathRoot |
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getNamespaceIdValue()
Paths are relative to given namespace id (This results in
PathRootError.NO_PERMISSION if you don't have access to this
namespace.). |
java.lang.String |
getRootValue()
Paths are relative to the authenticating user's root namespace (This
results in
PathRootError.getInvalidRootValue() if the user's root
namespace has changed.). |
int |
hashCode() |
boolean |
isHome()
|
boolean |
isNamespaceId()
|
boolean |
isOther()
|
boolean |
isRoot()
|
static PathRoot |
namespaceId(java.lang.String value)
Returns an instance of
PathRoot that has its tag set to PathRoot.Tag.NAMESPACE_ID . |
static PathRoot |
root(java.lang.String value)
Returns an instance of
PathRoot that has its tag set to PathRoot.Tag.ROOT . |
PathRoot.Tag |
tag()
Returns the tag for this instance.
|
java.lang.String |
toString() |
java.lang.String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
public static final PathRoot HOME
public static final PathRoot OTHER
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.
public PathRoot.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 PathRoot
.
If a tag returned by the server is unrecognized by this SDK, the
PathRoot.Tag.OTHER
value will be used.
public boolean isHome()
true
if this instance is tagged as PathRoot.Tag.HOME
,
false
otherwise.public boolean isRoot()
true
if this instance is tagged as PathRoot.Tag.ROOT
,
false
otherwise.public static PathRoot root(java.lang.String value)
PathRoot
that has its tag set to PathRoot.Tag.ROOT
.
Paths are relative to the authenticating user's root namespace (This
results in PathRootError.getInvalidRootValue()
if the user's root
namespace has changed.).
value
- value to assign to this instance.PathRoot
with its tag set to PathRoot.Tag.ROOT
.java.lang.IllegalArgumentException
- if value
does not match pattern
"[-_0-9a-zA-Z:]+
" or is null
.public java.lang.String getRootValue()
PathRootError.getInvalidRootValue()
if the user's root
namespace has changed.).
This instance must be tagged as PathRoot.Tag.ROOT
.
public boolean isNamespaceId()
true
if this instance is tagged as PathRoot.Tag.NAMESPACE_ID
, false
otherwise.public static PathRoot namespaceId(java.lang.String value)
PathRoot
that has its tag set to PathRoot.Tag.NAMESPACE_ID
.
Paths are relative to given namespace id (This results in PathRootError.NO_PERMISSION
if you don't have access to this
namespace.).
value
- value to assign to this instance.PathRoot
with its tag set to PathRoot.Tag.NAMESPACE_ID
.java.lang.IllegalArgumentException
- if value
does not match pattern
"[-_0-9a-zA-Z:]+
" or is null
.public java.lang.String getNamespaceIdValue()
PathRootError.NO_PERMISSION
if you don't have access to this
namespace.).
This instance must be tagged as PathRoot.Tag.NAMESPACE_ID
.
String
value associated with this instance if isNamespaceId()
is true
.java.lang.IllegalStateException
- If isNamespaceId()
is false
.public boolean isOther()
true
if this instance is tagged as PathRoot.Tag.OTHER
,
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringMultiline()
The returned String may contain newlines.