Implement Uint{8,16}.valueOf(String, int) 59/66759/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 25 Dec 2017 12:53:37 +0000 (13:53 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 25 Dec 2017 16:30:41 +0000 (17:30 +0100)
commit2ea7438f6d6ea7e37a3dadc1d647d398d027d9cb
tree2cd2ffe34d6a6385a1200aa3d93d43e4efe7c7d9
parent6263890e48e422156cf083d2120ccd180d51dcde
Implement Uint{8,16}.valueOf(String, int)

This adds a simplistic implementation deferring parsing to
Short/Integer.valueOf(String, int) and performing range checking.

Also expands the test suite to cover Uint{8,16,32,64}, which flushes
out a bug in Uint64's handling of cache slots -- this is fixed, too.

Change-Id: I8fa977028a6f00ee8f25a19fdd2fd5d2b08b4bfa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint16.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint32.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint64.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint8.java
yang/yang-common/src/test/java/org/opendaylight/yangtools/yang/common/Uint16Test.java [new file with mode: 0644]
yang/yang-common/src/test/java/org/opendaylight/yangtools/yang/common/Uint32Test.java [new file with mode: 0644]
yang/yang-common/src/test/java/org/opendaylight/yangtools/yang/common/Uint64Test.java [new file with mode: 0644]
yang/yang-common/src/test/java/org/opendaylight/yangtools/yang/common/Uint8Test.java [new file with mode: 0644]