Clover icon

Coverage Report

  1. Project Clover database Wed Nov 13 2024 16:12:26 GMT
  2. Package jalview.fts.service.threedbeacons

File TDB_FTSData.java

 

Coverage histogram

../../../../img/srcFileCovDistChart7.png
29% of files have more coverage

Code metrics

2
17
12
1
168
92
13
0.76
1.42
12
1.08

Classes

Class Line # Actions
TDB_FTSData 35 17 13
0.6129032461.3%
 

Contributing tests

This file is covered by 7 tests. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
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.
11    *
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.
16    *
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.
20    */
21    package jalview.fts.service.threedbeacons;
22   
23    import java.util.Map;
24    import java.util.Objects;
25   
26    import jalview.fts.api.FTSData;
27   
28    /**
29    * TDB result bean - holds filtered fields for GUI and essential metadata fields
30    * for back end
31    *
32    * @author jprocter
33    *
34    */
 
35    public class TDB_FTSData implements FTSData
36    {
37    String primaryKey;
38   
39    Object[] summaryRowData;
40   
41    /*
42    * fields in the JSON object
43    */
44    public static String Uniprot_Id = "id";
45   
46    public static String Uniprot_Start = "uniprot_start";
47   
48    public static String Uniprot_End = "uniprot_end";
49   
50    public static String Provider = "provider";
51   
52    public static String Model_id = "model_identifier";
53   
54    public static String Model_Category = "model_category";
55   
56    public static String Model_Type = "model_type";
57   
58    public static String Model_Title = "model_title";
59   
60    public static String Resolution = "resolution";
61   
62    public static String Confidence = "confidence_avg_local_score";
63   
64    public static String Confidence_Score_Type = "confidence_type";
65   
66    public static String Confidence_Score_Version = "confidence_version";
67   
68    public static String Coverage = "coverage";
69   
70    public static String Sequence_Identity = "sequence_identity";
71   
72    public static String Created_Date = "created";
73   
74    public static String UniProt_Accession = "uniprot_accession";
75   
76    public static String Url = "model_url";
77   
78    public static String Page_URL = "model_page_url";
79   
80    public static String Ensemble_Sample_Url = "ensembl_sample_url";
81   
82    /**
83    * original response from server
84    */
85    Map<String, Object> tdb_entry;
86   
 
87  5093 toggle public TDB_FTSData(String primaryKey,
88    Map<String, Object> tdbJsonStructure, Object[] summaryData)
89    {
90  5093 this.primaryKey = primaryKey;
91  5093 tdb_entry = tdbJsonStructure;
92  5093 this.summaryRowData = summaryData;
93    }
94   
 
95  2516 toggle public Object getField(String key)
96    {
97  2516 return tdb_entry.get(key);
98    }
99   
 
100  93882 toggle @Override
101    public Object[] getSummaryData()
102    {
103  93882 return summaryRowData;
104    }
105   
 
106  0 toggle @Override
107    public Object getPrimaryKey()
108    {
109  0 return primaryKey;
110    }
111   
112    /**
113    * Returns a string representation of this object;
114    */
 
115  254 toggle @Override
116    public String toString()
117    {
118  254 StringBuilder summaryFieldValues = new StringBuilder();
119  254 for (Object summaryField : summaryRowData)
120    {
121  3308 summaryFieldValues
122  3308 .append(summaryField == null ? " " : summaryField.toString())
123    .append("\t");
124    }
125  254 return summaryFieldValues.toString();
126    }
127   
128    /**
129    * Returns hash code value for this object
130    */
 
131  191 toggle @Override
132    public int hashCode()
133    {
134  191 return Objects.hash(primaryKey, this.toString());
135    }
136   
 
137  0 toggle @Override
138    public boolean equals(Object that)
139    {
140  0 return this.toString().equals(that.toString());
141    }
142   
 
143  2516 toggle public String getProvider()
144    {
145  2516 return (String) getField(Provider);
146    }
147   
 
148  0 toggle public String getModelViewUrl()
149    {
150  0 return (String) getField(Page_URL);
151    }
152   
 
153  0 toggle public String getModelId()
154    {
155  0 return (String) getField(Model_id);
156    }
157   
 
158  0 toggle public String getConfidenceScoreType()
159    {
160  0 return (String) getField(Confidence_Score_Type);
161    }
162   
 
163  0 toggle public String getConfidenceScoreVersion()
164    {
165  0 return (String) getField(Confidence_Score_Version);
166    }
167   
168    }