From 497eeb697d9f522889e46e4fe6d37682676673f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicklas=20Franz=C3=A9n?= Date: Mon, 5 Oct 2020 16:49:48 +0200 Subject: [PATCH 1/2] Update README to use org.unbroken-dome.siren as groupId. --- README.adoc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.adoc b/README.adoc index ef8602c..6ff04e6 100644 --- a/README.adoc +++ b/README.adoc @@ -36,7 +36,7 @@ Declare a dependency on the `siren-core` JAR in your build tool: [source,groovy] ---- dependencies { - compile 'org.unbrokendome.siren:siren-core:0.2.0' + compile 'org.unbroken-dome.siren:siren-core:0.2.0' } ---- @@ -45,7 +45,7 @@ dependencies { ---- - org.unbrokendome.siren + org.unbroken-dome.siren siren-core 0.2.0 @@ -162,8 +162,8 @@ plugins { } dependencies { - implementation 'org.unbrokendome.siren:siren-core:0.2.0' - apt 'org.unbrokendome.siren:siren-spring-ap:0.2.0' + implementation 'org.unbroken-dome.siren:siren-core:0.2.0' + apt 'org.unbroken-dome.siren:siren-spring-ap:0.2.0' } ---- @@ -236,7 +236,7 @@ plugins { } dependencies { - compile 'org.unbrokendome.siren:siren-core:0.2.0' - kapt 'org.unbrokendome.siren:siren-spring-ap:0.2.0' + compile 'org.unbroken-dome.siren:siren-core:0.2.0' + kapt 'org.unbroken-dome.siren:siren-spring-ap:0.2.0' } ---- From a743f068b6659c3e888fec0b98442309840ecea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicklas=20Franz=C3=A9n?= Date: Tue, 6 Oct 2020 11:33:50 +0200 Subject: [PATCH 2/2] Add toString to Element classes. This makes testing and logging easier to read, for example API test with Hamcrest matchers where the toString is used. --- .../java/org/unbrokendome/siren/model/Action.java | 14 ++++++++++++++ .../org/unbrokendome/siren/model/ActionField.java | 12 ++++++++++++ .../java/org/unbrokendome/siren/model/Element.java | 9 +++++++++ .../unbrokendome/siren/model/EmbeddedEntity.java | 14 ++++++++++++++ .../org/unbrokendome/siren/model/FullEntity.java | 13 +++++++++++++ .../java/org/unbrokendome/siren/model/Link.java | 12 ++++++++++++ .../org/unbrokendome/siren/model/Reference.java | 11 +++++++++++ .../org/unbrokendome/siren/model/RootEntity.java | 13 +++++++++++++ 8 files changed, 98 insertions(+) diff --git a/siren-core/src/main/java/org/unbrokendome/siren/model/Action.java b/siren-core/src/main/java/org/unbrokendome/siren/model/Action.java index 92cd8f8..e64d4b8 100644 --- a/siren-core/src/main/java/org/unbrokendome/siren/model/Action.java +++ b/siren-core/src/main/java/org/unbrokendome/siren/model/Action.java @@ -70,4 +70,18 @@ private boolean equals(Action other) { public int hashCode() { return Objects.hash(super.hashCode(), name, method, fields); } + + @Override + public String toString() { + return "Action{" + + "name='" + name + '\'' + + ", method='" + method + '\'' + + ", fields=" + fields + + ", href='" + getHref() + '\'' + + ", type='" + getType() + '\'' + + ", classes=" + getClasses() + + ", title='" + getTitle() + '\'' + + ", customProperties=" + getCustomProperties() + + '}'; + } } diff --git a/siren-core/src/main/java/org/unbrokendome/siren/model/ActionField.java b/siren-core/src/main/java/org/unbrokendome/siren/model/ActionField.java index a81a330..dec719b 100644 --- a/siren-core/src/main/java/org/unbrokendome/siren/model/ActionField.java +++ b/siren-core/src/main/java/org/unbrokendome/siren/model/ActionField.java @@ -115,4 +115,16 @@ private boolean equals(ActionField other) { public int hashCode() { return Objects.hash(super.hashCode(), name, type, value); } + + @Override + public String toString() { + return "ActionField{" + + "name='" + name + '\'' + + ", type=" + type + + ", value=" + value + + ", classes=" + getClasses() + + ", title='" + getTitle() + '\'' + + ", customProperties=" + getCustomProperties() + + '}'; + } } diff --git a/siren-core/src/main/java/org/unbrokendome/siren/model/Element.java b/siren-core/src/main/java/org/unbrokendome/siren/model/Element.java index f3c8116..e4ccef1 100644 --- a/siren-core/src/main/java/org/unbrokendome/siren/model/Element.java +++ b/siren-core/src/main/java/org/unbrokendome/siren/model/Element.java @@ -65,4 +65,13 @@ private boolean equals(Element other) { public int hashCode() { return Objects.hash(classes, title); } + + @Override + public String toString() { + return "Element{" + + "classes=" + classes + + ", title='" + title + '\'' + + ", customProperties=" + customProperties + + '}'; + } } diff --git a/siren-core/src/main/java/org/unbrokendome/siren/model/EmbeddedEntity.java b/siren-core/src/main/java/org/unbrokendome/siren/model/EmbeddedEntity.java index a730920..2b22b4e 100644 --- a/siren-core/src/main/java/org/unbrokendome/siren/model/EmbeddedEntity.java +++ b/siren-core/src/main/java/org/unbrokendome/siren/model/EmbeddedEntity.java @@ -49,4 +49,18 @@ private boolean equals(EmbeddedEntity other) { public int hashCode() { return Objects.hash(super.hashCode(), rel); } + + @Override + public String toString() { + return "EmbeddedEntity{" + + "rel=" + rel + + ", properties=" + getProperties() + + ", entities=" + getEntities() + + ", links=" + getLinks() + + ", actions=" + getActions() + + ", classes=" + getClasses() + + ", title='" + getTitle() + '\'' + + ", customProperties=" + getCustomProperties() + + '}'; + } } diff --git a/siren-core/src/main/java/org/unbrokendome/siren/model/FullEntity.java b/siren-core/src/main/java/org/unbrokendome/siren/model/FullEntity.java index 82f4e94..8f02d2e 100644 --- a/siren-core/src/main/java/org/unbrokendome/siren/model/FullEntity.java +++ b/siren-core/src/main/java/org/unbrokendome/siren/model/FullEntity.java @@ -84,4 +84,17 @@ public int hashCode() { return Objects.hash(super.hashCode(), properties, entities, links, actions); } + + @Override + public String toString() { + return "FullEntity{" + + "properties=" + properties + + ", entities=" + entities + + ", links=" + links + + ", actions=" + actions + + ", classes=" + getClasses() + + ", title='" + getTitle() + '\'' + + ", customProperties=" + getCustomProperties() + + '}'; + } } diff --git a/siren-core/src/main/java/org/unbrokendome/siren/model/Link.java b/siren-core/src/main/java/org/unbrokendome/siren/model/Link.java index 68b6b9d..8d902d2 100644 --- a/siren-core/src/main/java/org/unbrokendome/siren/model/Link.java +++ b/siren-core/src/main/java/org/unbrokendome/siren/model/Link.java @@ -49,4 +49,16 @@ private boolean equals(Link other) { public int hashCode() { return Objects.hash(super.hashCode(), rel); } + + @Override + public String toString() { + return "Link{" + + "rel=" + rel + + ", href='" + getHref() + '\'' + + ", type='" + getType() + '\'' + + ", classes=" + getClasses() + + ", title='" + getTitle() + '\'' + + ", customProperties=" + getCustomProperties() + + '}'; + } } diff --git a/siren-core/src/main/java/org/unbrokendome/siren/model/Reference.java b/siren-core/src/main/java/org/unbrokendome/siren/model/Reference.java index 4c68a64..bb56d2f 100644 --- a/siren-core/src/main/java/org/unbrokendome/siren/model/Reference.java +++ b/siren-core/src/main/java/org/unbrokendome/siren/model/Reference.java @@ -58,4 +58,15 @@ private boolean equals(Reference other) { public int hashCode() { return Objects.hash(super.hashCode(), href, type); } + + @Override + public String toString() { + return "Reference{" + + "href='" + href + '\'' + + ", type='" + type + '\'' + + ", classes=" + getClasses() + + ", title='" + getTitle() + '\'' + + ", customProperties=" + getCustomProperties() + + '}'; + } } diff --git a/siren-core/src/main/java/org/unbrokendome/siren/model/RootEntity.java b/siren-core/src/main/java/org/unbrokendome/siren/model/RootEntity.java index eb7995e..b6eaf01 100644 --- a/siren-core/src/main/java/org/unbrokendome/siren/model/RootEntity.java +++ b/siren-core/src/main/java/org/unbrokendome/siren/model/RootEntity.java @@ -23,4 +23,17 @@ public RootEntity(@Nullable Object properties, public static RootEntityBuilder builder() { return new RootEntityBuilder(); } + + @Override + public String toString() { + return "RootEntity{" + + "properties=" + getProperties() + + ", entities=" + getEntities() + + ", links=" + getLinks() + + ", actions=" + getActions() + + ", classes=" + getClasses() + + ", title='" + getTitle() + '\'' + + ", customProperties=" + getCustomProperties() + + '}'; + } }