From ff11c81f070062d09bda27f8b41896239510954f Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 25 Jan 2020 12:26:43 +0100 Subject: [PATCH] Rename doubleValue back to value. --- pom.xml | 2 +- .../com/pathofexile/itemtransformer/StatFilterSetter.java | 2 +- .../com/pathofexile/middleware/ModValueRangeMiddleware.java | 6 +++--- .../com/pathofexile/middleware/PseudoModsMiddleware.java | 6 +++--- .../tricht/lunaris/com/pathofexile/request/StatFilter.java | 2 +- .../pathofexile/itemtransformer/ItemTransformerTest.java | 4 ++-- .../itemtransformer/ModDoubleValueRangeMiddlewareTest.java | 4 ++-- .../pathofexile/itemtransformer/PseudoMiddlewareTest.java | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index c0a7c14..19b1b60 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ dev.tricht.lunaris lunaris - 0.5.1-SNAPSHOT + 0.5.1 1.9 diff --git a/src/main/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/StatFilterSetter.java b/src/main/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/StatFilterSetter.java index 07cd6e7..352aee7 100644 --- a/src/main/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/StatFilterSetter.java +++ b/src/main/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/StatFilterSetter.java @@ -108,7 +108,7 @@ private static StatFilter createStatFilter(String apiStatId, Double apiStatValue if (apiStatValue != null) { DoubleValue doubleValue = new DoubleValue(); doubleValue.setMin(apiStatValue); - statFilter.setDoubleValue(doubleValue); + statFilter.setValue(doubleValue); } log.debug(String.format("Affix found as %s", apiStatId)); return statFilter; diff --git a/src/main/java/dev/tricht/lunaris/com/pathofexile/middleware/ModValueRangeMiddleware.java b/src/main/java/dev/tricht/lunaris/com/pathofexile/middleware/ModValueRangeMiddleware.java index 17e033f..cab48c0 100644 --- a/src/main/java/dev/tricht/lunaris/com/pathofexile/middleware/ModValueRangeMiddleware.java +++ b/src/main/java/dev/tricht/lunaris/com/pathofexile/middleware/ModValueRangeMiddleware.java @@ -25,15 +25,15 @@ public void handle(Item item, Query query) { } for(StatFilter filter : query.getStats().get(0).getFilters()) { - if (filter.getDoubleValue() == null) { + if (filter.getValue() == null) { continue; } - if (filter.getDoubleValue().getMin() == null) { + if (filter.getValue().getMin() == null) { continue; } - DoubleValue doubleValue = filter.getDoubleValue(); + DoubleValue doubleValue = filter.getValue(); Double originalValue = doubleValue.getMin(); diff --git a/src/main/java/dev/tricht/lunaris/com/pathofexile/middleware/PseudoModsMiddleware.java b/src/main/java/dev/tricht/lunaris/com/pathofexile/middleware/PseudoModsMiddleware.java index a2d8c08..ff70767 100644 --- a/src/main/java/dev/tricht/lunaris/com/pathofexile/middleware/PseudoModsMiddleware.java +++ b/src/main/java/dev/tricht/lunaris/com/pathofexile/middleware/PseudoModsMiddleware.java @@ -68,13 +68,13 @@ private boolean replaceMods(Query query) { DoubleValue val = new DoubleValue(); val.setMin(0.0); - pseudoFilter.setDoubleValue(val); + pseudoFilter.setValue(val); pseudoStatFilters.put(pseudoMod.getId(), pseudoFilter); } - log.debug("Got pseudo (" + pseudoMod.getId() + "), combining with " + filter.getId() + " (val:" + filter.getDoubleValue() + ")"); + log.debug("Got pseudo (" + pseudoMod.getId() + "), combining with " + filter.getId() + " (val:" + filter.getValue() + ")"); StatFilter pseudoStat = pseudoStatFilters.get(pseudoMod.getId()); - pseudoStat.getDoubleValue().setMin(pseudoStat.getDoubleValue().getMin() + filter.getDoubleValue().getMin()); + pseudoStat.getValue().setMin(pseudoStat.getValue().getMin() + filter.getValue().getMin()); filtersToRemove.add(filter.getId()); } } diff --git a/src/main/java/dev/tricht/lunaris/com/pathofexile/request/StatFilter.java b/src/main/java/dev/tricht/lunaris/com/pathofexile/request/StatFilter.java index 9d35ae6..57f785f 100644 --- a/src/main/java/dev/tricht/lunaris/com/pathofexile/request/StatFilter.java +++ b/src/main/java/dev/tricht/lunaris/com/pathofexile/request/StatFilter.java @@ -8,5 +8,5 @@ public class StatFilter { private String id; private boolean disabled = false; - private DoubleValue doubleValue; + private DoubleValue value; } diff --git a/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/ItemTransformerTest.java b/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/ItemTransformerTest.java index 38bebc5..0d9f28c 100644 --- a/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/ItemTransformerTest.java +++ b/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/ItemTransformerTest.java @@ -477,14 +477,14 @@ public void testWithBothImplicitsAndEnchant() { void assertStatFilter(StatFilter filter, String statId, Double minValue) { Assertions.assertEquals(statId, filter.getId()); if(minValue != null) { - Assertions.assertEquals(minValue, filter.getDoubleValue().getMin()); + Assertions.assertEquals(minValue, filter.getValue().getMin()); } } void assertStatFilter(StatFilter filter, String statId, Integer minValue) { Assertions.assertEquals(statId, filter.getId()); if(minValue != null) { - Assertions.assertEquals(minValue, filter.getDoubleValue().getMin().intValue()); + Assertions.assertEquals(minValue, filter.getValue().getMin().intValue()); } } diff --git a/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/ModDoubleValueRangeMiddlewareTest.java b/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/ModDoubleValueRangeMiddlewareTest.java index 4d36a67..971e147 100644 --- a/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/ModDoubleValueRangeMiddlewareTest.java +++ b/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/ModDoubleValueRangeMiddlewareTest.java @@ -403,14 +403,14 @@ public void testWithBothImplicitsAndEnchant() { void assertStatFilter(StatFilter filter, String statId, Double minValue) { Assertions.assertEquals(statId, filter.getId()); if(minValue != null) { - Assertions.assertEquals(minValue, filter.getDoubleValue().getMin()); + Assertions.assertEquals(minValue, filter.getValue().getMin()); } } void assertStatFilter(StatFilter filter, String statId, Integer minValue) { Assertions.assertEquals(statId, filter.getId()); if(minValue != null) { - Assertions.assertEquals(minValue, filter.getDoubleValue().getMin().intValue()); + Assertions.assertEquals(minValue, filter.getValue().getMin().intValue()); } } diff --git a/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/PseudoMiddlewareTest.java b/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/PseudoMiddlewareTest.java index cd644fa..045384d 100644 --- a/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/PseudoMiddlewareTest.java +++ b/src/test/java/dev/tricht/lunaris/com/pathofexile/itemtransformer/PseudoMiddlewareTest.java @@ -401,14 +401,14 @@ public void testWithBothImplicitsAndEnchant() { void assertStatFilter(StatFilter filter, String statId, Double minValue) { Assertions.assertEquals(statId, filter.getId()); if(minValue != null) { - Assertions.assertEquals(minValue, filter.getDoubleValue().getMin()); + Assertions.assertEquals(minValue, filter.getValue().getMin()); } } void assertStatFilter(StatFilter filter, String statId, Integer minValue) { Assertions.assertEquals(statId, filter.getId()); if(minValue != null) { - Assertions.assertEquals(minValue, filter.getDoubleValue().getMin().intValue()); + Assertions.assertEquals(minValue, filter.getValue().getMin().intValue()); } }