Package com.cin.exceptions

Examples of com.cin.exceptions.InvalidInputValueException


   
    // Check the zip after retrieving users. This way, if zip is invalid, but a user
    // has such a zip, the user will be returned.
    if( users.size() == 0 ){
      if( ! aRemote.zipCodeExists(pZipCode) ){
        throw new InvalidInputValueException("Zip code is not valid.");
      }
    }
   
    return users;
  }
View Full Code Here


    try{
      UserDTO user = retrieveUserRecord(policy.getUserSSN());

      if( policy.getDeductibles() < 0 ){
        throw new InvalidInputValueException("Deductibles can't be negative.");
      }
      if( policy.getPropertyName() == null || policy.getPropertyName().equals("")){
        throw new MissingInputValueException("Property name is missing.");
      }
      if( policy.getPropertyValue() <= 0 ){
        throw new InvalidInputValueException("Property value must be positive.");
      }
     
      double quote = (policy.getPropertyValue() - policy.getDeductibles()) * 0.1;
      if (policy.getDeductibles() > policy.getPropertyValue() * 0.2) {
        quote *= 0.90;
View Full Code Here

      throws UserNotFoundException, InvalidInputValueException {

    // check policy object
    if (samplePolicy != null) {
      if (samplePolicy.getDeductibles() < 0) {
        throw new InvalidInputValueException(
            "Deductibles can't be negative.");
      }
      if (samplePolicy.getPropertyName() == null) {
        throw new MissingInputValueException(
            "Property name must be specified.");
      }
      if (samplePolicy.getQuote() <= 0) {
        throw new InvalidInputValueException("Quote must be positive.");
      }
      if (samplePolicy.getUserSSN() != invitation.getCustomer().getSsn()) {
        throw new IllegalArgumentException(
            "SSN on invitation and sample policy are different.");
      }
View Full Code Here

      throw new PurchaseException("Customer is not eligible for policy.");
    }

    int newQuote = calculateQuoteForPolicy(policy);
    if (newQuote != policy.getQuote()) {
      throw new InvalidInputValueException("Quota on the policy is not correct.");
    }

    if (policy.getPropertyName() == null || policy.getPropertyName().equals("")) {
      throw new MissingInputValueException("Policy must include property name.");
    }

    if (policy.getPropertyValue() <= 0) {
      throw new InvalidInputValueException(
          "Policy must include valid property value.");
    }

    if (policy.getDeductibles() < 0) {
      throw new InvalidInputValueException("Deductibles can't be negative.");
    }

    if (policy.getStartDate() != null) {
      throw new PurchaseException("New policy can't include start date.");
    }
View Full Code Here

TOP

Related Classes of com.cin.exceptions.InvalidInputValueException

Copyright © 2018 www.massapicom. 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.