Example #1
0
  /**
   * TODO
   *
   * @param attributeValue TODO
   * @param requiredAttributeValue TODO
   * @param attributeMatchPattern TODO
   * @return TODO
   */
  private boolean checkAttributeIntegerValueSatisfied(
      Long attributeValue,
      Long requiredAttributeValue,
      org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.generic.virtual.network
              .rev151010.virtual.node.instance.PhysicalResourceRequirement.AttributeMatchPattern
          attributeMatchPattern)
      throws VNMappingException {
    int result = attributeValue.compareTo(requiredAttributeValue);

    switch (attributeMatchPattern) {
      case LessThan:
        return 0 > result;

      case NotLessThan:
        return 0 <= result;

      case Equal:
        return 0 == result;

      case NotEqual:
        return 0 != result;

      case GreaterThan:
        return 0 < result;

      case NotGreaterThan:
        return 0 >= result;

      default:
        throw new VNMappingException(
            "Unsupported attribute match pattern "
                + attributeMatchPattern
                + " for the attribute integer value.");
        //                break;
    }

    //        return false;
  }
Example #2
0
  /**
   * TODO
   *
   * @param attributeValue TODO
   * @param requiredAttributeValue TODO
   * @param attributeMatchPattern TODO
   * @return TODO
   */
  private boolean checkAttributeIntegerValueSatisfied(
      Long attributeValue,
      Long requiredAttributeValue,
      PhysicalResourceRequirement.AttributeMatchPattern attributeMatchPattern)
      throws VNMappingException {
    int result = attributeValue.compareTo(requiredAttributeValue);

    switch (attributeMatchPattern) {
      case LessThan:
        return 0 > result;

      case NotLessThan:
        return 0 <= result;

      case Equal:
        return 0 == result;

      case NotEqual:
        return 0 != result;

      case GreaterThan:
        return 0 < result;

      case NotGreaterThan:
        return 0 >= result;

      default:
        throw new VNMappingException(
            "Unsupported attribute match pattern "
                + attributeMatchPattern
                + " for the attribute integer value.");
        //                break;
    }

    //        return false;
  }