org.opencb.biodata.models.clinical.qc.GenomePlotConfig Maven / Gradle / Ivy
The newest version!
/*
*
*
*/
package org.opencb.biodata.models.clinical.qc;
import org.apache.commons.collections4.CollectionUtils;
import org.opencb.biodata.models.constants.FieldConstants;
import org.opencb.commons.annotations.DataField;
import java.util.List;
import java.util.Map;
public class GenomePlotConfig {
@DataField(id = "title", indexed = true,
description = FieldConstants.GENOME_PLOT_CONFIG_TITLE_DESCRIPTION)
private String title;
@DataField(id = "density", indexed = true,
description = FieldConstants.GENOME_PLOT_CONFIG_DENSITY_DESCRIPTION)
private String density;
@DataField(id = "generalQuery", indexed = true,
description = FieldConstants.GENOME_PLOT_CONFIG_GENERAL_QUERY_DESCRIPTION)
private Map generalQuery;
@DataField(id = "tracks", indexed = true,
description = FieldConstants.GENOME_PLOT_CONFIG_TRACKS_DESCRIPTION)
private List tracks;
public GenomePlotConfig() {
}
public GenomePlotConfig(String title, String density, Map generalQuery, List tracks) {
this.title = title;
this.density = density;
this.generalQuery = generalQuery;
this.tracks = tracks;
}
public GenomePlotTrack getTrack(String type) {
if (CollectionUtils.isNotEmpty(tracks)) {
for (GenomePlotTrack track : tracks) {
if (type.equals(track.getType())) {
return track;
}
}
}
return null;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("GenomePlotConfig{");
sb.append("title='").append(title).append('\'');
sb.append(", density='").append(density).append('\'');
sb.append(", generalQuery=").append(generalQuery);
sb.append(", tracks=").append(tracks);
sb.append('}');
return sb.toString();
}
public String getTitle() {
return title;
}
public GenomePlotConfig setTitle(String title) {
this.title = title;
return this;
}
public String getDensity() {
return density;
}
public GenomePlotConfig setDensity(String density) {
this.density = density;
return this;
}
public Map getGeneralQuery() {
return generalQuery;
}
public GenomePlotConfig setGeneralQuery(Map generalQuery) {
this.generalQuery = generalQuery;
return this;
}
public List getTracks() {
return tracks;
}
public GenomePlotConfig setTracks(List tracks) {
this.tracks = tracks;
return this;
}
}