mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-19 15:43:53 +00:00
added Comparable interface to VirtualNetworkConfig so we can sort arrays containing it.
This commit is contained in:
@ -27,11 +27,13 @@
|
|||||||
|
|
||||||
package com.zerotier.sdk;
|
package com.zerotier.sdk;
|
||||||
|
|
||||||
|
import java.lang.Comparable;
|
||||||
|
import java.lang.Override;
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.net.InetSocketAddress;
|
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 MAX_MULTICAST_SUBSCRIPTIONS = 4096;
|
||||||
public static final int ZT1_MAX_ZT_ASSIGNED_ADDRESSES = 16;
|
public static final int ZT1_MAX_ZT_ASSIGNED_ADDRESSES = 16;
|
||||||
|
|
||||||
@ -80,6 +82,14 @@ public final class VirtualNetworkConfig {
|
|||||||
aaEqual;
|
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
|
* 64-bit ZeroTier network ID
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user