2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.fts.service.threedbeacons;
24 import java.util.Objects;
26 import jalview.fts.api.FTSData;
29 * TDB result bean - holds filtered fields for GUI and essential metadata fields
35 public class TDB_FTSData implements FTSData
39 Object[] summaryRowData;
42 * fields in the JSON object
44 public static String Uniprot_Id = "id";
46 public static String Uniprot_Start = "uniprot_start";
48 public static String Uniprot_End = "uniprot_end";
50 public static String Provider = "provider";
52 public static String Model_id = "model_identifier";
54 public static String Model_Category = "model_category";
56 public static String Model_Type = "model_type";
58 public static String Model_Title = "model_title";
60 public static String Resolution = "resolution";
62 public static String Confidence = "confidence_avg_local_score";
64 public static String Confidence_Score_Type = "confidence_type";
66 public static String Confidence_Score_Version = "confidence_version";
68 public static String Coverage = "coverage";
70 public static String Sequence_Identity = "sequence_identity";
72 public static String Created_Date = "created";
74 public static String UniProt_Accession = "uniprot_accession";
76 public static String Url = "model_url";
78 public static String Page_URL = "model_page_url";
80 public static String Ensemble_Sample_Url = "ensembl_sample_url";
83 * original response from server
85 Map<String, Object> tdb_entry;
87 public TDB_FTSData(String primaryKey,
88 Map<String, Object> tdbJsonStructure, Object[] summaryData)
90 this.primaryKey = primaryKey;
91 tdb_entry = tdbJsonStructure;
92 this.summaryRowData = summaryData;
95 public Object getField(String key)
97 return tdb_entry.get(key);
101 public Object[] getSummaryData()
103 return summaryRowData;
107 public Object getPrimaryKey()
113 * Returns a string representation of this object;
116 public String toString()
118 StringBuilder summaryFieldValues = new StringBuilder();
119 for (Object summaryField : summaryRowData)
122 .append(summaryField == null ? " " : summaryField.toString())
125 return summaryFieldValues.toString();
129 * Returns hash code value for this object
132 public int hashCode()
134 return Objects.hash(primaryKey, this.toString());
138 public boolean equals(Object that)
140 return this.toString().equals(that.toString());
143 public String getProvider()
145 return (String) getField(Provider);
148 public String getModelViewUrl()
150 return (String) getField(Page_URL);
153 public String getModelId()
155 return (String) getField(Model_id);