mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 00:16:10 +00:00
[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:
@@ -56,6 +56,7 @@ public class Animal implements Parcelable {
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public String getClassName() {
|
||||
|
||||
@@ -75,6 +75,7 @@ public class Category implements Parcelable {
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -280,6 +280,7 @@ public class EnumTest implements Parcelable {
|
||||
* Get enumStringRequired
|
||||
* @return enumStringRequired
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public EnumStringRequiredEnum getEnumStringRequired() {
|
||||
|
||||
@@ -180,6 +180,7 @@ public class FormatTest implements Parcelable {
|
||||
* maximum: 543.2
|
||||
* @return number
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public BigDecimal getNumber() {
|
||||
@@ -275,6 +276,7 @@ public class FormatTest implements Parcelable {
|
||||
* Get _byte
|
||||
* @return _byte
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public byte[] getByte() {
|
||||
@@ -320,6 +322,7 @@ public class FormatTest implements Parcelable {
|
||||
* Get date
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public LocalDate getDate() {
|
||||
@@ -388,6 +391,7 @@ public class FormatTest implements Parcelable {
|
||||
* Get password
|
||||
* @return password
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public String getPassword() {
|
||||
|
||||
@@ -61,6 +61,7 @@ public class Name implements Parcelable {
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public Integer getName() {
|
||||
|
||||
@@ -169,6 +169,7 @@ public class Pet implements Parcelable {
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
|
||||
public String getName() {
|
||||
@@ -196,6 +197,7 @@ public class Pet implements Parcelable {
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public Set<String> getPhotoUrls() {
|
||||
|
||||
@@ -67,6 +67,7 @@ public class TypeHolderDefault implements Parcelable {
|
||||
* Get stringItem
|
||||
* @return stringItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public String getStringItem() {
|
||||
@@ -89,6 +90,7 @@ public class TypeHolderDefault implements Parcelable {
|
||||
* Get numberItem
|
||||
* @return numberItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public BigDecimal getNumberItem() {
|
||||
@@ -111,6 +113,7 @@ public class TypeHolderDefault implements Parcelable {
|
||||
* Get integerItem
|
||||
* @return integerItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public Integer getIntegerItem() {
|
||||
@@ -133,6 +136,7 @@ public class TypeHolderDefault implements Parcelable {
|
||||
* Get boolItem
|
||||
* @return boolItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public Boolean getBoolItem() {
|
||||
@@ -160,6 +164,7 @@ public class TypeHolderDefault implements Parcelable {
|
||||
* Get arrayItem
|
||||
* @return arrayItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
|
||||
public List<Integer> getArrayItem() {
|
||||
|
||||
@@ -71,6 +71,7 @@ public class TypeHolderExample implements Parcelable {
|
||||
* Get stringItem
|
||||
* @return stringItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(example = "what", required = true, value = "")
|
||||
|
||||
public String getStringItem() {
|
||||
@@ -93,6 +94,7 @@ public class TypeHolderExample implements Parcelable {
|
||||
* Get numberItem
|
||||
* @return numberItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(example = "1.234", required = true, value = "")
|
||||
|
||||
public BigDecimal getNumberItem() {
|
||||
@@ -115,6 +117,7 @@ public class TypeHolderExample implements Parcelable {
|
||||
* Get floatItem
|
||||
* @return floatItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(example = "1.234", required = true, value = "")
|
||||
|
||||
public Float getFloatItem() {
|
||||
@@ -137,6 +140,7 @@ public class TypeHolderExample implements Parcelable {
|
||||
* Get integerItem
|
||||
* @return integerItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(example = "-2", required = true, value = "")
|
||||
|
||||
public Integer getIntegerItem() {
|
||||
@@ -159,6 +163,7 @@ public class TypeHolderExample implements Parcelable {
|
||||
* Get boolItem
|
||||
* @return boolItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(example = "true", required = true, value = "")
|
||||
|
||||
public Boolean getBoolItem() {
|
||||
@@ -186,6 +191,7 @@ public class TypeHolderExample implements Parcelable {
|
||||
* Get arrayItem
|
||||
* @return arrayItem
|
||||
**/
|
||||
@javax.annotation.Nonnull
|
||||
@ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "")
|
||||
|
||||
public List<Integer> getArrayItem() {
|
||||
|
||||
Reference in New Issue
Block a user