Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MF-5140 Adds @Nullable & @Nonnull annotations to generated data model getters #527

Merged
merged 11 commits into from
Mar 19, 2024
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
6.1.0 (202X-XX-XX)
---------------------------------------------
- [#527](https://github.com/dropbox/dropbox-sdk-java/pull/527) Adds nullability annotations to data models for improved interop with Kotlin

6.0.0 (2023-11-30)
---------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions android/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ch.randelshofer:fastdoubleparser:0.8.0
com.fasterxml.jackson.core:jackson-core:2.15.0
com.fasterxml.jackson:jackson-bom:2.15.0
com.google.code.findbugs:jsr305:3.0.2
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
Expand Down
5 changes: 3 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ sourceSets.main.java.srcDir(versionWriterTask)

dependencies {
api(dropboxJavaSdkLibs.jackson.core)
api(dropboxJavaSdkLibs.jsr305)

compileOnly dropboxJavaSdkLibs.appengine.api
compileOnly dropboxJavaSdkLibs.jakarta.servlet.api
Expand Down Expand Up @@ -313,8 +314,8 @@ tasks.named("generateStone", StoneTask) {

])
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/main"))
sourceSets { main { java.srcDir(outputDir.file("src")) } }
}
sourceSets.main.java.srcDir(generateStone)

tasks.named("generateTestStone", StoneTask) {
String packageName = 'com.dropbox.core.stone'
Expand All @@ -333,8 +334,8 @@ tasks.named("generateTestStone", StoneTask) {
),
])
outputDir.set(project.layout.buildDirectory.dir("generated_stone_source/test"))
sourceSets { test { java.srcDir(outputDir.file("src")) } }
}
sourceSets.test.java.srcDir(generateTestStone)

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
Expand Down
wdziemia marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Generated file. Do not edit
package com.dropbox.core;

public final class DbxSdkVersion {
public static final String Version = "6.1.0-SNAPSHOT";
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public SetProfilePhotoArg(PhotoSourceArg photo) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public PhotoSourceArg getPhoto() {
return photo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public SetProfilePhotoResult(String profilePhotoUrl) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getProfilePhotoUrl() {
return profilePhotoUrl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public PollArg(String asyncJobId) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getAsyncJobId() {
return asyncJobId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public RateLimitError(RateLimitReason reason) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public RateLimitReason getReason() {
return reason;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public TokenFromOAuth1Arg(String oauth1Token, String oauth1TokenSecret) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getOauth1Token() {
return oauth1Token;
}
Expand All @@ -63,6 +64,7 @@ public String getOauth1Token() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getOauth1TokenSecret() {
return oauth1TokenSecret;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public TokenFromOAuth1Result(String oauth2Token) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getOauth2Token() {
return oauth2Token;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public TokenScopeError(String requiredScope) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getRequiredScope() {
return requiredScope;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public EchoArg() {
* @return value for this field, or {@code null} if not present. Defaults to
* "".
*/
@javax.annotation.Nonnull
public String getQuery() {
return query;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public EchoResult() {
* @return value for this field, or {@code null} if not present. Defaults to
* "".
*/
@javax.annotation.Nonnull
public String getResult() {
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public RootInfo(String rootNamespaceId, String homeNamespaceId) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getRootNamespaceId() {
return rootNamespaceId;
}
Expand All @@ -74,6 +75,7 @@ public String getRootNamespaceId() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getHomeNamespaceId() {
return homeNamespaceId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public TeamRootInfo(String rootNamespaceId, String homeNamespaceId, String homeP
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getRootNamespaceId() {
return rootNamespaceId;
}
Expand All @@ -67,6 +68,7 @@ public String getRootNamespaceId() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getHomeNamespaceId() {
return homeNamespaceId;
}
Expand All @@ -76,6 +78,7 @@ public String getHomeNamespaceId() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getHomePath() {
return homePath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public UserRootInfo(String rootNamespaceId, String homeNamespaceId) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getRootNamespaceId() {
return rootNamespaceId;
}
Expand All @@ -60,6 +61,7 @@ public String getRootNamespaceId() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getHomeNamespaceId() {
return homeNamespaceId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public DeleteManualContactsArg(List<String> emailAddresses) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public List<String> getEmailAddresses() {
return emailAddresses;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public AddPropertiesArg(String path, List<PropertyGroup> propertyGroups) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getPath() {
return path;
}
Expand All @@ -71,6 +72,7 @@ public String getPath() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public List<PropertyGroup> getPropertyGroups() {
return propertyGroups;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public AddTemplateArg(String name, String description, List<PropertyFieldTemplat
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
Expand All @@ -52,6 +53,7 @@ public String getName() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getDescription() {
return description;
}
Expand All @@ -62,6 +64,7 @@ public String getDescription() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public List<PropertyFieldTemplate> getFields() {
return fields;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public AddTemplateResult(String templateId) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getTemplateId() {
return templateId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public GetTemplateArg(String templateId) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getTemplateId() {
return templateId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public GetTemplateResult(String name, String description, List<PropertyFieldTemp
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}
Expand All @@ -52,6 +53,7 @@ public String getName() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getDescription() {
return description;
}
Expand All @@ -62,6 +64,7 @@ public String getDescription() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public List<PropertyFieldTemplate> getFields() {
return fields;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public ListTemplateResult(List<String> templateIds) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public List<String> getTemplateIds() {
return templateIds;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public OverwritePropertyGroupArg(String path, List<PropertyGroup> propertyGroups
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getPath() {
return path;
}
Expand All @@ -74,6 +75,7 @@ public String getPath() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public List<PropertyGroup> getPropertyGroups() {
return propertyGroups;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public PropertiesSearchArg(List<PropertiesSearchQuery> queries) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public List<PropertiesSearchQuery> getQueries() {
return queries;
}
Expand All @@ -83,6 +84,7 @@ public List<PropertiesSearchQuery> getQueries() {
* @return value for this field, or {@code null} if not present. Defaults to
* TemplateFilter.FILTER_NONE.
*/
@javax.annotation.Nonnull
public TemplateFilter getTemplateFilter() {
return templateFilter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public PropertiesSearchContinueArg(String cursor) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getCursor() {
return cursor;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public PropertiesSearchMatch(String id, String path, boolean isDeleted, List<Pro
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getId() {
return id;
}
Expand All @@ -76,6 +77,7 @@ public String getId() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getPath() {
return path;
}
Expand All @@ -94,6 +96,7 @@ public boolean getIsDeleted() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public List<PropertyGroup> getPropertyGroups() {
return propertyGroups;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public PropertiesSearchQuery(String query, PropertiesSearchMode mode) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public String getQuery() {
return query;
}
Expand All @@ -81,6 +82,7 @@ public String getQuery() {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public PropertiesSearchMode getMode() {
return mode;
}
Expand All @@ -91,6 +93,7 @@ public PropertiesSearchMode getMode() {
* @return value for this field, or {@code null} if not present. Defaults to
* LogicalOperator.OR_OPERATOR.
*/
@javax.annotation.Nonnull
public LogicalOperator getLogicalOperator() {
return logicalOperator;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public PropertiesSearchResult(List<PropertiesSearchMatch> matches) {
*
* @return value for this field, never {@code null}.
*/
@javax.annotation.Nonnull
public List<PropertiesSearchMatch> getMatches() {
return matches;
}
Expand All @@ -85,6 +86,7 @@ public List<PropertiesSearchMatch> getMatches() {
*
* @return value for this field, or {@code null} if not present.
*/
@javax.annotation.Nullable
public String getCursor() {
return cursor;
}
Expand Down
Loading
Loading