Java tutorial
package org.usd.edu.btl.betsconverter.BETSV1; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.apache.commons.lang3.builder.ToStringBuilder; /** * * @author Tyler.Jones */ @JsonInclude(JsonInclude.Include.NON_NULL) @Generated("org.jsonschema2pojo") @JsonPropertyOrder({ "name", "display_name", "version", "summary", "description", "limitations", "example", "links", "references", "author", "created_at", "owner", "maintained", "availability", "contact", "category", "technology", "programming_language", "license", "operating_system", "software_features", "software_libraries", "inputs", "parameters", "outputs", "requirements", "quality", "learn_flow", "release_date", "algorithm", "iplant_specific", "seq_specific", "galaxy_specific", "bld_specific", "parallelism" }) public class BETSV1 { @JsonProperty("name") private String name; @JsonProperty("display_name") private String display_name; @JsonProperty("version") private String version; @JsonProperty("summary") private String summary; @JsonProperty("description") private String description; @JsonProperty("limitations") private String limitations; @JsonProperty("example") private List<Example> example = new ArrayList<Example>(); @JsonProperty("links") private List<Link> links = new ArrayList<Link>(); @JsonProperty("references") private List<Reference> references = new ArrayList<Reference>(); @JsonProperty("author") private String author; @JsonProperty("created_at") private String created_at; @JsonProperty("owner") private String owner; @JsonProperty("maintained") private String maintained; @JsonProperty("availability") private List<Availability> availability = new ArrayList<Availability>(); @JsonProperty("contact") private Contact contact; @JsonProperty("category") private Category category; @JsonProperty("technology") private List<Technology> technology = new ArrayList<Technology>(); @JsonProperty("programming_language") private List<Programming_language> programming_language = new ArrayList<Programming_language>(); @JsonProperty("license") private List<License> license = new ArrayList<License>(); @JsonProperty("operating_system") private List<Operating_system> operating_system = new ArrayList<Operating_system>(); @JsonProperty("software_features") private String software_features; @JsonProperty("software_libraries") private String software_libraries; @JsonProperty("inputs") private List<Input> inputs = new ArrayList<Input>(); @JsonProperty("parameters") private List<Parameter> parameters = new ArrayList<Parameter>(); @JsonProperty("outputs") private List<Output> outputs = new ArrayList<Output>(); @JsonProperty("requirements") private String requirements; @JsonProperty("quality") private List<Quality_> quality = new ArrayList<Quality_>(); @JsonProperty("learn_flow") private List<Learn_flow> learn_flow = new ArrayList<Learn_flow>(); @JsonProperty("release_date") private String release_date; @JsonProperty("algorithm") private List<Algorithm> algorithm = new ArrayList<Algorithm>(); @JsonProperty("validation_date") private String validation_date; @JsonProperty("nature_of_tool") private List<String> nature_of_tool = new ArrayList<String>(); @JsonProperty("tool_type") private List<String> tool_type = new ArrayList<String>(); @JsonProperty("interfaces") private List<String> interfaces = new ArrayList<String>(); @JsonProperty("iplant_specific") private Iplant_specific iplant_specific; @JsonProperty("seq_specific") private Seq_specific seq_specific; @JsonProperty("galaxy_specific") private Galaxy_specific galaxy_specific; @JsonProperty("bld_specific") private Bld_specific bld_specific; @JsonProperty("omic_specific") private OMIC_specific omic_specific; @JsonProperty("parallelism") private String parallelism; private Map<String, Object> additionalProperties = new HashMap<String, Object>(); /** * * @return */ @JsonProperty("name") public String getName() { return name; } /** * * @param name */ @JsonProperty("name") public void setName(String name) { this.name = name; } /** * * @return */ @JsonProperty("display_name") public String getDisplay_name() { return display_name; } /** * * @param display_name */ @JsonProperty("display_name") public void setDisplay_name(String display_name) { this.display_name = display_name; } /** * * @return */ @JsonProperty("version") public String getVersion() { return version; } /** * * @param version */ @JsonProperty("version") public void setVersion(String version) { this.version = version; } /** * * @return */ @JsonProperty("summary") public String getSummary() { return summary; } /** * * @param summary */ @JsonProperty("summary") public void setSummary(String summary) { this.summary = summary; } /** * * @return */ @JsonProperty("description") public String getDescription() { return description; } /** * * @param description */ @JsonProperty("description") public void setDescription(String description) { this.description = description; } /** * * @return */ @JsonProperty("limitations") public String getLimitations() { return limitations; } /** * * @param limitations */ @JsonProperty("limitations") public void setLimitations(String limitations) { this.limitations = limitations; } /** * * @return */ @JsonProperty("example") public List<Example> getExample() { return example; } /** * * @param example */ @JsonProperty("example") public void setExample(List<Example> example) { this.example = example; } /** * * @return */ @JsonProperty("links") public List<Link> getLinks() { return links; } /** * * @param links */ @JsonProperty("links") public void setLinks(List<Link> links) { this.links = links; } /** * * @return */ @JsonProperty("references") public List<Reference> getReferences() { return references; } /** * * @param references */ @JsonProperty("references") public void setReferences(List<Reference> references) { this.references = references; } /** * * @return */ @JsonProperty("author") public String getAuthor() { return author; } /** * * @param author */ @JsonProperty("author") public void setAuthor(String author) { this.author = author; } /** * * @return */ @JsonProperty("created_at") public String getCreated_at() { return created_at; } /** * * @param created_at */ @JsonProperty("created_at") public void setCreated_at(String created_at) { this.created_at = created_at; } /** * * @return */ @JsonProperty("owner") public String getOwner() { return owner; } /** * * @param owner */ @JsonProperty("owner") public void setOwner(String owner) { this.owner = owner; } /** * * @return */ @JsonProperty("maintained") public String getMaintained() { return maintained; } /** * * @param maintained */ @JsonProperty("maintained") public void setMaintained(String maintained) { this.maintained = maintained; } /** * * @return */ @JsonProperty("availability") public List<Availability> getAvailability() { return availability; } /** * * @param availability */ @JsonProperty("availability") public void setAvailability(List<Availability> availability) { this.availability = availability; } /** * * @return */ @JsonProperty("contact") public Contact getContact() { return contact; } /** * * @param contact */ @JsonProperty("contact") public void setContact(Contact contact) { this.contact = contact; } /** * * @return */ @JsonProperty("category") public Category getCategory() { return category; } /** * * @param category */ @JsonProperty("category") public void setCategory(Category category) { this.category = category; } /** * * @return */ @JsonProperty("technology") public List<Technology> getTechnology() { return technology; } /** * * @param technology */ @JsonProperty("technology") public void setTechnology(List<Technology> technology) { this.technology = technology; } /** * * @return */ @JsonProperty("programming_language") public List<Programming_language> getProgramming_language() { return programming_language; } /** * * @param programming_language */ @JsonProperty("programming_language") public void setProgramming_language(List<Programming_language> programming_language) { this.programming_language = programming_language; } /** * * @return */ @JsonProperty("license") public List<License> getLicense() { return license; } /** * * @param license */ @JsonProperty("license") public void setLicense(List<License> license) { this.license = license; } /** * * @return */ @JsonProperty("operating_system") public List<Operating_system> getOperating_system() { return operating_system; } /** * * @param operating_system */ @JsonProperty("operating_system") public void setOperating_system(List<Operating_system> operating_system) { this.operating_system = operating_system; } /** * * @return */ @JsonProperty("software_features") public String getSoftware_features() { return software_features; } /** * * @param software_features */ @JsonProperty("software_features") public void setSoftware_features(String software_features) { this.software_features = software_features; } /** * * @return */ @JsonProperty("software_libraries") public String getSoftware_libraries() { return software_libraries; } /** * * @param software_libraries */ @JsonProperty("software_libraries") public void setSoftware_libraries(String software_libraries) { this.software_libraries = software_libraries; } /** * * @return */ @JsonProperty("inputs") public List<Input> getInputs() { return inputs; } /** * * @param inputs */ @JsonProperty("inputs") public void setInputs(List<Input> inputs) { this.inputs = inputs; } /** * * @return */ @JsonProperty("parameters") public List<Parameter> getParameters() { return parameters; } /** * * @param parameters */ @JsonProperty("parameters") public void setParameters(List<Parameter> parameters) { this.parameters = parameters; } /** * * @return */ @JsonProperty("outputs") public List<Output> getOutputs() { return outputs; } /** * * @param outputs */ @JsonProperty("outputs") public void setOutputs(List<Output> outputs) { this.outputs = outputs; } /** * * @return */ @JsonProperty("requirements") public String getRequirements() { return requirements; } /** * * @param requirements */ @JsonProperty("requirements") public void setRequirements(String requirements) { this.requirements = requirements; } /** * * @return */ @JsonProperty("quality") public List<Quality_> getQuality() { return quality; } /** * * @param quality */ @JsonProperty("quality") public void setQuality(List<Quality_> quality) { this.quality = quality; } /** * * @return */ @JsonProperty("learn_flow") public List<Learn_flow> getLearn_flow() { return learn_flow; } /** * * @param learn_flow */ @JsonProperty("learn_flow") public void setLearn_flow(List<Learn_flow> learn_flow) { this.learn_flow = learn_flow; } /** * * @return */ @JsonProperty("release_date") public String getRelease_date() { return release_date; } /** * * @param release_date */ @JsonProperty("release_date") public void setRelease_date(String release_date) { this.release_date = release_date; } /** * * @return */ @JsonProperty("algorithm") public List<Algorithm> getAlgorithm() { return algorithm; } /** * * @param algorithm */ @JsonProperty("algorithm") public void setAlgorithm(List<Algorithm> algorithm) { this.algorithm = algorithm; } /** * * @return */ @JsonProperty("validation_date") public String getValidation_date() { return validation_date; } /** * * @param validation_date */ @JsonProperty("validation_date") public void setValidation_date(String validation_date) { this.validation_date = validation_date; } /** * * @return */ @JsonProperty("nature_of_tool") public List<String> getNature_of_tool() { return nature_of_tool; } /** * * @param nature_of_tool */ @JsonProperty("nature_of_tool") public void setNature_of_tool(List<String> nature_of_tool) { this.nature_of_tool = nature_of_tool; } /** * * @return */ @JsonProperty("tool_type") public List<String> getTool_type() { return tool_type; } /** * * @param tool_type */ @JsonProperty("tool_type") public void setTool_type(List<String> tool_type) { this.tool_type = tool_type; } /** * * @return */ @JsonProperty("interfaces") public List<String> getInterfaces() { return interfaces; } /** * * @param interfaces */ @JsonProperty("interfaces") public void setInterfaces(List<String> interfaces) { this.interfaces = interfaces; } /** * * @return */ @JsonProperty("iplant_specific") public Iplant_specific getIplant_specific() { return iplant_specific; } /** * * @param iplant_specific */ @JsonProperty("iplant_specific") public void setIplant_specific(Iplant_specific iplant_specific) { this.iplant_specific = iplant_specific; } /** * * @return */ @JsonProperty("seq_specific") public Seq_specific getSeq_specific() { return seq_specific; } /** * * @param seq_specific */ @JsonProperty("seq_specific") public void setSeq_specific(Seq_specific seq_specific) { this.seq_specific = seq_specific; } /** * * @return */ @JsonProperty("omic_specific") public OMIC_specific getOmic_specific() { return omic_specific; } /** * * @param omic_specific */ @JsonProperty("omic_specific") public void setOmic_specific(OMIC_specific omic_specific) { this.omic_specific = omic_specific; } /** * * @return */ @JsonProperty("galaxy_specific") public Galaxy_specific getGalaxy_specific() { return galaxy_specific; } /** * * @param galaxy_specific */ @JsonProperty("galaxy_specific") public void setGalaxy_specific(Galaxy_specific galaxy_specific) { this.galaxy_specific = galaxy_specific; } /** * * @return */ @JsonProperty("bld_specific") public Bld_specific getBld_specific() { return bld_specific; } /** * * @param bld_specific */ @JsonProperty("bld_specific") public void setBld_specific(Bld_specific bld_specific) { this.bld_specific = bld_specific; } /** * * @return */ @JsonProperty("parallelism") public String getParallelism() { return parallelism; } /** * * @param parallelism */ @JsonProperty("parallelism") public void setParallelism(String parallelism) { this.parallelism = parallelism; } /** * * @return */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("***BETS JSON FILE***\n"); sb.append("Name= " + getName() + "\n"); sb.append("Display Name= " + getDisplay_name() + "\n"); return sb.toString(); } /** * Combines this BETSV1 object with the param BETSV1 object. Only fills * empty fields and concatenates the lists. If both objects have a * particular field, keeps the original. If the field is a list and both * objects have that field, concatenates the lists. * * @param other * @return */ public BETSV1 combine(BETSV1 other) { if (other == null) { return this; } if (this.name == null || this.name.isEmpty()) { this.setName(other.getName()); } if (this.display_name == null || this.display_name.isEmpty()) { this.setDisplay_name(other.getDisplay_name()); } if (this.version == null || this.version.isEmpty()) { this.setVersion(other.getVersion()); } if (this.summary == null || this.summary.isEmpty()) { this.setSummary(other.getSummary()); } if (this.description == null || this.description.isEmpty()) { this.setDescription(other.getDescription()); } if (this.limitations == null || this.limitations.isEmpty()) { this.setLimitations(other.getLimitations()); } if (other.getExample() != null && other.getExample().size() > 0) { if (this.example == null) { this.example = new ArrayList<>(); } this.example.removeAll(other.getExample()); this.example.addAll(other.getExample()); } if (other.getLinks() != null && other.getLinks().size() > 0) { if (this.links == null) { this.links = new ArrayList<>(); } this.links.removeAll(other.getLinks()); this.links.addAll(other.getLinks()); } if (other.getReferences() != null && other.getReferences().size() > 0) { if (this.references == null) { this.references = new ArrayList<>(); } this.references.removeAll(other.getReferences()); this.references.addAll(other.getReferences()); } if (this.author == null || this.author.isEmpty()) { this.setAuthor(other.getAuthor()); } if (this.created_at == null || this.created_at.isEmpty()) { this.setCreated_at(other.getCreated_at()); } if (this.owner == null || this.owner.isEmpty()) { this.setOwner(other.getOwner()); } if (this.maintained == null || this.maintained.isEmpty()) { this.setMaintained(other.getMaintained()); } if (other.getAvailability() != null && other.getAvailability().size() > 0) { if (this.availability == null) { this.availability = new ArrayList<>(); } this.availability.removeAll(other.getAvailability()); this.availability.addAll(other.getAvailability()); } if (this.contact == null && other.getContact() != null) { this.contact = other.getContact(); } else if (this.contact != null && other.getContact() != null) { if (this.contact.getName() == null || this.contact.getName().isEmpty()) { this.contact.setName(other.getContact().getName()); } if (this.contact.getPhone() == null || this.contact.getPhone().isEmpty()) { this.contact.setPhone(other.getContact().getPhone()); } if (this.contact.getEmail() == null || this.contact.getEmail().isEmpty()) { this.contact.setEmail(other.getContact().getPhone()); } if (this.contact.getAddress() == null || this.contact.getAddress().isEmpty()) { this.contact.setAddress(other.getContact().getAddress()); } if (this.contact.getInstitution() == null || this.contact.getInstitution().isEmpty()) { this.contact.setInstitution(other.getContact().getInstitution()); } } if (this.category == null && other.getCategory() != null) { this.category = other.getCategory(); } else if (this.category != null && other.getCategory() != null) { if (this.category.getId() == null || this.category.getId().isEmpty()) { this.category.setId(other.getCategory().getId()); } if (this.category.getName() == null || this.category.getName().isEmpty()) { this.category.setName(other.getCategory().getName()); } if (this.category.getPath() == null || this.category.getPath().isEmpty()) { this.category.setPath(other.getCategory().getPath()); } if (other.category.getApplication() != null || other.category.getApplication().size() > 0) { List<Application> temp = new ArrayList<>(); if (this.category.getApplication() == null) { temp = other.category.getApplication(); } else { temp = new ArrayList<>(); temp.addAll(this.category.getApplication()); temp.removeAll(other.category.getApplication()); temp.addAll(other.category.getApplication()); } this.category.setApplication(temp); } if (other.category.getDomain() != null || other.category.getDomain().size() > 0) { List<Domain> temp = new ArrayList<>(); if (this.category.getDomain() == null) { temp = other.category.getDomain(); } else { temp = new ArrayList<>(); temp.addAll(this.category.getDomain()); temp.removeAll(other.category.getDomain()); temp.addAll(other.category.getDomain()); } this.category.setDomain(temp); } if (other.category.getMethod() != null || other.category.getMethod().size() > 0) { List<Method> temp = new ArrayList<>(); if (this.category.getMethod() == null) { temp = other.category.getMethod(); } else { temp = new ArrayList<>(); temp.addAll(this.category.getMethod()); temp.removeAll(other.category.getMethod()); temp.addAll(other.category.getMethod()); } this.category.setMethod(temp); } if (other.category.getTags() != null || other.category.getTags().size() > 0) { List<String> temp = new ArrayList<>(); if (this.category.getTags() == null) { temp = other.category.getTags(); } else { temp = new ArrayList<>(); temp.addAll(this.category.getTags()); temp.removeAll(other.category.getTags()); temp.addAll(other.category.getTags()); } this.category.setTags(temp); } if (other.category.getFormat() != null && this.category.getFormat() == null) { this.category.setFormat(other.category.getFormat()); } if (other.category.getNgs_provider() != null && this.category.getNgs_provider() == null) { this.category.setNgs_provider(other.category.getNgs_provider()); } if (other.category.getSequence_platform() != null && this.category.getSequence_platform() == null) { this.category.setSequence_platform(other.category.getSequence_platform()); } if (other.category.getReference() != null && this.category.getReference() == null) { this.category.setReference(other.category.getReference()); } } if (other.getTechnology() != null && other.getTechnology().size() > 0) { if (this.technology == null) { this.technology = new ArrayList<>(); } this.technology.removeAll(other.getTechnology()); this.technology.addAll(other.getTechnology()); } if (other.getProgramming_language() != null && other.getTechnology().size() > 0) { if (this.programming_language == null) { this.programming_language = new ArrayList<>(); } this.programming_language.removeAll(other.getProgramming_language()); this.programming_language.addAll(other.getProgramming_language()); } if (other.getLicense() != null && other.getLicense().size() > 0) { if (this.license == null) { this.license = new ArrayList<>(); } this.license.removeAll(other.getLicense()); this.license.addAll(other.getLicense()); } if (other.getOperating_system() != null && other.getOperating_system().size() > 0) { if (this.operating_system == null) { this.operating_system = new ArrayList<>(); } this.operating_system.removeAll(other.getOperating_system()); this.operating_system.addAll(other.getOperating_system()); } if (this.software_features == null || this.software_features.isEmpty()) { this.setSoftware_features(other.getSoftware_features()); } if (this.software_libraries == null || this.software_libraries.isEmpty()) { this.setSoftware_libraries(other.getSoftware_libraries()); } if (other.getInputs() != null && other.getInputs().size() > 0) { if (this.inputs == null) { this.inputs = new ArrayList<>(); } this.inputs.removeAll(other.getInputs()); this.inputs.addAll(other.getInputs()); } if (other.getParameters() != null && other.getParameters().size() > 0) { if (this.parameters == null) { this.parameters = new ArrayList<>(); } this.parameters.removeAll(other.getParameters()); this.parameters.addAll(other.getParameters()); } if (other.getOutputs() != null && other.getOutputs().size() > 0) { if (this.outputs == null) { this.outputs = new ArrayList<>(); } this.outputs.removeAll(other.getOutputs()); this.outputs.addAll(other.getOutputs()); } if (this.requirements == null || this.requirements.isEmpty()) { this.setRequirements(other.getRequirements()); } if (other.getQuality() != null && other.getQuality().size() > 0) { if (this.quality == null) { this.quality = new ArrayList<>(); } this.quality.removeAll(other.getQuality()); this.quality.addAll(other.getQuality()); } if (other.getLearn_flow() != null && other.getLearn_flow().size() > 0) { if (this.learn_flow == null) { this.learn_flow = new ArrayList<>(); } this.learn_flow.removeAll(other.getLearn_flow()); this.learn_flow.addAll(other.getLearn_flow()); } if (this.release_date == null || this.release_date.isEmpty()) { this.setRelease_date(other.getRelease_date()); } if (other.getAlgorithm() != null && other.getAlgorithm().size() > 0) { if (this.algorithm == null) { this.algorithm = new ArrayList<>(); } this.algorithm.removeAll(other.getAlgorithm()); this.algorithm.addAll(other.getAlgorithm()); } if (this.validation_date == null || this.validation_date.isEmpty()) { this.setValidation_date(other.getValidation_date()); } if (other.getNature_of_tool() != null && other.getNature_of_tool().size() > 0) { if (this.nature_of_tool == null) { this.nature_of_tool = new ArrayList<>(); } this.nature_of_tool.removeAll(other.getNature_of_tool()); this.nature_of_tool.addAll(other.getNature_of_tool()); } if (other.getTool_type() != null && other.getTool_type().size() > 0) { if (this.tool_type == null) { this.tool_type = new ArrayList<>(); } this.tool_type.removeAll(other.getTool_type()); this.tool_type.addAll(other.getTool_type()); } if (other.getInterfaces() != null && other.getInterfaces().size() > 0) { if (this.interfaces == null) { this.interfaces = new ArrayList<>(); } this.interfaces.removeAll(other.getInterfaces()); this.interfaces.addAll(other.getInterfaces()); } if (this.parallelism == null || this.parallelism.isEmpty()) { this.setParallelism(other.getParallelism()); } if (other.getIplant_specific() != null) { this.setIplant_specific(other.getIplant_specific()); } if (other.getSeq_specific() != null) { this.setSeq_specific(other.getSeq_specific()); } if (other.getGalaxy_specific() != null) { this.setGalaxy_specific(other.getGalaxy_specific()); } if (other.getBld_specific() != null) { this.setBld_specific(other.getBld_specific()); } if (other.getOmic_specific() != null) { this.setOmic_specific(other.getOmic_specific()); } return this; } /** * * @return */ @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } /** * * @param name * @param value */ @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }