-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REFACTORING: Changing lombok to java records
- Loading branch information
Showing
7 changed files
with
37 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 4 additions & 15 deletions
19
src/main/java/org/example/githubservice/model/dtos/BranchDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,6 @@ | ||
package org.example.githubservice.model.dtos; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class BranchDTO { | ||
|
||
private String name; | ||
private CommitDTO commit; | ||
|
||
} | ||
public record BranchDTO ( | ||
String name, | ||
CommitDTO commit | ||
){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 10 additions & 17 deletions
27
src/main/java/org/example/githubservice/model/dtos/RepositoryDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,17 @@ | ||
package org.example.githubservice.model.dtos; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
public class RepositoryDTO { | ||
private String name; | ||
|
||
@JsonProperty("ownerLogin") | ||
private OwnerDTO owner; | ||
|
||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) | ||
private boolean fork; | ||
|
||
@JsonProperty(value = "branches_url", access = JsonProperty.Access.WRITE_ONLY) | ||
private String branchesUrl; | ||
|
||
private List<BranchDTO> branches; | ||
} | ||
public record RepositoryDTO( | ||
String name, | ||
//@JsonProperty("ownerLogin") | ||
OwnerDTO owner, | ||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) | ||
boolean fork, | ||
@JsonProperty(value = "branches_url", access = JsonProperty.Access.WRITE_ONLY) | ||
String branchesUrl, | ||
List<BranchDTO> branches | ||
) {} |
14 changes: 4 additions & 10 deletions
14
src/main/java/org/example/githubservice/model/dtos/UserNotFoundErrorResponseDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
package org.example.githubservice.model.dtos; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
import org.springframework.http.HttpStatusCode; | ||
|
||
@Data | ||
@Builder | ||
public class UserNotFoundErrorResponseDTO { | ||
|
||
private HttpStatusCode status; | ||
|
||
private String message; | ||
} | ||
public record UserNotFoundErrorResponseDTO ( | ||
HttpStatusCode status, | ||
String message | ||
) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters