-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea1c395
commit d82219b
Showing
2 changed files
with
44 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
management-api-agent-common/src/main/java/com/datastax/mgmtapi/rpc/models/RingRange.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright DataStax, Inc. | ||
* | ||
* Please see the included license file for details. | ||
*/ | ||
|
||
package com.datastax.mgmtapi.rpc.models; | ||
|
||
import java.math.BigInteger; | ||
import java.util.Comparator; | ||
|
||
public final class RingRange { | ||
|
||
public static final Comparator<RingRange> START_COMPARATOR | ||
= (RingRange o1, RingRange o2) -> o1.start.compareTo(o2.start); | ||
|
||
public final BigInteger start; | ||
public final BigInteger end; | ||
|
||
public RingRange(BigInteger start, BigInteger end) { | ||
this.start = start; | ||
this.end = end; | ||
} | ||
|
||
public RingRange(String... range) { | ||
start = new BigInteger(range[0]); | ||
end = new BigInteger(range[1]); | ||
} | ||
|
||
public BigInteger getStart() { | ||
return start; | ||
} | ||
|
||
public BigInteger getEnd() { | ||
return end; | ||
} | ||
} |