mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
added Comparable interface to VirtualNetworkConfig so we can sort arrays containing it.
This commit is contained in:
parent
adf89901c4
commit
759d71037e
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue