You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "beiwei30 (GitHub)" <gi...@apache.org> on 2018/12/07 08:22:28 UTC

[GitHub] [incubator-dubbo] beiwei30 commented on pull request #2909: create AbstractRouter

instead of introduce AbstractRouter, why don't we do this on the interface?

```java
    int getPriority();

    @Override
    default int compareTo(Router o) {
        if (o == null) {
            throw new IllegalArgumentException();
        }

        if (this.getPriority() == o.getPriority()) {
            if (o.getUrl() == null) {
                return -1;
            }
            return getUrl().toFullString().compareTo(o.getUrl().toFullString());
        } else {
            return this.getPriority() > o.getPriority() ? 1 : -1;
        }
    }
}
```

[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2909 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org