@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj == null) { return false; } else if (obj instanceof SpaceAllocation) { SpaceAllocation other = (SpaceAllocation) obj; if (this._tag != other._tag) { return false; } switch (_tag) { case INDIVIDUAL: return (this.individualValue == other.individualValue) || (this.individualValue.equals(other.individualValue)); case TEAM: return (this.teamValue == other.teamValue) || (this.teamValue.equals(other.teamValue)); case OTHER: return true; default: return false; } } else { return false; } }
throw new JsonParseException(p, "Required field \"user_within_team_space_limit_type\" missing."); value = new TeamSpaceAllocation(f_used, f_allocated, f_userWithinTeamSpaceAllocated, f_userWithinTeamSpaceLimitType); expectEndObject(p); StoneDeserializerLogger.log(value, value.toStringMultiline()); return value;
@Override public Space get() throws BackgroundException { try { final SpaceUsage usage = new DbxUserUsersRequests(session.getClient()).getSpaceUsage(); final SpaceAllocation allocation = usage.getAllocation(); if(allocation.isIndividual()) { return new Space(usage.getUsed(), allocation.getIndividualValue().getAllocated()); } else if(allocation.isTeam()) { return new Space(usage.getUsed(), allocation.getTeamValue().getAllocated()); } return new Space(0L, Long.MAX_VALUE); } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Failure to read attributes of {0}", e, new Path(String.valueOf(Path.DELIMITER), EnumSet.of(Path.Type.volume, Path.Type.directory))); } } }