org.molgenis.omx.xgap.Track Maven / Gradle / Ivy
/* File: org.molgenis.omx/model/Track.java
* Generator: org.molgenis.generators.DataTypeGen 4.0.0-testing
*
* THIS FILE HAS BEEN GENERATED, PLEASE DO NOT EDIT!
*/
package org.molgenis.omx.xgap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.molgenis.data.AttributeMetaData;
import org.molgenis.data.support.MapEntity;
import org.molgenis.data.Entity;
/**
* Track: .
* @author MOLGENIS generator
*/
@javax.persistence.Entity
@javax.persistence.Table(name = "Track"
)
@javax.xml.bind.annotation.XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value={"EI_EXPOSE_REP", "EI_EXPOSE_REP2"}, justification="Exposing internal representation is accepted")
public class Track extends org.molgenis.omx.observ.Characteristic implements org.molgenis.data.Entity
{
/** default serial version ID */
private static final long serialVersionUID = 1L;
public final static String ENTITY_NAME = "Track";
// fieldname constants
public final static String ID = "id";
// member variables (including setters.getters for interface)
public String getEntityName()
{
return ENTITY_NAME;
}
//automatically generated internal id, only for internal use.[type=int]
//constructors
public Track()
{
//set the type for a new instance
set__Type(this.getClass().getSimpleName());
}
//getters and setters
/**
* Generic getter. Get the property by using the name.
*/
@Override
public Object get(String name)
{
name = name.toLowerCase();
if (name.equals("id"))
return getId();
if (name.equals("identifier"))
return getIdentifier();
if (name.equals("name"))
return getName();
if (name.equals("__type"))
return get__Type();
if(name.equals("__type_label"))
return get__TypeLabel();
if (name.equals("description"))
return getDescription();
return null;
}
@Override
public void set(org.molgenis.data.Entity entity, boolean strict)
{
//set Id
// query formal name, else lowercase name
if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
else if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
else if(strict) this.setId(entity.getInt("id")); // setting null is not an option due to function overloading
if( entity.getInt("track_id") != null) this.setId(entity.getInt("track_id"));
else if( entity.getInt("Track_id") != null) this.setId(entity.getInt("Track_id"));
//set Identifier
// query formal name, else lowercase name
if(entity.getString("identifier") != null) this.setIdentifier(entity.getString("identifier"));
else if(entity.getString("Identifier") != null) this.setIdentifier(entity.getString("Identifier"));
else if(strict) this.setIdentifier(entity.getString("identifier")); // setting null is not an option due to function overloading
if( entity.getString("track_identifier") != null) this.setIdentifier(entity.getString("track_identifier"));
else if( entity.getString("Track_Identifier") != null) this.setIdentifier(entity.getString("Track_Identifier"));
//set Name
// query formal name, else lowercase name
if(entity.getString("name") != null) this.setName(entity.getString("name"));
else if(entity.getString("Name") != null) this.setName(entity.getString("Name"));
else if(strict) this.setName(entity.getString("name")); // setting null is not an option due to function overloading
if( entity.getString("track_name") != null) this.setName(entity.getString("track_name"));
else if( entity.getString("Track_Name") != null) this.setName(entity.getString("Track_Name"));
//set __Type
// query formal name, else lowercase name
if(entity.getString("__type") != null) this.set__Type(entity.getString("__type"));
else if(entity.getString("__Type") != null) this.set__Type(entity.getString("__Type"));
else if(strict) this.set__Type(entity.getString("__type")); // setting null is not an option due to function overloading
if( entity.getString("track___type") != null) this.set__Type(entity.getString("track___type"));
else if( entity.getString("Track___Type") != null) this.set__Type(entity.getString("Track___Type"));
//set Description
// query formal name, else lowercase name
if(entity.getString("description") != null) this.setDescription(entity.getString("description"));
else if(entity.getString("description") != null) this.setDescription(entity.getString("description"));
else if(strict) this.setDescription(entity.getString("description")); // setting null is not an option due to function overloading
if( entity.getString("track_description") != null) this.setDescription(entity.getString("track_description"));
else if( entity.getString("Track_description") != null) this.setDescription(entity.getString("Track_description"));
}
@Override
public String toString()
{
return this.toString(false);
}
public String toString(boolean verbose)
{
StringBuilder sb = new StringBuilder("Track(");
sb.append("id='" + getId()+"' ");
sb.append("identifier='" + getIdentifier()+"' ");
sb.append("name='" + getName()+"' ");
sb.append("__Type='" + get__Type()+"' ");
sb.append("description='" + getDescription()+"'");
sb.append(");");
return sb.toString();
}
@Override
public Integer getIdValue()
{
return getId();
}
@Override
public Iterable getAttributeNames()
{
Set attributeNames = new LinkedHashSet();
for (AttributeMetaData attr : new TrackMetaData().getAttributes())
{
attributeNames.add(attr.getName());
}
return attributeNames;
}
@Override
public java.util.List getLabelAttributeNames()
{
java.util.List result = new java.util.ArrayList();
result.add("Identifier");
return result;
}
@Override
public void set(String attributeName, Object value)
{
if("id".equalsIgnoreCase(attributeName)) {
this.setId((Integer)value);
return;
}
if("Identifier".equalsIgnoreCase(attributeName)) {
this.setIdentifier((String)value);
return;
}
if("Name".equalsIgnoreCase(attributeName)) {
this.setName((String)value);
return;
}
if("__Type".equalsIgnoreCase(attributeName)) {
this.set__Type((String)value);
return;
}
if("description".equalsIgnoreCase(attributeName)) {
this.setDescription((String)value);
return;
}
}
@Override
public boolean equals(Object obj)
{
if (this == obj) return true;
if (obj == null) return false;
if (!super.equals(obj)) return false;
if (getClass() != obj.getClass()) return false;
return true;
}
@Override
public int hashCode()
{
int result = super.hashCode();
return result;
}
@Override
public org.molgenis.data.EntityMetaData getEntityMetaData()
{
return new TrackMetaData();
}
}