public final class LookupError extends 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 |
LookupError.Serializer
For internal use only.
|
static class |
LookupError.Tag
Discriminating tag type for
LookupError . |
Modifier and Type | Field and Description |
---|---|
static LookupError |
NOT_FILE
We were expecting a file, but the given path refers to something that
isn't a file.
|
static LookupError |
NOT_FOLDER
We were expecting a folder, but the given path refers to something that
isn't a folder.
|
static LookupError |
NOT_FOUND
There is nothing at the given path.
|
static LookupError |
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.
|
static LookupError |
RESTRICTED_CONTENT
The file cannot be transferred because the content is restricted.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
PathRootError |
getInvalidPathRootValue()
The path root parameter provided is invalid.
|
String |
getMalformedPathValue()
This instance must be tagged as
LookupError.Tag.MALFORMED_PATH . |
int |
hashCode() |
static LookupError |
invalidPathRoot(PathRootError value)
Returns an instance of
LookupError that has its tag set to LookupError.Tag.INVALID_PATH_ROOT . |
boolean |
isInvalidPathRoot()
|
boolean |
isMalformedPath()
|
boolean |
isNotFile()
|
boolean |
isNotFolder()
|
boolean |
isNotFound()
|
boolean |
isOther()
|
boolean |
isRestrictedContent()
|
static LookupError |
malformedPath()
Returns an instance of
LookupError that has its tag set to LookupError.Tag.MALFORMED_PATH . |
static LookupError |
malformedPath(String value)
Returns an instance of
LookupError that has its tag set to LookupError.Tag.MALFORMED_PATH . |
LookupError.Tag |
tag()
Returns the tag for this instance.
|
String |
toString() |
String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
public static final LookupError NOT_FOUND
public static final LookupError NOT_FILE
public static final LookupError NOT_FOLDER
public static final LookupError RESTRICTED_CONTENT
public static final LookupError 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 LookupError.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 LookupError
.
If a tag returned by the server is unrecognized by this SDK, the
LookupError.Tag.OTHER
value will be used.
public boolean isMalformedPath()
true
if this instance is tagged as LookupError.Tag.MALFORMED_PATH
, false
otherwise.public static LookupError malformedPath(String value)
value
- value to assign to this instance.LookupError
with its tag set to LookupError.Tag.MALFORMED_PATH
.public static LookupError malformedPath()
LookupError
with its tag set to LookupError.Tag.MALFORMED_PATH
.public String getMalformedPathValue()
LookupError.Tag.MALFORMED_PATH
.String
value associated with this instance if isMalformedPath()
is true
.IllegalStateException
- If isMalformedPath()
is false
.public boolean isNotFound()
true
if this instance is tagged as LookupError.Tag.NOT_FOUND
,
false
otherwise.public boolean isNotFile()
true
if this instance is tagged as LookupError.Tag.NOT_FILE
,
false
otherwise.public boolean isNotFolder()
true
if this instance is tagged as LookupError.Tag.NOT_FOLDER
, false
otherwise.public boolean isRestrictedContent()
true
if this instance is tagged as LookupError.Tag.RESTRICTED_CONTENT
, false
otherwise.public boolean isInvalidPathRoot()
true
if this instance is tagged as LookupError.Tag.INVALID_PATH_ROOT
, false
otherwise.public static LookupError invalidPathRoot(PathRootError value)
LookupError
that has its tag set to LookupError.Tag.INVALID_PATH_ROOT
.
The path root parameter provided is invalid.
value
- value to assign to this instance.LookupError
with its tag set to LookupError.Tag.INVALID_PATH_ROOT
.IllegalArgumentException
- if value
is null
.public PathRootError getInvalidPathRootValue()
This instance must be tagged as LookupError.Tag.INVALID_PATH_ROOT
.
PathRootError
value associated with this instance if
isInvalidPathRoot()
is true
.IllegalStateException
- If isInvalidPathRoot()
is false
.public boolean isOther()
true
if this instance is tagged as LookupError.Tag.OTHER
,
false
otherwise.public String toStringMultiline()
The returned String may contain newlines.