Class ContextLogInfo
- java.lang.Object
-
- com.dropbox.core.v2.teamlog.ContextLogInfo
-
public final class ContextLogInfo extends java.lang.ObjectThe 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
OTHERvalue will be used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContextLogInfo.TagDiscriminating tag type forContextLogInfo.
-
Field Summary
Fields Modifier and Type Field Description static ContextLogInfoANONYMOUSAnonymous context.static ContextLogInfoOTHERCatch-all used for unknown tag values returned by the Dropbox servers.static ContextLogInfoTEAMAction was done on behalf of the team.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)NonTeamMemberLogInfogetNonTeamMemberValue()Action was done on behalf of a non team member.TeamLogInfogetOrganizationTeamValue()Action was done on behalf of a team that's part of an organization.TeamMemberLogInfogetTeamMemberValue()Action was done on behalf of a team member.TrustedNonTeamMemberLogInfogetTrustedNonTeamMemberValue()Action was done on behalf of a trusted non team member.inthashCode()booleanisAnonymous()booleanisNonTeamMember()booleanisOrganizationTeam()booleanisOther()booleanisTeam()booleanisTeamMember()booleanisTrustedNonTeamMember()Returnstrueif this instance has the tagContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER,falseotherwise.static ContextLogInfononTeamMember(NonTeamMemberLogInfo value)Returns an instance ofContextLogInfothat has its tag set toContextLogInfo.Tag.NON_TEAM_MEMBER.static ContextLogInfoorganizationTeam(TeamLogInfo value)Returns an instance ofContextLogInfothat has its tag set toContextLogInfo.Tag.ORGANIZATION_TEAM.ContextLogInfo.Tagtag()Returns the tag for this instance.static ContextLogInfoteamMember(TeamMemberLogInfo value)Returns an instance ofContextLogInfothat has its tag set toContextLogInfo.Tag.TEAM_MEMBER.java.lang.StringtoString()java.lang.StringtoStringMultiline()Returns a String representation of this object formatted for easier readability.static ContextLogInfotrustedNonTeamMember(TrustedNonTeamMemberLogInfo value)Returns an instance ofContextLogInfothat 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 aswitchstatement to properly handle the different values for thisContextLogInfo.If a tag returned by the server is unrecognized by this SDK, the
ContextLogInfo.Tag.OTHERvalue will be used.- Returns:
- the tag for this instance.
-
isAnonymous
public boolean isAnonymous()
- Returns:
trueif this instance is tagged asContextLogInfo.Tag.ANONYMOUS,falseotherwise.
-
isNonTeamMember
public boolean isNonTeamMember()
- Returns:
trueif this instance is tagged asContextLogInfo.Tag.NON_TEAM_MEMBER,falseotherwise.
-
nonTeamMember
public static ContextLogInfo nonTeamMember(NonTeamMemberLogInfo value)
Returns an instance ofContextLogInfothat 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
ContextLogInfowith its tag set toContextLogInfo.Tag.NON_TEAM_MEMBER. - Throws:
java.lang.IllegalArgumentException- ifvalueisnull.
-
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
NonTeamMemberLogInfovalue associated with this instance ifisNonTeamMember()istrue. - Throws:
java.lang.IllegalStateException- IfisNonTeamMember()isfalse.
-
isOrganizationTeam
public boolean isOrganizationTeam()
- Returns:
trueif this instance is tagged asContextLogInfo.Tag.ORGANIZATION_TEAM,falseotherwise.
-
organizationTeam
public static ContextLogInfo organizationTeam(TeamLogInfo value)
Returns an instance ofContextLogInfothat 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
ContextLogInfowith its tag set toContextLogInfo.Tag.ORGANIZATION_TEAM. - Throws:
java.lang.IllegalArgumentException- ifvalueisnull.
-
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
TeamLogInfovalue associated with this instance ifisOrganizationTeam()istrue. - Throws:
java.lang.IllegalStateException- IfisOrganizationTeam()isfalse.
-
isTeam
public boolean isTeam()
- Returns:
trueif this instance is tagged asContextLogInfo.Tag.TEAM,falseotherwise.
-
isTeamMember
public boolean isTeamMember()
- Returns:
trueif this instance is tagged asContextLogInfo.Tag.TEAM_MEMBER,falseotherwise.
-
teamMember
public static ContextLogInfo teamMember(TeamMemberLogInfo value)
Returns an instance ofContextLogInfothat 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
ContextLogInfowith its tag set toContextLogInfo.Tag.TEAM_MEMBER. - Throws:
java.lang.IllegalArgumentException- ifvalueisnull.
-
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
TeamMemberLogInfovalue associated with this instance ifisTeamMember()istrue. - Throws:
java.lang.IllegalStateException- IfisTeamMember()isfalse.
-
isTrustedNonTeamMember
public boolean isTrustedNonTeamMember()
Returnstrueif this instance has the tagContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER,falseotherwise.- Returns:
trueif this instance is tagged asContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER,falseotherwise.
-
trustedNonTeamMember
public static ContextLogInfo trustedNonTeamMember(TrustedNonTeamMemberLogInfo value)
Returns an instance ofContextLogInfothat 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
ContextLogInfowith its tag set toContextLogInfo.Tag.TRUSTED_NON_TEAM_MEMBER. - Throws:
java.lang.IllegalArgumentException- ifvalueisnull.
-
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
TrustedNonTeamMemberLogInfovalue associated with this instance ifisTrustedNonTeamMember()istrue. - Throws:
java.lang.IllegalStateException- IfisTrustedNonTeamMember()isfalse.
-
isOther
public boolean isOther()
- Returns:
trueif this instance is tagged asContextLogInfo.Tag.OTHER,falseotherwise.
-
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
-
-