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

[Java] Add @javax.annotation.Nonnull to required getters #9593

Merged
merged 3 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
{{#isNullable}}
@javax.annotation.Nullable
{{/isNullable}}
{{^isNullable}}
@javax.annotation.Nonnull
{{/isNullable}}
{{/required}}
{{^required}}
@javax.annotation.Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
{{#isNullable}}
@javax.annotation.Nullable
{{/isNullable}}
{{^isNullable}}
@javax.annotation.Nonnull
{{/isNullable}}
{{/required}}
{{^required}}
@javax.annotation.Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE
{{#isNullable}}
@javax.annotation.Nullable
{{/isNullable}}
{{^isNullable}}
@javax.annotation.Nonnull
{{/isNullable}}
{{/required}}
{{^required}}
@javax.annotation.Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public Animal className(String className) {
* Get className
* @return className
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public Category name(String name) {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
* Get enumStringRequired
* @return enumStringRequired
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public FormatTest number(BigDecimal number) {
* maximum: 543.2
* @return number
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NUMBER)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -303,6 +304,7 @@ public FormatTest _byte(byte[] _byte) {
* Get _byte
* @return _byte
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_BYTE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -356,6 +358,7 @@ public FormatTest date(LocalDate date) {
* Get date
* @return date
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -436,6 +439,7 @@ public FormatTest password(String password) {
* Get password
* @return password
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_PASSWORD)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public Name name(Integer name) {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public Pet name(String name) {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "doggie", required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -196,6 +197,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) {
* Get photoUrls
* @return photoUrls
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public TypeHolderDefault stringItem(String stringItem) {
* Get stringItem
* @return stringItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_STRING_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -93,6 +94,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) {
* Get numberItem
* @return numberItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NUMBER_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -119,6 +121,7 @@ public TypeHolderDefault integerItem(Integer integerItem) {
* Get integerItem
* @return integerItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_INTEGER_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -145,6 +148,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) {
* Get boolItem
* @return boolItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_BOOL_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -176,6 +180,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) {
* Get arrayItem
* @return arrayItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_ARRAY_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public TypeHolderExample stringItem(String stringItem) {
* Get stringItem
* @return stringItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "what", required = true, value = "")
@JsonProperty(JSON_PROPERTY_STRING_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -97,6 +98,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) {
* Get numberItem
* @return numberItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "1.234", required = true, value = "")
@JsonProperty(JSON_PROPERTY_NUMBER_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -123,6 +125,7 @@ public TypeHolderExample floatItem(Float floatItem) {
* Get floatItem
* @return floatItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "1.234", required = true, value = "")
@JsonProperty(JSON_PROPERTY_FLOAT_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -149,6 +152,7 @@ public TypeHolderExample integerItem(Integer integerItem) {
* Get integerItem
* @return integerItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "-2", required = true, value = "")
@JsonProperty(JSON_PROPERTY_INTEGER_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -175,6 +179,7 @@ public TypeHolderExample boolItem(Boolean boolItem) {
* Get boolItem
* @return boolItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "true", required = true, value = "")
@JsonProperty(JSON_PROPERTY_BOOL_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -206,6 +211,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) {
* Get arrayItem
* @return arrayItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "")
@JsonProperty(JSON_PROPERTY_ARRAY_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public Animal className(String className) {
* Get className
* @return className
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public Category name(String name) {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
* Get enumStringRequired
* @return enumStringRequired
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ public FormatTest number(BigDecimal number) {
* maximum: 543.2
* @return number
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NUMBER)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -302,6 +303,7 @@ public FormatTest _byte(byte[] _byte) {
* Get _byte
* @return _byte
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_BYTE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -355,6 +357,7 @@ public FormatTest date(LocalDate date) {
* Get date
* @return date
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -435,6 +438,7 @@ public FormatTest password(String password) {
* Get password
* @return password
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_PASSWORD)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public Name name(Integer name) {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public Pet name(String name) {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "doggie", required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -195,6 +196,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) {
* Get photoUrls
* @return photoUrls
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public TypeHolderDefault stringItem(String stringItem) {
* Get stringItem
* @return stringItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_STRING_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -92,6 +93,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) {
* Get numberItem
* @return numberItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NUMBER_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -118,6 +120,7 @@ public TypeHolderDefault integerItem(Integer integerItem) {
* Get integerItem
* @return integerItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_INTEGER_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -144,6 +147,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) {
* Get boolItem
* @return boolItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_BOOL_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -175,6 +179,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) {
* Get arrayItem
* @return arrayItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_ARRAY_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public TypeHolderExample stringItem(String stringItem) {
* Get stringItem
* @return stringItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "what", required = true, value = "")
@JsonProperty(JSON_PROPERTY_STRING_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -96,6 +97,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) {
* Get numberItem
* @return numberItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "1.234", required = true, value = "")
@JsonProperty(JSON_PROPERTY_NUMBER_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -122,6 +124,7 @@ public TypeHolderExample floatItem(Float floatItem) {
* Get floatItem
* @return floatItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "1.234", required = true, value = "")
@JsonProperty(JSON_PROPERTY_FLOAT_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -148,6 +151,7 @@ public TypeHolderExample integerItem(Integer integerItem) {
* Get integerItem
* @return integerItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "-2", required = true, value = "")
@JsonProperty(JSON_PROPERTY_INTEGER_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand All @@ -174,6 +178,7 @@ public TypeHolderExample boolItem(Boolean boolItem) {
* Get boolItem
* @return boolItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "true", required = true, value = "")
@JsonProperty(JSON_PROPERTY_BOOL_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down Expand Up @@ -205,6 +210,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) {
* Get arrayItem
* @return arrayItem
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "")
@JsonProperty(JSON_PROPERTY_ARRAY_ITEM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public Animal className(String className) {
* Get className
* @return className
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public Category name(String name) {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
* Get enumStringRequired
* @return enumStringRequired
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
Expand Down
Loading