Commit e4b1c696 authored by tordinge's avatar tordinge Committed by Karsten Loesing
Browse files

renamed all getter methods that return [Bb]oolean to follow isXY() pattern

parent eb7d1430
......@@ -3,6 +3,8 @@
* Minor changes
- Rename root package org.torproject.onionoo to
org.torproject.metrics.onionoo.
- Rename all [Bb]oolean field getter methods to follow isXY()
pattern.
# Changes in version 7.0-1.18.1 - 2018-09-11
......
......@@ -128,7 +128,7 @@ public class DetailsDocument extends Document {
this.running = running;
}
public Boolean getRunning() {
public Boolean isRunning() {
return this.running;
}
......@@ -527,7 +527,7 @@ public class DetailsDocument extends Document {
this.recommendedVersion = recommendedVersion;
}
public Boolean getRecommendedVersion() {
public Boolean isRecommendedVersion() {
return this.recommendedVersion;
}
......@@ -537,7 +537,7 @@ public class DetailsDocument extends Document {
this.hibernating = hibernating;
}
public Boolean getHibernating() {
public Boolean isHibernating() {
return this.hibernating;
}
......@@ -558,7 +558,7 @@ public class DetailsDocument extends Document {
this.measured = measured;
}
public Boolean getMeasured() {
public Boolean isMeasured() {
return this.measured;
}
......
......@@ -171,7 +171,7 @@ public class DetailsStatus extends Document {
this.hibernating = hibernating;
}
public Boolean getHibernating() {
public Boolean isHibernating() {
return this.hibernating;
}
......@@ -369,7 +369,7 @@ public class DetailsStatus extends Document {
this.recommendedVersion = recommendedVersion;
}
public Boolean getRecommendedVersion() {
public Boolean isRecommendedVersion() {
return this.recommendedVersion;
}
......@@ -379,7 +379,7 @@ public class DetailsStatus extends Document {
this.measured = measured;
}
public Boolean getMeasured() {
public Boolean isMeasured() {
return this.measured;
}
......
......@@ -367,7 +367,7 @@ public class NodeStatus extends Document {
this.recommendedVersion = recommendedVersion;
}
public Boolean getRecommendedVersion() {
public Boolean isRecommendedVersion() {
return this.recommendedVersion;
}
......
......@@ -360,7 +360,7 @@ public class SummaryDocument extends Document {
this.recommendedVersion = recommendedVersion;
}
public Boolean getRecommendedVersion() {
public Boolean isRecommendedVersion() {
return this.recommendedVersion;
}
......
......@@ -293,7 +293,7 @@ public class NodeIndexer implements ServletContextListener, Runnable {
newRelaysByHostName.get(hostNameLowerCase).add(fingerprint);
newRelaysByHostName.get(hostNameLowerCase).add(hashedFingerprint);
}
Boolean recommendedVersion = entry.getRecommendedVersion();
Boolean recommendedVersion = entry.isRecommendedVersion();
if (null != recommendedVersion) {
newRelaysByRecommendedVersion.get(recommendedVersion).add(fingerprint);
newRelaysByRecommendedVersion.get(recommendedVersion).add(
......@@ -362,7 +362,7 @@ public class NodeIndexer implements ServletContextListener, Runnable {
newBridgesByOperatingSystem.get(operatingSystem)
.add(hashedHashedFingerprint);
}
Boolean recommendedVersion = entry.getRecommendedVersion();
Boolean recommendedVersion = entry.isRecommendedVersion();
if (null != recommendedVersion) {
newBridgesByRecommendedVersion.get(recommendedVersion).add(
hashedFingerprint);
......
......@@ -273,7 +273,7 @@ public class ResponseBuilder {
dd.setFirstSeen(detailsDocument.getFirstSeen());
break;
case "running":
dd.setRunning(detailsDocument.getRunning());
dd.setRunning(detailsDocument.isRunning());
break;
case "flags":
dd.setFlags(detailsDocument.getFlags());
......@@ -362,10 +362,10 @@ public class ResponseBuilder {
break;
case "recommended_version":
dd.setRecommendedVersion(
detailsDocument.getRecommendedVersion());
detailsDocument.isRecommendedVersion());
break;
case "hibernating":
dd.setHibernating(detailsDocument.getHibernating());
dd.setHibernating(detailsDocument.isHibernating());
break;
case "transports":
dd.setTransports(detailsDocument.getTransports());
......@@ -374,7 +374,7 @@ public class ResponseBuilder {
dd.setEffectiveFamily(detailsDocument.getEffectiveFamily());
break;
case "measured":
dd.setMeasured(detailsDocument.getMeasured());
dd.setMeasured(detailsDocument.isMeasured());
break;
case "alleged_family":
dd.setAllegedFamily(detailsDocument.getAllegedFamily());
......
......@@ -489,7 +489,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
updatedNodeStatus.setAsNumber(nodeStatus.getAsNumber());
updatedNodeStatus.setAsName(nodeStatus.getAsName());
updatedNodeStatus.setRecommendedVersion(
nodeStatus.getRecommendedVersion());
nodeStatus.isRecommendedVersion());
updatedNodeStatus.setVersion(nodeStatus.getVersion());
}
if (nodeStatus.getFirstSeenMillis()
......@@ -935,7 +935,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
detailsStatus.setDefaultPolicy(nodeStatus.getDefaultPolicy());
detailsStatus.setPortList(nodeStatus.getPortList());
detailsStatus.setRecommendedVersion(
nodeStatus.getRecommendedVersion());
nodeStatus.isRecommendedVersion());
detailsStatus.setLastChangedOrAddressOrPort(
nodeStatus.getLastChangedOrAddressOrPort());
detailsStatus.setVersion(nodeStatus.getVersion());
......
......@@ -89,7 +89,7 @@ public class DetailsDocumentWriter implements DocumentWriter {
detailsDocument.setExitPolicySummary(exitPolicySummary);
}
detailsDocument.setRecommendedVersion(
detailsStatus.getRecommendedVersion());
detailsStatus.isRecommendedVersion());
detailsDocument.setCountry(detailsStatus.getCountryCode());
detailsDocument.setLatitude(detailsStatus.getLatitude());
detailsDocument.setLongitude(detailsStatus.getLongitude());
......@@ -135,13 +135,13 @@ public class DetailsDocumentWriter implements DocumentWriter {
}
detailsDocument.setExitPolicyV6Summary(
detailsStatus.getExitPolicyV6Summary());
detailsDocument.setHibernating(detailsStatus.getHibernating());
detailsDocument.setHibernating(detailsStatus.isHibernating());
if (detailsStatus.getExitAddresses() != null) {
List<String> exitAddresses = new ArrayList<>(new TreeSet<>(
detailsStatus.getExitAddresses().keySet()));
detailsDocument.setExitAddresses(exitAddresses);
}
detailsDocument.setMeasured(detailsStatus.getMeasured());
detailsDocument.setMeasured(detailsStatus.isMeasured());
List<String> unreachableOrAddresses = new ArrayList<>();
if (null != detailsStatus.getAdvertisedOrAddresses()) {
unreachableOrAddresses.addAll(detailsStatus.getAdvertisedOrAddresses());
......@@ -178,7 +178,7 @@ public class DetailsDocumentWriter implements DocumentWriter {
detailsDocument.setRunning(detailsStatus.isRunning());
detailsDocument.setFlags(detailsStatus.getRelayFlags());
detailsDocument.setRecommendedVersion(
detailsStatus.getRecommendedVersion());
detailsStatus.isRecommendedVersion());
detailsDocument.setLastRestarted(detailsStatus.getLastRestarted());
detailsDocument.setAdvertisedBandwidth(
detailsStatus.getAdvertisedBandwidth());
......
......@@ -97,7 +97,7 @@ public class SummaryDocumentWriter implements DocumentWriter {
SortedSet<String> verifiedHostNames = nodeStatus.getVerifiedHostNames();
SortedSet<String> unverifiedHostNames =
nodeStatus.getUnverifiedHostNames();
Boolean recommendedVersion = nodeStatus.getRecommendedVersion();
Boolean recommendedVersion = nodeStatus.isRecommendedVersion();
SummaryDocument summaryDocument = new SummaryDocument(isRelay,
nickname, fingerprint, addresses, lastSeenMillis, running,
relayFlags, consensusWeight, countryCode, firstSeenMillis,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment