Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tostring to Element classes #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
----

Expand All @@ -45,7 +45,7 @@ dependencies {
----
<dependencies>
<dependency>
<groupId>org.unbrokendome.siren</groupId>
<groupId>org.unbroken-dome.siren</groupId>
<artifactId>siren-core</artifactId>
<version>0.2.0</version>
</dependency>
Expand Down Expand Up @@ -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'
}
----

Expand Down Expand Up @@ -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'
}
----
14 changes: 14 additions & 0 deletions siren-core/src/main/java/org/unbrokendome/siren/model/Action.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
'}';
}
}
12 changes: 12 additions & 0 deletions siren-core/src/main/java/org/unbrokendome/siren/model/Link.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() +
'}';
}
}