diff --git a/action-node/src/main/java/me/retrodaredevil/action/node/expression/result/SimpleNumericExpressionResult.java b/action-node/src/main/java/me/retrodaredevil/action/node/expression/result/SimpleNumericExpressionResult.java index a8a5d70e..6a81dac5 100644 --- a/action-node/src/main/java/me/retrodaredevil/action/node/expression/result/SimpleNumericExpressionResult.java +++ b/action-node/src/main/java/me/retrodaredevil/action/node/expression/result/SimpleNumericExpressionResult.java @@ -1,7 +1,5 @@ package me.retrodaredevil.action.node.expression.result; -import java.util.Objects; - import static java.util.Objects.requireNonNull; final class SimpleNumericExpressionResult implements NumericExpressionResult { @@ -27,6 +25,6 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hashCode(number.doubleValue()); + return Double.hashCode(number.doubleValue()); } } diff --git a/server/src/main/java/me/retrodaredevil/solarthing/rest/database/InMemoryReplicatorConfig.java b/server/src/main/java/me/retrodaredevil/solarthing/rest/database/InMemoryReplicatorConfig.java index 970d8372..6a633153 100644 --- a/server/src/main/java/me/retrodaredevil/solarthing/rest/database/InMemoryReplicatorConfig.java +++ b/server/src/main/java/me/retrodaredevil/solarthing/rest/database/InMemoryReplicatorConfig.java @@ -65,16 +65,16 @@ public String getDocumentId() { /** * @param inMemoryCouch The {@link CouchProperties} the in memory database can use to refer to itself. {@link CouchProperties#getUri()} should be a localhost address. * @param externalCouch The external {@link CouchProperties} the in memory database can use to refer to the external database. - * @return + * @return A {@link SimpleReplicatorDocument.Builder} that has the source/target set automatically based on {@link #externalIsTarget} */ public SimpleReplicatorDocument.Builder createDocumentBuilder(CouchProperties inMemoryCouch, CouchProperties externalCouch) { ReplicatorSource inMemoryDatabase = createSource(inMemoryCouch, databaseType.getName()); ReplicatorSource externalDatabase = createSource(externalCouch, databaseType.getName()); - SimpleReplicatorDocument.Builder builder = SimpleReplicatorDocument.builder( - externalIsTarget ? inMemoryDatabase : externalDatabase, - externalIsTarget ? externalDatabase : inMemoryDatabase - ); + SimpleReplicatorDocument.Builder builder = SimpleReplicatorDocument.builder( + externalIsTarget ? inMemoryDatabase : externalDatabase, + externalIsTarget ? externalDatabase : inMemoryDatabase + ); // do not make it continuous if we are replication a certain duration. // I have found that if you do make it continuous, the replication will remain triggered, which will not allow it to be updated if (duplicatePastDuration == null) { diff --git a/server/src/main/java/me/retrodaredevil/solarthing/rest/graphql/SolarThingGraphQLExtensions.java b/server/src/main/java/me/retrodaredevil/solarthing/rest/graphql/SolarThingGraphQLExtensions.java index d3ce9ff8..ce22489e 100644 --- a/server/src/main/java/me/retrodaredevil/solarthing/rest/graphql/SolarThingGraphQLExtensions.java +++ b/server/src/main/java/me/retrodaredevil/solarthing/rest/graphql/SolarThingGraphQLExtensions.java @@ -68,11 +68,11 @@ public float getControllerTemperatureFahrenheit(@GraphQLContext TracerStatusPack return "" + identifiable.getDataId(); } @GraphQLQuery - public @NotNull boolean isActive(@GraphQLContext ActivePeriod activePeriod, @GraphQLArgument(name = "dateMillis") long dateMillis) { + public boolean isActive(@GraphQLContext ActivePeriod activePeriod, @GraphQLArgument(name = "dateMillis") long dateMillis) { return activePeriod.isActive(dateMillis); } @GraphQLQuery - public @NotNull boolean isActiveNow(@GraphQLContext ActivePeriod activePeriod) { + public boolean isActiveNow(@GraphQLContext ActivePeriod activePeriod) { return activePeriod.isActive(Instant.now()); } } diff --git a/server/src/main/java/me/retrodaredevil/solarthing/rest/graphql/service/SolarThingGraphQLService.java b/server/src/main/java/me/retrodaredevil/solarthing/rest/graphql/service/SolarThingGraphQLService.java index 639141d2..ad92cb2d 100644 --- a/server/src/main/java/me/retrodaredevil/solarthing/rest/graphql/service/SolarThingGraphQLService.java +++ b/server/src/main/java/me/retrodaredevil/solarthing/rest/graphql/service/SolarThingGraphQLService.java @@ -232,10 +232,9 @@ public SolarThingStatusQuery(PacketGetter packetGetter, List + * {@code + * @Value("${solarthing.config.database}") + * private Path databaseFile; + * } + * + */ public class NioPathPropertyEditorSupport extends PropertyEditorSupport { @Override public String getAsText() { @@ -11,7 +20,7 @@ public String getAsText() { } @Override - public void setAsText(String text) throws IllegalArgumentException { + public void setAsText(String text) { setValue(Path.of(text)); } }