forked from Qortal/qortal
Remove duplicates in GET /arbitrary/hosted/resources response
This commit is contained in:
parent
fcdcc939e6
commit
54af36fb85
@ -400,7 +400,9 @@ public class ArbitraryResource {
|
||||
arbitraryResourceInfo.name = transactionData.getName();
|
||||
arbitraryResourceInfo.service = transactionData.getService();
|
||||
arbitraryResourceInfo.identifier = transactionData.getIdentifier();
|
||||
resources.add(arbitraryResourceInfo);
|
||||
if (!resources.contains(arbitraryResourceInfo)) {
|
||||
resources.add(arbitraryResourceInfo);
|
||||
}
|
||||
}
|
||||
|
||||
if (includeStatus != null && includeStatus == true) {
|
||||
|
@ -4,6 +4,7 @@ import org.qortal.arbitrary.misc.Service;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import java.util.Objects;
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ArbitraryResourceInfo {
|
||||
@ -16,4 +17,19 @@ public class ArbitraryResourceInfo {
|
||||
public ArbitraryResourceInfo() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == this)
|
||||
return true;
|
||||
|
||||
if (!(o instanceof ArbitraryResourceInfo))
|
||||
return false;
|
||||
|
||||
ArbitraryResourceInfo other = (ArbitraryResourceInfo) o;
|
||||
|
||||
return Objects.equals(this.name, other.name) &&
|
||||
Objects.equals(this.service, other.service) &&
|
||||
Objects.equals(this.identifier, other.identifier);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user