[awattar] fix more naming and remove outdated variable

Signed-off-by: Thomas Leber <thomas@tl-photography.at>
This commit is contained in:
Thomas Leber 2024-12-07 16:28:53 +01:00
parent 2cc529b143
commit 70a9c79e6e
2 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,6 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
public class AwattarNonConsecutiveBestPriceResult extends AwattarBestPriceResult { public class AwattarNonConsecutiveBestPriceResult extends AwattarBestPriceResult {
private final List<AwattarPrice> members; private final List<AwattarPrice> members;
private final ZoneId zoneId; private final ZoneId zoneId;
private boolean sorted = true;
public AwattarNonConsecutiveBestPriceResult(List<AwattarPrice> prices, int length, boolean inverted, public AwattarNonConsecutiveBestPriceResult(List<AwattarPrice> prices, int length, boolean inverted,
ZoneId zoneId) { ZoneId zoneId) {
@ -57,7 +56,6 @@ public class AwattarNonConsecutiveBestPriceResult extends AwattarBestPriceResult
} }
private void addMember(AwattarPrice member) { private void addMember(AwattarPrice member) {
sorted = false;
members.add(member); members.add(member);
updateStart(member.timerange().start()); updateStart(member.timerange().start());
updateEnd(member.timerange().end()); updateEnd(member.timerange().end());

View File

@ -25,6 +25,7 @@ import java.util.List;
import java.util.SortedSet; import java.util.SortedSet;
import java.util.TreeSet; import java.util.TreeSet;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.openhab.binding.awattar.internal.handler.TimeRange; import org.openhab.binding.awattar.internal.handler.TimeRange;
@ -34,6 +35,7 @@ import org.openhab.binding.awattar.internal.handler.TimeRange;
* *
* @author Thomas Leber - Initial contribution * @author Thomas Leber - Initial contribution
*/ */
@NonNullByDefault
public class AwattarBestPriceTest { public class AwattarBestPriceTest {
private ZoneId zoneId = ZoneId.of("GMT"); private ZoneId zoneId = ZoneId.of("GMT");
@ -86,7 +88,7 @@ public class AwattarBestPriceTest {
} }
@Test @Test
void AwattarNonConsecutiveBestPriceResult_nonInverted() { void AwattarNonConsecutiveBestPriceResultNonInverted() {
int length = 6; int length = 6;
boolean inverted = false; boolean inverted = false;
@ -99,7 +101,7 @@ public class AwattarBestPriceTest {
} }
@Test @Test
void AwattarNonConsecutiveBestPriceResult_inverted() { void AwattarNonConsecutiveBestPriceResultInverted() {
int length = 4; int length = 4;
boolean inverted = true; boolean inverted = true;