/*This code was generated using the UMPLE modeling language! Date of generation: 2008/07/30 11:21:38*/ /*This class drives: */ package insurance.core; import insurance.*; import insurance.json.*; public class Vehicle extends InsuredProperty { //Class datatypes private String identificationNumber; private String manufacturer; private String model; //Class association variables //Registry of our system. InsuranceRegistry registry = InsuranceRegistry.getInstance(); //Constructor public Vehicle(String aYearBuilt, PropertyInsurancePolicy aPropertyInsurancePolicy, String aIdentificationNumber, String aManufacturer, String aModel) { super(aYearBuilt, aPropertyInsurancePolicy); identificationNumber = aIdentificationNumber; manufacturer = aManufacturer; model = aModel; } public boolean setIdentificationNumber(String aIdentificationNumber) { identificationNumber = aIdentificationNumber; return true; } public boolean setManufacturer(String aManufacturer) { manufacturer = aManufacturer; return true; } public boolean setModel(String aModel) { model = aModel; return true; } public String getIdentificationNumber() { return identificationNumber; } public String getManufacturer() { return manufacturer; } public String getModel() { return model; } public void delete() { } public boolean areManyEndsNull() { return true; } /*********************************** * Returns the attribute list along with the * class ID in JSON format. ***********************************/ public JSONObject getAttributes() throws JSONException { JSONObject obj = new JSONObject(); obj.put("CLASS_ID", registry.getKey(this)); obj.put("identificationNumber", getIdentificationNumber()); obj.put("manufacturer", getManufacturer()); obj.put("model", getModel()); return obj; } }