Add handling for the new WitnessVersion type, similar to u5 but 4-bits
[ldk-java] / src / main / java / org / ldk / util / WitnessVersion.java
1 package org.ldk.util;
2
3 /**
4  * A 4-bit unsigned integer representing a Bitcoin SegWit version
5  */
6 public class WitnessVersion {
7     byte val;
8     public WitnessVersion(byte val) {
9         if (val > 16 || val < 0) {
10             throw new IllegalArgumentException();
11         }
12         this.val = val;
13     }
14
15     /**
16      * @return the value represented
17      */
18     public byte getVal() {
19         return val;
20     }
21 }