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

* Add @javax.annotation.Nonnull to required getters

* Add updated samples

* Consider the nullable constraint
This commit is contained in:
Marcel Stör
2021-07-19 04:48:58 +02:00
committed by GitHub
parent bd070308d9
commit c5f5d3dd6a
231 changed files with 554 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ public class Animal {
* Get className
* @return className
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -53,6 +53,7 @@ public class AppleReq {
* Get cultivar
* @return cultivar
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_CULTIVAR)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -54,6 +54,7 @@ public class BananaReq {
* Get lengthCm
* @return lengthCm
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_LENGTH_CM)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -49,6 +49,7 @@ public class BasquePig {
* Get className
* @return className
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -79,6 +79,7 @@ public class Category {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -99,6 +99,7 @@ public class ChildCat extends ParentPet {
* Get petType
* @return petType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_PET_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -59,6 +59,7 @@ public class ComplexQuadrilateral {
* Get shapeType
* @return shapeType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -84,6 +85,7 @@ public class ComplexQuadrilateral {
* Get quadrilateralType
* @return quadrilateralType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -49,6 +49,7 @@ public class DanishPig {
* Get className
* @return className
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -293,6 +293,7 @@ public class EnumTest {
* Get enumStringRequired
* @return enumStringRequired
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -59,6 +59,7 @@ public class EquilateralTriangle {
* Get shapeType
* @return shapeType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -84,6 +85,7 @@ public class EquilateralTriangle {
* Get triangleType
* @return triangleType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -198,6 +198,7 @@ public class FormatTest {
* maximum: 543.2
* @return number
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NUMBER)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -331,6 +332,7 @@ public class FormatTest {
* Get _byte
* @return _byte
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_BYTE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -382,6 +384,7 @@ public class FormatTest {
* Get date
* @return date
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "Sun Feb 02 00:00:00 UTC 2020", required = true, value = "")
@JsonProperty(JSON_PROPERTY_DATE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -459,6 +462,7 @@ public class FormatTest {
* Get password
* @return password
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_PASSWORD)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -59,6 +59,7 @@ public class GrandparentAnimal {
* Get petType
* @return petType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_PET_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -55,6 +55,7 @@ public class IsoscelesTriangle {
* Get shapeType
* @return shapeType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -80,6 +81,7 @@ public class IsoscelesTriangle {
* Get triangleType
* @return triangleType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -62,6 +62,7 @@ public class Name {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -162,6 +162,7 @@ public class Pet {
* Get name
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(example = "doggie", required = true, value = "")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -192,6 +193,7 @@ public class Pet {
* Get photoUrls
* @return photoUrls
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -49,6 +49,7 @@ public class QuadrilateralInterface {
* Get quadrilateralType
* @return quadrilateralType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -59,6 +59,7 @@ public class ScaleneTriangle {
* Get shapeType
* @return shapeType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -84,6 +85,7 @@ public class ScaleneTriangle {
* Get triangleType
* @return triangleType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -49,6 +49,7 @@ public class ShapeInterface {
* Get shapeType
* @return shapeType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -59,6 +59,7 @@ public class SimpleQuadrilateral {
* Get shapeType
* @return shapeType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@@ -84,6 +85,7 @@ public class SimpleQuadrilateral {
* Get quadrilateralType
* @return quadrilateralType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -49,6 +49,7 @@ public class TriangleInterface {
* Get triangleType
* @return triangleType
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -109,6 +109,7 @@ public class Whale {
* Get className
* @return className
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

View File

@@ -120,6 +120,7 @@ public class Zebra {
* Get className
* @return className
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)