package se.cambio.cds.gdl.model; import java.io.Serializable; /** * Object model of a CDSS guide * * @author rong.chen * */ public class Guide implements Serializable { private String gdlVersion; private String id; private String concept; private Language language; private ResourceDescription description; private GuideDefinition definition; private GuideOntology ontology; private static final long serialVersionUID = 1L; public Guide() { } /** * @return the gdlVersion */ public String getGdlVersion() { return gdlVersion; } /** * @return the id */ public String getId() { return id; } /** * @return the concept */ public String getConcept() { return concept; } /** * @return the language */ public Language getLanguage() { if (language == null) { language = new Language(); } return language; } /** * @return the description */ public ResourceDescription getDescription() { if (description == null) { description = new ResourceDescription(); } return description; } /** * @return the definition */ public GuideDefinition getDefinition() { if (definition == null) { definition = new GuideDefinition(); } return definition; } /** * @param gdlVersion * the gdlVersion to set */ public void setGdlVersion(String gdlVersion) { this.gdlVersion = gdlVersion; } /** * @param id * the id to set */ public void setId(String id) { this.id = id; } /** * @param concept * the concept to set */ public void setConcept(String concept) { this.concept = concept; } /** * @param language * the language to set */ public void setLanguage(Language language) { this.language = language; } /** * @param description * the description to set */ public void setDescription(ResourceDescription description) { this.description = description; } /** * @param definition * the definition to set */ public void setDefinition(GuideDefinition definition) { this.definition = definition; } /** * @return the ontology */ public GuideOntology getOntology() { if (ontology == null) { ontology = new GuideOntology(); } return ontology; } /** * @param ontology * the ontology to set */ public void setOntology(GuideOntology ontology) { this.ontology = ontology; } /* * (non-Javadoc) * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((concept == null) ? 0 : concept.hashCode()); result = prime * result + ((definition == null) ? 0 : definition.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((gdlVersion == null) ? 0 : gdlVersion.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((language == null) ? 0 : language.hashCode()); result = prime * result + ((ontology == null) ? 0 : ontology.hashCode()); return result; } /* * (non-Javadoc) * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Guide other = (Guide) obj; if (concept == null) { if (other.concept != null) return false; } else if (!concept.equals(other.concept)) return false; if (definition == null) { if (other.definition != null) return false; } else if (!definition.equals(other.definition)) return false; if (description == null) { if (other.description != null) return false; } else if (!description.equals(other.description)) return false; if (gdlVersion == null) { if (other.gdlVersion != null) return false; } else if (!gdlVersion.equals(other.gdlVersion)) return false; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (language == null) { if (other.language != null) return false; } else if (!language.equals(other.language)) return false; if (ontology == null) { if (other.ontology != null) return false; } else if (!ontology.equals(other.ontology)) return false; return true; } } /* * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 2.0/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 2.0 (the 'License'); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an 'AS IS' basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * * The Initial Developers of the Original Code are Iago Corbal and Rong Chen. * Portions created by the Initial Developer are Copyright (C) 2012-2013 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Software distributed under the License is distributed on an 'AS IS' basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * ***** END LICENSE BLOCK ***** */