Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

Revision history [back]

click to hide/show revision 1
initial version

ODL Yang tool alway recognize rang like "-199..199" as an Integer even it's in a decimal64 type data.

typedef TEMPREADING would be generated to be a correct java class. but alway after it's used in anywhere like below, a container, the "type TEMPREADING;", the range would be recognized as a BigInteger in java and BigDecimal (came from decimal64 in yang) would be forced to BigInteger in java coded, of course it's error. Why? Is there any way to avoid this without change the data type (decimal64)? Thx a lot.

Yang: module exa-base { namespace "http://www.abc.com/ns/ebc/base"; prefix exa;

revision "2014-02-26" {
    description "Initial version";
}

container info {
    leaf system-temperature {
        type TEMP_READING;
            units "degC";
            description "System temperature";
        }
}

typedef TEMP_READING{
    type decimal64{
        fraction-digits 1;
        range "-199..199";
    }
    description "System temperature sensor reading (range: -199.9-199.9)";
    type-mode FLOAT;
}

}