#825 - Comply with RFC8288 for LinkRelation matching.
Added several tests to ensure compliance with RFC8288. Original pull request: #826.
This commit is contained in:
committed by
Oliver Drotbohm
parent
9131a82b90
commit
19036880b4
@@ -73,6 +73,6 @@ public interface LinkRelation {
|
||||
|
||||
Assert.notNull(relation, "LinkRelation must not be null!");
|
||||
|
||||
return this.value().equals(relation.value());
|
||||
return this.value().equalsIgnoreCase(relation.value());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ class StringLinkRelation implements LinkRelation, Serializable {
|
||||
|
||||
Assert.hasText(relation, "Relation must not be null or empty!");
|
||||
|
||||
return CACHE.computeIfAbsent(relation, it -> new StringLinkRelation(it));
|
||||
return CACHE.computeIfAbsent(relation, StringLinkRelation::new);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -75,4 +75,19 @@ class StringLinkRelation implements LinkRelation, Serializable {
|
||||
public String toString() {
|
||||
return value();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
StringLinkRelation that = (StringLinkRelation) o;
|
||||
return this.relation.equalsIgnoreCase(that.relation);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user