Examples of PodamShortValue


Examples of uk.co.jemos.podam.common.PodamShortValue

    Short retValue = null;

    for (Annotation annotation : annotations) {

      if (PodamShortValue.class.isAssignableFrom(annotation.getClass())) {
        PodamShortValue shortStrategy = (PodamShortValue) annotation;

        String numValueStr = shortStrategy.numValue();
        if (null != numValueStr && !"".equals(numValueStr)) {
          try {
            retValue = Short.valueOf(numValueStr);
          } catch (NumberFormatException nfe) {
            String errMsg = "The precise value: "
                + numValueStr
                + " cannot be converted to a short type. An exception will be thrown.";
            LOG.error(errMsg);
            throw new IllegalArgumentException(errMsg, nfe);
          }
        } else {

          short minValue = shortStrategy.minValue();
          short maxValue = shortStrategy.maxValue();

          // Sanity check
          if (minValue > maxValue) {
            maxValue = minValue;
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.