Skip to content

Commit deedd16

Browse files
committed
fixed license - now for each file separately
1 parent f89a138 commit deedd16

File tree

200 files changed

+2055
-2054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+2055
-2054
lines changed

de.ibapl.fhz4j.console/src/main/java/de/ibapl/fhz4j/console/Main.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2017-2024, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*
@@ -419,13 +419,12 @@ public void run(SerialPortSocket serialPortSocket, Set<Protocol> protocols, Spee
419419
c = (char) System.in.read();
420420

421421
switch (c) {
422-
case 'q':
422+
case 'q' ->
423423
System.out.print("Bye will close down!");
424-
break;
425-
case 'r':
424+
case 'r' ->
426425
culAddapter.initFhtReporting(DEVICES_HOME_CODE);
427-
break;
428-
default:
426+
default -> {
427+
}
429428
}
430429
} while (c != 'q');
431430

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/LogUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2017-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/api/Adapter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*
1+
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2019-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/api/EvoHomeHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2019-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/api/FhzHandler.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2019-2024, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*
@@ -73,13 +73,15 @@ public synchronized T get(long timeout, TimeUnit unit) throws InterruptedExcepti
7373
return result;
7474
} else {
7575
switch (unit) {
76-
case MILLISECONDS:
76+
case MILLISECONDS -> {
7777
wait(timeout);
7878
return result;
79-
case SECONDS:
79+
}
80+
case SECONDS -> {
8081
wait(timeout * 1000);
8182
return result;
82-
default:
83+
}
84+
default ->
8385
throw new IllegalArgumentException("Only ms and s are allowed");
8486
}
8587
}

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/api/Message.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2019-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/api/Protocol.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2019-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/api/Request.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/api/Response.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulAdapter.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2018-2024, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*
@@ -36,7 +36,6 @@
3636
import de.ibapl.fhz4j.writer.evohome.EvoHomeEncoder;
3737
import de.ibapl.fhz4j.writer.fht.FhtEncoder;
3838
import de.ibapl.spsw.api.DataBits;
39-
import de.ibapl.spsw.api.FlowControl;
4039
import de.ibapl.spsw.api.Parity;
4140
import de.ibapl.spsw.api.SerialPortSocket;
4241
import de.ibapl.spsw.api.Speed;
@@ -128,7 +127,7 @@ public CulAdapter(SerialPortSocket serialPortSocket, CulMessageListener fhzDataL
128127
*
129128
* @param serialPortSocket
130129
* @param fhzDataListener
131-
* @param sped
130+
* @param speed
132131
* @throws java.io.IOException
133132
*/
134133
public CulAdapter(SerialPortSocket serialPortSocket, CulMessageListener fhzDataListener, Speed speed) throws IOException {
@@ -140,7 +139,6 @@ public CulAdapter(SerialPortSocket serialPortSocket, CulMessageListener fhzDataL
140139
serialPortSocket.setDataBits(DataBits.DB_8);
141140
serialPortSocket.setParity(Parity.NONE);
142141
serialPortSocket.setStopBits(StopBits.SB_1);
143-
serialPortSocket.setFlowControl(FlowControl.getFC_NONE());
144142
serialPortSocket.setTimeouts(100, 60000, 1000);
145143

146144
this.serialPortSocket = serialPortSocket;

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulEobMessage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulFhtDeviceOutBufferContentRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulFhtDeviceOutBufferContentResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulGetFirmwareVersionRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulGetFirmwareVersionResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulGetHardwareVersionRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulGetHardwareVersionResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulGetSlowRfSettingsRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulGetSlowRfSettingsResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulLovfMessage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulMessage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2019-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulMessageListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2019-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulRemainingFhtDeviceOutBufferSizeRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulRemainingFhtDeviceOutBufferSizeResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/CulSetSlowRfSettingsRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/cul/SlowRfFlag.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/parser/api/AbstractParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2019-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/parser/api/Parser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2017-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/parser/api/ParserListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2017-2023, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*

de.ibapl.fhz4j.parser.cul/src/main/java/de/ibapl/fhz4j/parser/cul/AbstractCulParser.java

+37-37
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* FHZ4J - Drivers for the Wireless FS20, FHT and HMS protocol https://github.com/aploese/fhz4j/
3-
* Copyright (C) 2009-2023, Arne Plöse and individual contributors as indicated
3+
* Copyright (C) 2021-2024, Arne Plöse and individual contributors as indicated
44
* by the @authors tag. See the copyright.txt in the distribution for a
55
* full listing of individual contributors.
66
*
@@ -31,42 +31,42 @@ public abstract class AbstractCulParser {
3131
protected boolean isFirstNibble = true;
3232

3333
protected byte digit2Byte(char c) {
34-
switch (c) {
35-
case '0':
36-
return 0x00;
37-
case '1':
38-
return 0x01;
39-
case '2':
40-
return 0x02;
41-
case '3':
42-
return 0x03;
43-
case '4':
44-
return 0x04;
45-
case '5':
46-
return 0x05;
47-
case '6':
48-
return 0x06;
49-
case '7':
50-
return 0x07;
51-
case '8':
52-
return 0x08;
53-
case '9':
54-
return 0x09;
55-
case 'A':
56-
return 0x0a;
57-
case 'B':
58-
return 0x0b;
59-
case 'C':
60-
return 0x0c;
61-
case 'D':
62-
return 0x0d;
63-
case 'E':
64-
return 0x0e;
65-
case 'F':
66-
return 0x0f;
67-
default:
68-
throw new RuntimeException(String.format("Not a Number: \"%c\" 0x%02x", c, (byte) c));
69-
}
34+
return switch (c) {
35+
case '0' ->
36+
0x00;
37+
case '1' ->
38+
0x01;
39+
case '2' ->
40+
0x02;
41+
case '3' ->
42+
0x03;
43+
case '4' ->
44+
0x04;
45+
case '5' ->
46+
0x05;
47+
case '6' ->
48+
0x06;
49+
case '7' ->
50+
0x07;
51+
case '8' ->
52+
0x08;
53+
case '9' ->
54+
0x09;
55+
case 'A' ->
56+
0x0a;
57+
case 'B' ->
58+
0x0b;
59+
case 'C' ->
60+
0x0c;
61+
case 'D' ->
62+
0x0d;
63+
case 'E' ->
64+
0x0e;
65+
case 'F' ->
66+
0x0f;
67+
default ->
68+
throw new IllegalArgumentException(String.format("Not a Number: \"%c\" 0x%02x", c, (byte) c));
69+
};
7070
}
7171

7272
public abstract void parse(char c);

0 commit comments

Comments
 (0)