-
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.
Another option for polymorphic
repair()
- Loading branch information
1 parent
e84942f
commit ecb59f1
Showing
2 changed files
with
85 additions
and
18 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/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.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); | ||
|
||
private final BigInteger start; | ||
private 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; | ||
} | ||
|
||
} |