BUG-3399: fix BaseYangTypes' range constraints 72/21272/2
authorRobert Varga <rovarga@cisco.com>
Wed, 27 May 2015 23:06:14 +0000 (01:06 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 28 May 2015 07:23:52 +0000 (07:23 +0000)
commitaf2244fc083e788645ac689b543af447efdf5b70
treef588ec7f2d1c6e1e15d9d1bfb83551aacb35139f
parentc5e1800bc2851c90273b6218295ffe2e59fccf91
BUG-3399: fix BaseYangTypes' range constraints

Constraints Number type should match the Java type a particular type is
bound to. Users dealing with values trying to correlate it to the
metadata available can then rely on things like
value.getClass.cast(rangeMin) just working instead of concocting
conversions to deal with all possible combinations of types.

Also changes BaseConstraints to enforce the two components of a
constraint being the same type, preventing things like min being Integer
while max is a Long.

Change-Id: I38e646b4c08b032248349f3e618354aa2114efd3
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-type-provider/src/main/java/org/opendaylight/yangtools/sal/binding/yang/types/BaseYangTypes.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/BaseConstraints.java