Class ContextLogInfo
- java.lang.Object
-
- com.dropbox.core.v2.teamlog.ContextLogInfo
-
public final class ContextLogInfo extends java.lang.Object
The primary entity on which the action was done.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 returntrue
. You can usetag()
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 Modifier and Type Class Description static class
ContextLogInfo.Tag
Discriminating tag type forContextLogInfo
.
-
Field Summary
Fields Modifier and Type Field Description static ContextLogInfo
ANONYMOUS
Anonymous context.static ContextLogInfo
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.static ContextLogInfo
TEAM
Action was done on behalf of the team.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
NonTeamMemberLogInfo
getNonTeamMemberValue()
Action was done on behalf of a non team member.TeamLogInfo
getOrganizationTeamValue()
Action was done on behalf of a team that's part of an organization.TeamMemberLogInfo
getTeamMemberValue()
Action was done on behalf of a team member.TrustedNonTeamMemberLogInfo
getTrustedNonTeamMemberValue()
Action was done on behalf of a trusted non team member.int
hashCode()
boolean
isAnonymous()
boolean
isNonTeamMember()
boolean
isOrganizationTeam()
boolean
isOther()
boolean
isTeam()
boolean
isTeamMember()
boolean
isTrustedNonTeamMember()
Returnstrue
if this instance has the tagContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER
,false
otherwise.static ContextLogInfo
nonTeamMember(NonTeamMemberLogInfo value)
Returns an instance ofContextLogInfo
that has its tag set toContextLogInfo.Tag.NON_TEAM_MEMBER
.static ContextLogInfo
organizationTeam(TeamLogInfo value)
Returns an instance ofContextLogInfo
that has its tag set toContextLogInfo.Tag.ORGANIZATION_TEAM
.ContextLogInfo.Tag
tag()
Returns the tag for this instance.static ContextLogInfo
teamMember(TeamMemberLogInfo value)
Returns an instance ofContextLogInfo
that has its tag set toContextLogInfo.Tag.TEAM_MEMBER
.java.lang.String
toString()
java.lang.String
toStringMultiline()
Returns a String representation of this object formatted for easier readability.static ContextLogInfo
trustedNonTeamMember(TrustedNonTeamMemberLogInfo value)
Returns an instance ofContextLogInfo
that has its tag set toContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER
.
-
-
-
Field Detail
-
ANONYMOUS
public static final ContextLogInfo ANONYMOUS
Anonymous context.
-
TEAM
public static final ContextLogInfo TEAM
Action was done on behalf of the team.
-
OTHER
public static final ContextLogInfo 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 Detail
-
tag
public ContextLogInfo.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 aswitch
statement to properly handle the different values for thisContextLogInfo
.If a tag returned by the server is unrecognized by this SDK, the
ContextLogInfo.Tag.OTHER
value will be used.- Returns:
- the tag for this instance.
-
isAnonymous
public boolean isAnonymous()
- Returns:
true
if this instance is tagged asContextLogInfo.Tag.ANONYMOUS
,false
otherwise.
-
isNonTeamMember
public boolean isNonTeamMember()
- Returns:
true
if this instance is tagged asContextLogInfo.Tag.NON_TEAM_MEMBER
,false
otherwise.
-
nonTeamMember
public static ContextLogInfo nonTeamMember(NonTeamMemberLogInfo value)
Returns an instance ofContextLogInfo
that has its tag set toContextLogInfo.Tag.NON_TEAM_MEMBER
.Action was done on behalf of a non team member.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
ContextLogInfo
with its tag set toContextLogInfo.Tag.NON_TEAM_MEMBER
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.
-
getNonTeamMemberValue
public NonTeamMemberLogInfo getNonTeamMemberValue()
Action was done on behalf of a non team member.This instance must be tagged as
ContextLogInfo.Tag.NON_TEAM_MEMBER
.- Returns:
- The
NonTeamMemberLogInfo
value associated with this instance ifisNonTeamMember()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisNonTeamMember()
isfalse
.
-
isOrganizationTeam
public boolean isOrganizationTeam()
- Returns:
true
if this instance is tagged asContextLogInfo.Tag.ORGANIZATION_TEAM
,false
otherwise.
-
organizationTeam
public static ContextLogInfo organizationTeam(TeamLogInfo value)
Returns an instance ofContextLogInfo
that has its tag set toContextLogInfo.Tag.ORGANIZATION_TEAM
.Action was done on behalf of a team that's part of an organization.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
ContextLogInfo
with its tag set toContextLogInfo.Tag.ORGANIZATION_TEAM
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.
-
getOrganizationTeamValue
public TeamLogInfo getOrganizationTeamValue()
Action was done on behalf of a team that's part of an organization.This instance must be tagged as
ContextLogInfo.Tag.ORGANIZATION_TEAM
.- Returns:
- The
TeamLogInfo
value associated with this instance ifisOrganizationTeam()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisOrganizationTeam()
isfalse
.
-
isTeam
public boolean isTeam()
- Returns:
true
if this instance is tagged asContextLogInfo.Tag.TEAM
,false
otherwise.
-
isTeamMember
public boolean isTeamMember()
- Returns:
true
if this instance is tagged asContextLogInfo.Tag.TEAM_MEMBER
,false
otherwise.
-
teamMember
public static ContextLogInfo teamMember(TeamMemberLogInfo value)
Returns an instance ofContextLogInfo
that has its tag set toContextLogInfo.Tag.TEAM_MEMBER
.Action was done on behalf of a team member.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
ContextLogInfo
with its tag set toContextLogInfo.Tag.TEAM_MEMBER
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.
-
getTeamMemberValue
public TeamMemberLogInfo getTeamMemberValue()
Action was done on behalf of a team member.This instance must be tagged as
ContextLogInfo.Tag.TEAM_MEMBER
.- Returns:
- The
TeamMemberLogInfo
value associated with this instance ifisTeamMember()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisTeamMember()
isfalse
.
-
isTrustedNonTeamMember
public boolean isTrustedNonTeamMember()
Returnstrue
if this instance has the tagContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER
,false
otherwise.- Returns:
true
if this instance is tagged asContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER
,false
otherwise.
-
trustedNonTeamMember
public static ContextLogInfo trustedNonTeamMember(TrustedNonTeamMemberLogInfo value)
Returns an instance ofContextLogInfo
that has its tag set toContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER
.Action was done on behalf of a trusted non team member.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
ContextLogInfo
with its tag set toContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.
-
getTrustedNonTeamMemberValue
public TrustedNonTeamMemberLogInfo getTrustedNonTeamMemberValue()
Action was done on behalf of a trusted non team member.This instance must be tagged as
ContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER
.- Returns:
- The
TrustedNonTeamMemberLogInfo
value associated with this instance ifisTrustedNonTeamMember()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisTrustedNonTeamMember()
isfalse
.
-
isOther
public boolean isOther()
- Returns:
true
if this instance is tagged asContextLogInfo.Tag.OTHER
,false
otherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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
-
-