Skip to content

Commit

Permalink
isEmpty should return true if there is no optional null field
Browse files Browse the repository at this point in the history
  • Loading branch information
jhannes committed Aug 25, 2024
1 parent 06c2c43 commit d5cfa3d
Show file tree
Hide file tree
Showing 24 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This generates creates Java classes using [Project Lombok](https://projectlombok

* Generates concise POJOs using [Project Lombok](https://projectlombok.org/)
* Generates POJOs without dependencies on JSON serialization frameworks
* TODO: Models are generated with convenient methods for checking missing required fields and read-only fields with values and to copy between objects
* Models are generated with convenient methods for checking missing required fields and read-only fields with values and to copy between objects
* Implements type polymorphism with `oneOf`-types, even supporting multiple inheritance for classes that are included in multiple `oneOf`-types
* Implements inheritance with `allOf`-types, including multiple levels of inheritance
* TODO: Generates client code using HttpURLConnection for HTTP and JSONB for JSON deserialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class AddMessageToConversationDeltaDto implements DeltaDto {
private ConversationMessageDto message = new ConversationMessageDto();

public boolean isEmpty() {
return false;
return true;
}

public AddMessageToConversationDeltaDto putAll(AddMessageToConversationDeltaDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public sealed class ChangeTrackedDto implements ChangeTrackedInterface permits C
private OffsetDateTime updatedAt;

public boolean isEmpty() {
return false;
return true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed class CommandToServerDto implements MessageToServerDto permits Eve
private DeltaDto delta;

public boolean isEmpty() {
return false;
return true;
}

public CommandToServerDto putAll(CommandToServerDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public final class CreateConversationDeltaDto implements DeltaDto {
private ConversationInfoDto info = new ConversationInfoDto();

public boolean isEmpty() {
return false;
return true;
}

public CreateConversationDeltaDto putAll(CreateConversationDeltaDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public final class SnapshotSetDto implements MessageFromServerDto {
private List<ConversationSnapshotDto> conversations = new ArrayList<>();

public boolean isEmpty() {
return false;
return true;
}

public SnapshotSetDto putAll(SnapshotSetDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public final class SubscribeRequestDto implements RequestToServerDto {
private UUID clientId;

public boolean isEmpty() {
return false;
return true;
}

public SubscribeRequestDto putAll(SubscribeRequestDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public final class UpdateConversationDeltaDto implements DeltaDto {
private ConversationInfoDto info = new ConversationInfoDto();

public boolean isEmpty() {
return false;
return true;
}

public UpdateConversationDeltaDto putAll(UpdateConversationDeltaDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class GeometryCollectionDto {
private List<GeometryDto> geometries = new ArrayList<>();

public boolean isEmpty() {
return false;
return true;
}

public GeometryCollectionDto putAll(GeometryCollectionDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public final class LineStringDto implements GeometryDto {
private List<List<Double>> coordinates = new ArrayList<>();

public boolean isEmpty() {
return false;
return true;
}

public LineStringDto putAll(LineStringDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class PointDto implements GeometryDto {
private List<Double> coordinates = new ArrayList<>();

public boolean isEmpty() {
return false;
return true;
}

public PointDto putAll(PointDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public final class PolygonDto implements GeometryDto {
private List<List<List<Double>>> coordinates = new ArrayList<>();

public boolean isEmpty() {
return false;
return true;
}

public PolygonDto putAll(PolygonDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public final class InfectionDto {
private List<ExposureDto> registeredExposures = new ArrayList<>();

public boolean isEmpty() {
return false;
return true;
}

public InfectionDto putAll(InfectionDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public final class JwksDocumentDto {
private List<JwksKeyDto> keys = new ArrayList<>();

public boolean isEmpty() {
return false;
return true;
}

public JwksDocumentDto putAll(JwksDocumentDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public String toString() {
private String error_description;

public boolean isEmpty() {
return false;
return true;
}

public OauthErrorDto putAll(OauthErrorDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public final class GeneralErrorDto implements CreationErrorDto, UpdateErrorDto {
private String description;

public boolean isEmpty() {
return false;
return true;
}

public GeneralErrorDto putAll(GeneralErrorDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public final class IllegalEmailAddressErrorDto implements CreationErrorDto, Upda
private List<String> validDomains = new ArrayList<>();

public boolean isEmpty() {
return false;
return true;
}

public IllegalEmailAddressErrorDto putAll(IllegalEmailAddressErrorDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class HealthSummaryDto {
private Map<String, HealthComponentDto> components = new HashMap<>();

public boolean isEmpty() {
return false;
return true;
}

public HealthSummaryDto putAll(HealthSummaryDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class StackTraceInnerDto {
private BigDecimal lineNumber;

public boolean isEmpty() {
return false;
return true;
}

public StackTraceInnerDto putAll(StackTraceInnerDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public final class CreatePersonCommandDto implements WebSocketCommandDto {
private PersonDto person = new PersonDto();

public boolean isEmpty() {
return false;
return true;
}

public CreatePersonCommandDto putAll(CreatePersonCommandDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public final class SubscribeDto implements WebSocketRequestDto {
private String request = "Subscribe";

public boolean isEmpty() {
return false;
return true;
}

public SubscribeDto putAll(SubscribeDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public final class UnsubscribeDto {
private String request = "Unsubscribe";

public boolean isEmpty() {
return false;
return true;
}

public UnsubscribeDto putAll(UnsubscribeDto o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public final class UpdatePersonCommandDto implements WebSocketCommandDto {
private PersonDto person = new PersonDto();

public boolean isEmpty() {
return false;
return true;
}

public UpdatePersonCommandDto putAll(UpdatePersonCommandDto o) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/JavaLombok/modelGeneric.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public {{#if children}}sealed{{else}}final{{/if}} class {{classname}}
{{/interfaceModels}}
;
{{else}}
return false;
return true;
{{/if}}
}

Expand Down

0 comments on commit d5cfa3d

Please sign in to comment.