Skip to content

Commit

Permalink
#1325 - Polishing.
Browse files Browse the repository at this point in the history
Related ticket: #1314.
  • Loading branch information
odrotbohm committed Jul 24, 2020
1 parent 6f9b123 commit a166f41
Showing 1 changed file with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public class HalLinkRelation implements LinkRelation, MessageSourceResolvable {
private final @Nullable String curie;
private final String localPart;

private HalLinkRelation(String curie, String localPart) {
private HalLinkRelation(@Nullable String curie, String localPart) {

Assert.notNull(localPart, "localPart must not be null!");
Assert.notNull(localPart, "Local part must not be null!");

this.curie = curie;
this.localPart = localPart;
Expand Down Expand Up @@ -222,17 +222,31 @@ public interface HalLinkRelationBuilder {
HalLinkRelation relation(String relation);
}

/*
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object o) {
public boolean equals(@Nullable Object o) {

if (this == o)
if (this == o) {
return true;
if (!(o instanceof HalLinkRelation))
}

if (!(o instanceof HalLinkRelation)) {
return false;
}

HalLinkRelation that = (HalLinkRelation) o;
return Objects.equals(this.curie, that.curie) && Objects.equals(this.localPart, that.localPart);

return Objects.equals(this.curie, that.curie) //
&& Objects.equals(this.localPart, that.localPart);
}

/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return Objects.hash(this.curie, this.localPart);
Expand Down

0 comments on commit a166f41

Please sign in to comment.