JAL-1667 updated the collection type for searchSummaryFields and structureSummaryFiel...
[jalview.git] / src / jalview / ws / uimodel / PDBRestRequest.java
index 168811f..58d7aeb 100644 (file)
@@ -24,8 +24,7 @@ package jalview.ws.uimodel;
 
 import jalview.ws.dbsources.PDBRestClient.PDBDocField;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Collection;
 
 /**
  * Represents the PDB request to be consumed by the PDBRestClient
@@ -49,7 +48,8 @@ public class PDBRestRequest
 
   private boolean isSortAscending;
 
-  private List<PDBDocField> wantedFields = new ArrayList<PDBDocField>();
+  private Collection<PDBDocField> wantedFields;// = new
+                                               // Collection<PDBDocField>();
 
   public String getFieldToSearchBy()
   {
@@ -91,12 +91,12 @@ public class PDBRestRequest
     this.responseSize = responseSize;
   }
 
-  public List<PDBDocField> getWantedFields()
+  public Collection<PDBDocField> getWantedFields()
   {
     return wantedFields;
   }
 
-  public void setWantedFields(List<PDBDocField> wantedFields)
+  public void setWantedFields(Collection<PDBDocField> wantedFields)
   {
     this.wantedFields = wantedFields;
   }
@@ -127,4 +127,16 @@ public class PDBRestRequest
     this.associatedSequence = associatedSequence;
   }
 
+  public String getQuery()
+  {
+    return fieldToSearchBy + searchTerm
+            + (isAllowEmptySeq() ? "" : " AND molecule_sequence:['' TO *]");
+  }
+
+  public String toString()
+  {
+    return "Query : " + getQuery() + " sort field: " + fieldToSortBy
+            + " isAsc: " + isAscending() + " Associated Seq : "
+            + associatedSequence;
+  }
 }