diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/Inconsistencies.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/Inconsistencies.java index 02eaeae..95f4577 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/Inconsistencies.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/Inconsistencies.java @@ -2,10 +2,12 @@ import java.util.ArrayList; import java.util.List; +import lombok.Getter; /** * Represents inconsistency categories */ +@Getter public class Inconsistencies { private List security; @@ -29,16 +31,4 @@ public void addDatabase(InconsistencyTuple t){ public void addApi(InconsistencyTuple t){ this.api.add(t); } - - public List getSecurity() { - return security; - } - - public List getDatabase() { - return database; - } - - public List getApi() { - return api; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/InconsistencyItem.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/InconsistencyItem.java index 71a543a..18b6de0 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/InconsistencyItem.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/InconsistencyItem.java @@ -1,11 +1,18 @@ package edu.baylor.ecs.cloudhubs.prophetdto.app; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + /** * Represents an identification of a place in the code * This place in the code has inconsistent String value * with some other place. The other place is the other item * in the InconsistencyTuple array. */ +@AllArgsConstructor +@Getter +@Setter public class InconsistencyItem { // Path to a file with code private String filePath; @@ -13,34 +20,4 @@ public class InconsistencyItem { private Integer line; // inconsistent value private String value; - - public InconsistencyItem(String filePath, Integer line, String value) { - this.filePath = filePath; - this.line = line; - this.value = value; - } - - public String getFilePath() { - return filePath; - } - - public void setFilePath(String filePath) { - this.filePath = filePath; - } - - public Integer getLine() { - return line; - } - - public void setLine(Integer line) { - this.line = line; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/InconsistencyTuple.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/InconsistencyTuple.java index 2708e77..65391ac 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/InconsistencyTuple.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/InconsistencyTuple.java @@ -3,10 +3,13 @@ import java.util.ArrayList; import java.util.List; +import lombok.Getter; + /** * Represents a tuple of references to the code that are inconsistent * across the microservice system */ +@Getter public class InconsistencyTuple { private List items; @@ -15,10 +18,6 @@ public InconsistencyTuple() { this.items = new ArrayList<>(); } - public List getItems() { - return items; - } - public void addItem(InconsistencyItem i) { items.add(i); } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/MicroserviceResult.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/MicroserviceResult.java index fea0484..410d734 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/MicroserviceResult.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/MicroserviceResult.java @@ -1,5 +1,10 @@ package edu.baylor.ecs.cloudhubs.prophetdto.app; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class MicroserviceResult { private String name; @@ -17,38 +22,4 @@ public class MicroserviceResult { * Mermaid class diagram for bounded context */ private String boundedContext; - - public MicroserviceResult() {} - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getBoundedContext() { - return boundedContext; - } - - public void setBoundedContext(String boundedContext) { - this.boundedContext = boundedContext; - } - - public boolean isNoBoundedContext() { - return noBoundedContext; - } - - public void setNoBoundedContext(boolean noBoundedContext) { - this.noBoundedContext = noBoundedContext; - } - - public boolean isNotJava() { - return notJava; - } - - public void setNotJava(boolean notJava) { - this.notJava = notJava; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetAppData.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetAppData.java index cd518dc..4505be1 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetAppData.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetAppData.java @@ -2,21 +2,12 @@ import java.util.List; -public class ProphetAppData { +import lombok.Getter; +import lombok.Setter; +@Getter +@Setter +public class ProphetAppData { private ProphetAppGlobal global; private List ms; - - public ProphetAppData() {} - - public ProphetAppGlobal getGlobal() { - return global; - } - - public void setGlobal(ProphetAppGlobal global) { - this.global = global; - } - - public List getMs() { return ms; } - public void setMs(List ms) { this.ms = ms; } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetAppGlobal.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetAppGlobal.java index e570fde..1c1beb2 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetAppGlobal.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetAppGlobal.java @@ -1,5 +1,14 @@ package edu.baylor.ecs.cloudhubs.prophetdto.app; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter public class ProphetAppGlobal { String projectName; @@ -27,61 +36,4 @@ public class ProphetAppGlobal { * True if we failed to clone this repo, else false */ boolean cannotClone; - - public ProphetAppGlobal() { - } - - public ProphetAppGlobal(String projectName, String communication, String contextMap) { - this.projectName = projectName; - this.communication = communication; - this.contextMap = contextMap; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public boolean isNoCommunication() { - return noCommunication; - } - - public void setNoCommunication(boolean noCommunication) { - this.noCommunication = noCommunication; - } - - public String getCommunication() { - return communication; - } - - public void setCommunication(String communication) { - this.communication = communication; - } - - public boolean isNoContextMap() { - return noContextMap; - } - - public void setNoContextMap(boolean noContextMap) { - this.noContextMap = noContextMap; - } - - public String getContextMap() { - return contextMap; - } - - public void setContextMap(String contextMap) { - this.contextMap = contextMap; - } - - public boolean isCannotClone() { - return cannotClone; - } - - public void setCannotClone(boolean cannotClone) { - this.cannotClone = cannotClone; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetError.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetError.java index cf13bd5..8d68986 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetError.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetError.java @@ -1,25 +1,11 @@ package edu.baylor.ecs.cloudhubs.prophetdto.app; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class ProphetError { private boolean error; private String errorMessage; - - public ProphetError() { - } - - public boolean isError() { - return error; - } - - public void setError(boolean error) { - this.error = error; - } - - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetRequest.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetRequest.java index 7657690..3d259bd 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetRequest.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetRequest.java @@ -1,38 +1,20 @@ package edu.baylor.ecs.cloudhubs.prophetdto.app; -import java.util.Objects; - +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode +@Getter +@Setter public class ProphetRequest { String url; - public ProphetRequest(){} - - public ProphetRequest(String url) { - this.url = url; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof ProphetRequest)) return false; - ProphetRequest that = (ProphetRequest) o; - return Objects.equals(getUrl(), that.getUrl()); - } - - @Override - public int hashCode() { - return Objects.hash(getUrl()); - } - @Override public String toString() { return "ProphetRequest{" + diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetResponse.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetResponse.java index 33b89c6..fc8eec2 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetResponse.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetResponse.java @@ -2,27 +2,14 @@ import edu.baylor.ecs.cloudhubs.prophetdto.communication.Communication; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class ProphetResponse { private Communication communication; private String[] contextMap; - - public ProphetResponse(){} - - public Communication getCommunication() { - return communication; - } - - public void setCommunication(Communication communication) { - this.communication = communication; - } - - public String[] getContextMap() { - return contextMap; - } - - public void setContextMap(String[] contextMap) { - this.contextMap = contextMap; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetServiceError.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetServiceError.java index 139c884..e3ca8e6 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetServiceError.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/ProphetServiceError.java @@ -1,29 +1,15 @@ package edu.baylor.ecs.cloudhubs.prophetdto.app; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter public class ProphetServiceError { private String errorSource; private String errorMessage; - - public ProphetServiceError() {} - - public ProphetServiceError(String errorSource, String errorMessage) { - this.errorSource = errorSource; - this.errorMessage = errorMessage; - } - - public String getErrorSource() { - return errorSource; - } - - public void setErrorSource(String errorSource) { - this.errorSource = errorSource; - } - - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/boundedcontext/BoundedContextRequest.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/boundedcontext/BoundedContextRequest.java new file mode 100644 index 0000000..5d3cab4 --- /dev/null +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/boundedcontext/BoundedContextRequest.java @@ -0,0 +1,19 @@ +package edu.baylor.ecs.cloudhubs.prophetdto.app.boundedcontext; + +import edu.baylor.ecs.cloudhubs.prophetdto.systemcontext.SystemContext; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.NonNull; +import lombok.Setter; +import lombok.experimental.Accessors; + +@NoArgsConstructor +@Getter +@Setter +public class BoundedContextRequest { + @NonNull + private SystemContext context; + + @Accessors(fluent = true) + private boolean useWuPalmer = false; +} diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/utilsapp/GitReq.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/utilsapp/GitReq.java index bfcdb79..f94e415 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/utilsapp/GitReq.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/utilsapp/GitReq.java @@ -2,20 +2,12 @@ import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class GitReq { private List repositories; private String systemName; - public GitReq() {} - public List getRepositories() { - return repositories; - } - public void setRepositories(List repositories) { - this.repositories = repositories; - } - public String getSystemName() { - return systemName; - } - public void setSystemName(String systemName) { - this.systemName = systemName; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/utilsapp/RepoReq.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/utilsapp/RepoReq.java index 8eb936c..ea0ff4b 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/utilsapp/RepoReq.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/app/utilsapp/RepoReq.java @@ -1,12 +1,12 @@ package edu.baylor.ecs.cloudhubs.prophetdto.app.utilsapp; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class RepoReq { private String path; private boolean isMonolith; - public RepoReq() {} - public String getPath() {return path; } - public void setPath(String path) { this.path = path; } - public boolean isMonolith() { return isMonolith; } - public void setMonolith(boolean monolith) { isMonolith = monolith; } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/communication/Communication.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/communication/Communication.java index ddf6c0c..db3576a 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/communication/Communication.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/communication/Communication.java @@ -2,33 +2,18 @@ import java.util.Set; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter public class Communication { private Set nodes; private Set edges; - - public Communication() { - } - - public Communication(Set nodes, Set edges) { - this.nodes = nodes; - this.edges = edges; - } - - public Set getNodes() { - return nodes; - } - - public void setNodes(Set nodes) { - this.nodes = nodes; - } - - public Set getEdges() { - return edges; - } - - public void setEdges(Set edges) { - this.edges = edges; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/communication/ContextMap.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/communication/ContextMap.java index 831801f..e27c304 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/communication/ContextMap.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/communication/ContextMap.java @@ -1,31 +1,9 @@ package edu.baylor.ecs.cloudhubs.prophetdto.communication; -import java.util.Arrays; +import lombok.Data; +@Data public class ContextMap { String[] markdownStrings; - - public ContextMap(){} - - public String[] getMarkdownStrings() { - return markdownStrings; - } - - public void setMarkdownStrings(String[] markdownStrings) { - this.markdownStrings = markdownStrings; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof ContextMap)) return false; - ContextMap that = (ContextMap) o; - return Arrays.equals(getMarkdownStrings(), that.getMarkdownStrings()); - } - - @Override - public int hashCode() { - return Arrays.hashCode(getMarkdownStrings()); - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidEdge.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidEdge.java index d912610..935cc65 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidEdge.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidEdge.java @@ -1,5 +1,10 @@ package edu.baylor.ecs.cloudhubs.prophetdto.mermaid; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class MermaidEdge { private String from; @@ -36,54 +41,6 @@ public MermaidEdge(String from, String to, String text, boolean isBidirectional, this.toCardinality = toCardinality; } - public String getFrom() { - return from; - } - - public void setFrom(String from) { - this.from = from; - } - - public String getTo() { - return to; - } - - public void setTo(String to) { - this.to = to; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public boolean isBidirectional() { - return isBidirectional; - } - - public void setBidirectional(boolean bidirectional) { - isBidirectional = bidirectional; - } - - public String getFromCardinality() { - return fromCardinality; - } - - public void setFromCardinality(String fromCardinality) { - this.fromCardinality = fromCardinality; - } - - public String getToCardinality() { - return toCardinality; - } - - public void setToCardinality(String toCardinality) { - this.toCardinality = toCardinality; - } - public boolean exists(String from, String to){ if (from.equals(this.from) && to.equals(this.to)){ return true; diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidGraph.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidGraph.java index 02c17be..424fe4c 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidGraph.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidGraph.java @@ -2,12 +2,20 @@ import edu.baylor.ecs.cloudhubs.prophetdto.systemcontext.Entity; import edu.baylor.ecs.cloudhubs.prophetdto.systemcontext.Field; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter public class MermaidGraph { private List nodes; @@ -16,38 +24,6 @@ public class MermaidGraph { private Set entities; - public MermaidGraph(){} - - public MermaidGraph(List nodes, List edges, Set entities) { - this.nodes = nodes; - this.edges = edges; - this.entities = entities; - } - - public List getNodes() { - return nodes; - } - - public void setNodes(List nodes) { - this.nodes = nodes; - } - - public List getEdges() { - return edges; - } - - public void setEdges(List edges) { - this.edges = edges; - } - - public Set getEntities() { - return entities; - } - - public void setEntities(Set entities) { - this.entities = entities; - } - // Class01 <|-- AveryLongClass : Cool // Class03 *-- Class04 diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidNode.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidNode.java index 422dc94..27bb1bd 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidNode.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/MermaidNode.java @@ -1,20 +1,15 @@ package edu.baylor.ecs.cloudhubs.prophetdto.mermaid; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter public class MermaidNode { private String name; - - public MermaidNode(){} - - public MermaidNode(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/ms/MsMermaidGraph.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/ms/MsMermaidGraph.java index d959c8a..fb82dfc 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/ms/MsMermaidGraph.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/mermaid/ms/MsMermaidGraph.java @@ -6,49 +6,25 @@ import java.util.ArrayList; import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + /** * Represents a mermaid graph of a microservice REST communication graph obtained from RAD * TODO: Perhaps MermaidGraph should be broken out into a super class, with this and EntityMermaidGraph as subclasses */ +@AllArgsConstructor +@NoArgsConstructor +@Getter +@Setter public class MsMermaidGraph { private List nodes; private List edges; private MsModel model; - public MsMermaidGraph() { - } - - public MsMermaidGraph(List nodes, List edges, MsModel model) { - this.nodes = nodes; - this.edges = edges; - this.model = model; - } - - public List getNodes() { - return nodes; - } - - public void setNodes(List nodes) { - this.nodes = nodes; - } - - public List getEdges() { - return edges; - } - - public void setEdges(List edges) { - this.edges = edges; - } - - public MsModel getModel() { - return model; - } - - public void setModel(MsModel model) { - this.model = model; - } - public List getHtmlLines() { List lines = new ArrayList<>(); lines.add("graph TD"); diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Annotation.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Annotation.java index ee2cb6e..68c2848 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Annotation.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Annotation.java @@ -1,58 +1,16 @@ package edu.baylor.ecs.cloudhubs.prophetdto.systemcontext; -import java.util.Objects; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +@AllArgsConstructor +@NoArgsConstructor +@Data public class Annotation { private String name; private String stringValue; private Integer intValue; - - public Annotation(){} - - public Annotation(String name, String stringValue, Integer intValue) { - this.name = name; - this.stringValue = stringValue; - this.intValue = intValue; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getStringValue() { - return stringValue; - } - - public void setStringValue(String stringValue) { - this.stringValue = stringValue; - } - - public Integer getIntValue() { - return intValue; - } - - public void setIntValue(Integer intValue) { - this.intValue = intValue; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Annotation that = (Annotation) o; - return Objects.equals(name, that.name) && - Objects.equals(stringValue, that.stringValue) && - Objects.equals(intValue, that.intValue); - } - - @Override - public int hashCode() { - return Objects.hash(name, stringValue, intValue); - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/BoundedContext.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/BoundedContext.java index f4c20b1..262584b 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/BoundedContext.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/BoundedContext.java @@ -1,48 +1,17 @@ package edu.baylor.ecs.cloudhubs.prophetdto.systemcontext; -import java.util.Objects; import java.util.Set; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@AllArgsConstructor +@NoArgsConstructor +@Data public class BoundedContext { private String systemName; private Set boundedContextEntities; - - public BoundedContext(){} - - public BoundedContext(String systemName, Set boundedContextEntities) { - this.systemName = systemName; - this.boundedContextEntities = boundedContextEntities; - } - - public String getSystemName() { - return systemName; - } - - public void setSystemName(String systemName) { - this.systemName = systemName; - } - - public Set getBoundedContextEntities() { - return boundedContextEntities; - } - - public void setBoundedContextEntities(Set boundedContextEntities) { - this.boundedContextEntities = boundedContextEntities; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - BoundedContext that = (BoundedContext) o; - return Objects.equals(systemName, that.systemName) && - Objects.equals(boundedContextEntities, that.boundedContextEntities); - } - - @Override - public int hashCode() { - return Objects.hash(systemName, boundedContextEntities); - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Entity.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Entity.java index 108f890..13226a1 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Entity.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Entity.java @@ -5,6 +5,15 @@ import java.util.Objects; import java.util.Set; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@NoArgsConstructor +@Getter +@Setter +@EqualsAndHashCode public class Entity { private Name entityName; @@ -40,36 +49,6 @@ public Entity copyWithNamePreface(String preface) { return toReturn; } - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Entity entity = (Entity) o; - return Objects.equals(entityName, entity.entityName) && - Objects.equals(fields, entity.fields); - } - - @Override - public int hashCode() { - return Objects.hash(entityName, fields); - } - - public Name getEntityName() { - return entityName; - } - - public void setEntityName(Name entityName) { - this.entityName = entityName; - } - - public Set getFields() { - return fields; - } - - public void setFields(Set fields) { - this.fields = fields; - } - @Override public String toString() { return "Entity{" + diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Field.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Field.java index 7a3a1fc..59991c4 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Field.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Field.java @@ -1,9 +1,11 @@ package edu.baylor.ecs.cloudhubs.prophetdto.systemcontext; import java.util.HashSet; -import java.util.Objects; import java.util.Set; +import lombok.Data; + +@Data public class Field { private Name name; @@ -51,73 +53,6 @@ public Field(Name name, String type, Set annotations, boolean isRefe this.isCollection = isCollection; } - public Name getName() { - return name; - } - - public void setName(Name name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Set getAnnotations() { - return annotations; - } - - public void setAnnotations(Set annotations) { - this.annotations = annotations; - } - - public boolean isCollection() { - return isCollection; - } - - public void setCollection(boolean collection) { - isCollection = collection; - } - - public boolean isReference() { - return isReference; - } - - public void setReference(boolean reference) { - isReference = reference; - } - - public String getEntityRefName() { - return entityRefName; - } - - public void setEntityRefName(String entityRefName) { - this.entityRefName = entityRefName; - } - - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof Field)) return false; - Field field = (Field) o; - return isReference() == field.isReference() && - isCollection() == field.isCollection() && - Objects.equals(getName(), field.getName()) && - Objects.equals(getType(), field.getType()) && - Objects.equals(getAnnotations(), field.getAnnotations()) && - Objects.equals(getEntityRefName(), field.getEntityRefName()); - } - - @Override - public int hashCode() { - return Objects.hash(getName(), getType(), getAnnotations(), isReference(), getEntityRefName(), isCollection()); - } - @Override public String toString() { return "Field{" + diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Module.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Module.java index 065a095..8b695d2 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Module.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Module.java @@ -2,6 +2,9 @@ import java.util.*; +import lombok.Data; + +@Data public class Module { private Name name; @@ -28,34 +31,4 @@ public Module( Name name, Set entities) { this.name = new Name(name); this.entities = entities; } - - public Name getName() { - return name; - } - - public void setName(Name name) { - this.name = name; - } - - public Set getEntities() { - return entities; - } - - public void setEntities(Set entities) { - this.entities = entities; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Module module = (Module) o; - return Objects.equals(name, module.name) && - Objects.equals(entities, module.entities); - } - - @Override - public int hashCode() { - return Objects.hash(name, entities); - } } diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Name.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Name.java index 4e5c132..e0e367b 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Name.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/Name.java @@ -2,27 +2,16 @@ import java.util.Objects; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class Name { private String name; private String fullName; - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - public Name(Name n){ this.name = n.name; this.fullName = n.fullName; diff --git a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/SystemContext.java b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/SystemContext.java index 4b3c4ac..2be2997 100644 --- a/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/SystemContext.java +++ b/src/main/java/edu/baylor/ecs/cloudhubs/prophetdto/systemcontext/SystemContext.java @@ -1,46 +1,17 @@ package edu.baylor.ecs.cloudhubs.prophetdto.systemcontext; -import java.util.Objects; import java.util.Set; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@AllArgsConstructor +@NoArgsConstructor +@Data public class SystemContext { private String systemName; private Set modules; - - public String getSystemName() { - return systemName; - } - - public void setSystemName(String systemName) { - this.systemName = systemName; - } - - public Set getModules() { - return modules; - } - - public void setModules(Set modules) { - this.modules = modules; - } - - public SystemContext(String systemName, Set modules) { - this.systemName = systemName; - this.modules = modules; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - SystemContext that = (SystemContext) o; - return Objects.equals(systemName, that.systemName) && - Objects.equals(modules, that.modules); - } - - @Override - public int hashCode() { - return Objects.hash(systemName, modules); - } }