-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tillias
committed
Nov 6, 2020
1 parent
cfd4c9e
commit 0436a6a
Showing
8 changed files
with
113 additions
and
54 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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/github/microcatalog/service/dto/custom/BaseDto.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.github.microcatalog.service.dto.custom; | ||
|
||
public abstract class BaseDto { | ||
private Long id; | ||
private String name; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
} |
25 changes: 1 addition & 24 deletions
25
src/main/java/com/github/microcatalog/service/dto/custom/DependencyDto.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
24 changes: 1 addition & 23 deletions
24
src/main/java/com/github/microcatalog/service/dto/custom/MicroserviceDto.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,27 +1,5 @@ | ||
package com.github.microcatalog.service.dto.custom; | ||
|
||
public class MicroserviceDto { | ||
private Long id; | ||
private String name; | ||
public class MicroserviceDto extends BaseDto { | ||
|
||
public MicroserviceDto id(Long id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/com/github/microcatalog/service/dto/custom/builder/DependencyDtoBuilder.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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.github.microcatalog.service.dto.custom.builder; | ||
|
||
import com.github.microcatalog.service.dto.custom.DependencyDto; | ||
import com.github.microcatalog.service.dto.custom.MicroserviceDto; | ||
|
||
public final class DependencyDtoBuilder { | ||
private MicroserviceDto source; | ||
private MicroserviceDto target; | ||
private Long id; | ||
private String name; | ||
|
||
private DependencyDtoBuilder() { | ||
} | ||
|
||
public static DependencyDtoBuilder aDependencyDto() { | ||
return new DependencyDtoBuilder(); | ||
} | ||
|
||
public DependencyDtoBuilder withSource(MicroserviceDto source) { | ||
this.source = source; | ||
return this; | ||
} | ||
|
||
public DependencyDtoBuilder withTarget(MicroserviceDto target) { | ||
this.target = target; | ||
return this; | ||
} | ||
|
||
public DependencyDtoBuilder withId(Long id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public DependencyDtoBuilder withName(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
public DependencyDto build() { | ||
DependencyDto dependencyDto = new DependencyDto(); | ||
dependencyDto.setSource(source); | ||
dependencyDto.setTarget(target); | ||
dependencyDto.setId(id); | ||
dependencyDto.setName(name); | ||
return dependencyDto; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/github/microcatalog/service/dto/custom/builder/MicroserviceDtoBuilder.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.github.microcatalog.service.dto.custom.builder; | ||
|
||
import com.github.microcatalog.service.dto.custom.MicroserviceDto; | ||
|
||
public final class MicroserviceDtoBuilder { | ||
private Long id; | ||
private String name; | ||
|
||
private MicroserviceDtoBuilder() { | ||
} | ||
|
||
public static MicroserviceDtoBuilder aMicroserviceDto() { | ||
return new MicroserviceDtoBuilder(); | ||
} | ||
|
||
public MicroserviceDtoBuilder withId(Long id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public MicroserviceDtoBuilder withName(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
public MicroserviceDto build() { | ||
MicroserviceDto microserviceDto = new MicroserviceDto(); | ||
microserviceDto.setId(id); | ||
microserviceDto.setName(name); | ||
return microserviceDto; | ||
} | ||
} |
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