mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-23 23:02:23 +00:00
added Comparable interface to VirtualNetworkConfig so we can sort arrays containing it.
This commit is contained in:
parent
adf89901c4
commit
759d71037e
@ -27,11 +27,13 @@
|
||||
|
||||
package com.zerotier.sdk;
|
||||
|
||||
import java.lang.Comparable;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.ArrayList;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
public final class VirtualNetworkConfig {
|
||||
public final class VirtualNetworkConfig implements Comparable<VirtualNetworkConfig> {
|
||||
public static final int MAX_MULTICAST_SUBSCRIPTIONS = 4096;
|
||||
public static final int ZT1_MAX_ZT_ASSIGNED_ADDRESSES = 16;
|
||||
|
||||
@ -80,6 +82,14 @@ public final class VirtualNetworkConfig {
|
||||
aaEqual;
|
||||
}
|
||||
|
||||
public int compareTo(VirtualNetworkConfig cfg) {
|
||||
if(cfg.nwid == this.nwid) {
|
||||
return 0;
|
||||
} else {
|
||||
return this.nwid > cfg.nwid ? 1 : -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 64-bit ZeroTier network ID
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user