Examples of InvalidInputValueException


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

Examples of com.cin.exceptions.InvalidInputValueException

    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

Examples of com.cin.exceptions.InvalidInputValueException

      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

Examples of com.cin.exceptions.InvalidInputValueException

      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

Examples of uk.org.ogsadai.activity.io.InvalidInputValueException

                int value = ((Number)block).intValue();
                if (value > 0) arraySize = value;
            }
            else
            {
                throw new InvalidInputValueException(INPUT_ARRAY_SIZE, block);
            }
        }
        return arraySize;
    }
View Full Code Here

Examples of uk.org.ogsadai.activity.io.InvalidInputValueException

            // make sure we have a list of binary data
            // BytesInputStream expects that the LIST_BEGIN has been read
            Object first = data.read();
            if (first != ControlBlock.LIST_BEGIN)
            {
                throw new InvalidInputValueException(INPUT_DATA, first);
            }
           
            BytesInputStream bytes = new BytesInputStream(INPUT_DATA, data);
            STypeInputStream input = new STypeInputStream(bytes);
           
View Full Code Here

Examples of uk.org.ogsadai.activity.io.InvalidInputValueException

          aggregates.add(tuple.getDouble(0));
          aggregates.add(tuple.getDouble(1));
      }
      catch(NumberFormatException exc)
      {
        throw new InvalidInputValueException(INPUT_AGGREGATES, Double.class, exc);
      }
      if(tuples.nextValue() != null)
        throw new ActivityUserException(new AggregatesListIncorrectException());
      return aggregates;
  }
View Full Code Here

Examples of uk.org.ogsadai.activity.io.InvalidInputValueException

    {
        return ((Number)block).intValue();
    }
    else
    {
        throw new InvalidInputValueException(
                INPUT_KEY_INDEX, Number.class, block.getClass());
    }
}
View Full Code Here

Examples of uk.org.ogsadai.activity.io.InvalidInputValueException

            imageMatrix[y][x] = wr.getSample(x, y, 0);

        // Write image as byte[] to the output
          mOutput.write(imageMatrix);
          } else {
              throw new InvalidInputValueException(
                  "input",        
                  BufferedImage.class,    
                  block.getClass());
          }
        }
View Full Code Here

Examples of uk.org.ogsadai.activity.io.InvalidInputValueException

          aggregates.add(tuple.getDouble(0));
          aggregates.add(tuple.getDouble(1));
      }
      catch(NumberFormatException exc)
      {
        throw new InvalidInputValueException(INPUT_AGGREGATES, Double.class, exc);
      }
      if(tuples.nextValue() != null)
        throw new ActivityUserException(new AggregatesListIncorrectException());
      return aggregates;
  }
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.