All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.intermine.model.bio.SyntenyBlockShadow Maven / Gradle / Ivy

The newest version!
package org.intermine.model.bio;

import org.intermine.objectstore.ObjectStore;
import org.intermine.objectstore.intermine.NotXmlParser;
import org.intermine.objectstore.intermine.NotXmlRenderer;
import org.intermine.objectstore.proxy.ProxyCollection;
import org.intermine.model.StringConstructor;
import org.intermine.metadata.TypeUtil;
import org.intermine.util.DynamicUtil;
import org.intermine.model.ShadowClass;

public class SyntenyBlockShadow implements SyntenyBlock, ShadowClass
{
    public static final Class shadowOf = SyntenyBlock.class;
    // Col: org.intermine.model.bio.SyntenyBlock.syntenicRegions
    protected java.util.Set syntenicRegions = new java.util.HashSet();
    public java.util.Set getSyntenicRegions() { return syntenicRegions; }
    public void setSyntenicRegions(final java.util.Set syntenicRegions) { this.syntenicRegions = syntenicRegions; }
    public void addSyntenicRegions(final org.intermine.model.bio.SyntenicRegion arg) { syntenicRegions.add(arg); }

    // Col: org.intermine.model.bio.SyntenyBlock.dataSets
    protected java.util.Set dataSets = new java.util.HashSet();
    public java.util.Set getDataSets() { return dataSets; }
    public void setDataSets(final java.util.Set dataSets) { this.dataSets = dataSets; }
    public void addDataSets(final org.intermine.model.bio.DataSet arg) { dataSets.add(arg); }

    // Col: org.intermine.model.bio.SyntenyBlock.publications
    protected java.util.Set publications = new java.util.HashSet();
    public java.util.Set getPublications() { return publications; }
    public void setPublications(final java.util.Set publications) { this.publications = publications; }
    public void addPublications(final org.intermine.model.bio.Publication arg) { publications.add(arg); }

    // Attr: org.intermine.model.InterMineObject.id
    protected java.lang.Integer id;
    public java.lang.Integer getId() { return id; }
    public void setId(final java.lang.Integer id) { this.id = id; }

    @Override public boolean equals(Object o) { return (o instanceof SyntenyBlock && id != null) ? id.equals(((SyntenyBlock)o).getId()) : this == o; }
    @Override public int hashCode() { return (id != null) ? id.hashCode() : super.hashCode(); }
    @Override public String toString() { return "SyntenyBlock [id=" + id + "]"; }
    public Object getFieldValue(final String fieldName) throws IllegalAccessException {
        if ("syntenicRegions".equals(fieldName)) {
            return syntenicRegions;
        }
        if ("dataSets".equals(fieldName)) {
            return dataSets;
        }
        if ("publications".equals(fieldName)) {
            return publications;
        }
        if ("id".equals(fieldName)) {
            return id;
        }
        if (!org.intermine.model.bio.SyntenyBlock.class.equals(getClass())) {
            return TypeUtil.getFieldValue(this, fieldName);
        }
        throw new IllegalArgumentException("Unknown field " + fieldName);
    }
    public Object getFieldProxy(final String fieldName) throws IllegalAccessException {
        if ("syntenicRegions".equals(fieldName)) {
            return syntenicRegions;
        }
        if ("dataSets".equals(fieldName)) {
            return dataSets;
        }
        if ("publications".equals(fieldName)) {
            return publications;
        }
        if ("id".equals(fieldName)) {
            return id;
        }
        if (!org.intermine.model.bio.SyntenyBlock.class.equals(getClass())) {
            return TypeUtil.getFieldProxy(this, fieldName);
        }
        throw new IllegalArgumentException("Unknown field " + fieldName);
    }
    public void setFieldValue(final String fieldName, final Object value) {
        if ("syntenicRegions".equals(fieldName)) {
            syntenicRegions = (java.util.Set) value;
        } else if ("dataSets".equals(fieldName)) {
            dataSets = (java.util.Set) value;
        } else if ("publications".equals(fieldName)) {
            publications = (java.util.Set) value;
        } else if ("id".equals(fieldName)) {
            id = (java.lang.Integer) value;
        } else {
            if (!org.intermine.model.bio.SyntenyBlock.class.equals(getClass())) {
                DynamicUtil.setFieldValue(this, fieldName, value);
                return;
            }
            throw new IllegalArgumentException("Unknown field " + fieldName);
        }
    }
    public Class getFieldType(final String fieldName) {
        if ("syntenicRegions".equals(fieldName)) {
            return java.util.Set.class;
        }
        if ("dataSets".equals(fieldName)) {
            return java.util.Set.class;
        }
        if ("publications".equals(fieldName)) {
            return java.util.Set.class;
        }
        if ("id".equals(fieldName)) {
            return java.lang.Integer.class;
        }
        if (!org.intermine.model.bio.SyntenyBlock.class.equals(getClass())) {
            return TypeUtil.getFieldType(org.intermine.model.bio.SyntenyBlock.class, fieldName);
        }
        throw new IllegalArgumentException("Unknown field " + fieldName);
    }
    public StringConstructor getoBJECT() {
        if (!org.intermine.model.bio.SyntenyBlockShadow.class.equals(getClass())) {
            return NotXmlRenderer.render(this);
        }
        StringConstructor sb = new StringConstructor();
        sb.append("$_^org.intermine.model.bio.SyntenyBlock");
        if (id != null) {
            sb.append("$_^aid$_^").append(id);
        }
        return sb;
    }
    public void setoBJECT(String notXml, ObjectStore os) {
        setoBJECT(NotXmlParser.SPLITTER.split(notXml), os);
    }
    public void setoBJECT(final String[] notXml, final ObjectStore os) {
        if (!org.intermine.model.bio.SyntenyBlockShadow.class.equals(getClass())) {
            throw new IllegalStateException("Class " + getClass().getName() + " does not match code (org.intermine.model.bio.SyntenyBlock)");
        }
        for (int i = 2; i < notXml.length;) {
            int startI = i;
            if ((i < notXml.length) && "aid".equals(notXml[i])) {
                i++;
                id = Integer.valueOf(notXml[i]);
                i++;
            }
            if (startI == i) {
                throw new IllegalArgumentException("Unknown field " + notXml[i]);
            }
        }
        syntenicRegions = new ProxyCollection(os, this, "syntenicRegions", org.intermine.model.bio.SyntenicRegion.class);
        dataSets = new ProxyCollection(os, this, "dataSets", org.intermine.model.bio.DataSet.class);
        publications = new ProxyCollection(os, this, "publications", org.intermine.model.bio.Publication.class);
    }
    public void addCollectionElement(final String fieldName, final org.intermine.model.InterMineObject element) {
        if ("syntenicRegions".equals(fieldName)) {
            syntenicRegions.add((org.intermine.model.bio.SyntenicRegion) element);
        } else if ("dataSets".equals(fieldName)) {
            dataSets.add((org.intermine.model.bio.DataSet) element);
        } else if ("publications".equals(fieldName)) {
            publications.add((org.intermine.model.bio.Publication) element);
        } else {
            if (!org.intermine.model.bio.SyntenyBlock.class.equals(getClass())) {
                TypeUtil.addCollectionElement(this, fieldName, element);
                return;
            }
            throw new IllegalArgumentException("Unknown collection " + fieldName);
        }
    }
    public Class getElementType(final String fieldName) {
        if ("syntenicRegions".equals(fieldName)) {
            return org.intermine.model.bio.SyntenicRegion.class;
        }
        if ("dataSets".equals(fieldName)) {
            return org.intermine.model.bio.DataSet.class;
        }
        if ("publications".equals(fieldName)) {
            return org.intermine.model.bio.Publication.class;
        }
        if (!org.intermine.model.bio.SyntenyBlock.class.equals(getClass())) {
            return TypeUtil.getElementType(org.intermine.model.bio.SyntenyBlock.class, fieldName);
        }
        throw new IllegalArgumentException("Unknown field " + fieldName);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy