Refactoring:

-Reduce visibility
This commit is contained in:
chimp1984 2020-08-30 19:09:04 -05:00
parent b76357e620
commit ef9ac12519
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
5 changed files with 14 additions and 14 deletions

View file

@ -64,12 +64,12 @@ public class XmrAutoConfirmResult extends AutoConfirmResult {
this(State.UNDEFINED, 0, 0);
}
public XmrAutoConfirmResult(State state) {
XmrAutoConfirmResult(State state) {
this(state, 0, 0);
}
// alternate constructor for showing confirmation progress information
public XmrAutoConfirmResult(State state, int confirmCount, int confirmsRequired) {
XmrAutoConfirmResult(State state, int confirmCount, int confirmsRequired) {
super(state.name());
this.state = state;
this.confirmCount = confirmCount;
@ -77,7 +77,7 @@ public class XmrAutoConfirmResult extends AutoConfirmResult {
}
// alternate constructor for error scenarios
public XmrAutoConfirmResult(State state, @Nullable String errorMsg) {
XmrAutoConfirmResult(State state, @Nullable String errorMsg) {
this(state, 0, 0);
if (!isPendingState() && !isSuccessState() && state != State.FEATURE_DISABLED && state != State.UNDEFINED) {

View file

@ -24,7 +24,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@Value
public class XmrProofInfo {
class XmrProofInfo {
private final String txHash;
private final String txKey;
private final String recipientAddress;
@ -33,7 +33,7 @@ public class XmrProofInfo {
private final int confirmsRequired;
private final String serviceAddress;
public XmrProofInfo(
XmrProofInfo(
String txHash,
String txKey,
String recipientAddress,
@ -50,7 +50,7 @@ public class XmrProofInfo {
this.serviceAddress = serviceAddress;
}
public String getUID() {
String getUID() {
return txHash + "|" + serviceAddress;
}
}

View file

@ -32,8 +32,8 @@ import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class XmrProofParser {
static public XmrAutoConfirmResult parse(XmrProofInfo xmrProofInfo, String jsonTxt) {
class XmrProofParser {
static XmrAutoConfirmResult parse(XmrProofInfo xmrProofInfo, String jsonTxt) {
String txHash = xmrProofInfo.getTxHash();
try {
JsonObject json = new Gson().fromJson(jsonTxt, JsonObject.class);

View file

@ -81,11 +81,11 @@ class XmrTransferProofRequester {
///////////////////////////////////////////////////////////////////////////////////////////
// used by the service to abort further automatic retries
public void stop() {
void stop() {
terminated = true;
}
public void request() {
void request() {
if (terminated) {
// the XmrTransferProofService has asked us to terminate i.e. not make any further api calls
// this scenario may happen if a re-request is scheduled from the callback below

View file

@ -45,7 +45,7 @@ class XmrTransferProofService {
socks5ProxyProvider = provider;
}
public void requestProof(XmrProofInfo xmrProofInfo,
void requestProof(XmrProofInfo xmrProofInfo,
Consumer<XmrAutoConfirmResult> resultHandler,
FaultHandler faultHandler) {
String uid = xmrProofInfo.getUID();
@ -72,7 +72,7 @@ class XmrTransferProofService {
requester.request();
}
public void terminateRequest(XmrProofInfo xmrProofInfo) {
void terminateRequest(XmrProofInfo xmrProofInfo) {
String uid = xmrProofInfo.getUID();
XmrTransferProofRequester requester = map.getOrDefault(uid, null);
if (requester != null) {