Skip to content

Commit b087083

Browse files
committed
Test plate set events
1 parent b0a2586 commit b087083

2 files changed

Lines changed: 59 additions & 6 deletions

File tree

src/org/labkey/remoteapi/plate/PlateParams.java

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,25 @@
22

33
import org.json.JSONObject;
44

5+
import java.util.Map;
6+
57
public class PlateParams
68
{
9+
private boolean _archived;
10+
private String _assayType;
11+
private int _columns;
12+
private String _description;
713
private String _name;
814
private String _plateId;
9-
private int _rowId;
1015
private int _plateSetId;
11-
private String _description;
12-
private int _rows;
13-
private int _columns;
1416
private int _plateType;
15-
private String _assayType;
17+
private int _rowId;
18+
private int _rows;
1619
private boolean _template;
17-
private boolean _archived;
1820

21+
private PlateParams()
22+
{
23+
}
1924

2025
public PlateParams(JSONObject json)
2126
{
@@ -47,6 +52,24 @@ public PlateParams(JSONObject json)
4752
_archived = json.getBoolean("archived");
4853
}
4954

55+
public static PlateParams fromQueryRow(Map<String, Object> row)
56+
{
57+
var params = new PlateParams();
58+
params._archived = (Boolean) row.get("Archived");
59+
params._assayType = (String) row.get("AssayType");
60+
params._columns = (Integer) row.get("PlateType/Columns");
61+
params._description = (String) row.get("Description");
62+
params._name = (String) row.get("Name");
63+
params._plateId = (String) row.get("PlateId");
64+
params._plateSetId = (Integer) row.get("PlateSet");
65+
params._plateType = (Integer) row.get("PlateType");
66+
params._rowId = (Integer) row.get("RowId");
67+
params._rows = (Integer) row.get("PlateType/Rows");
68+
params._template = (Boolean) row.get("Template");
69+
70+
return params;
71+
}
72+
5073
public String getName()
5174
{
5275
return _name;

src/org/labkey/remoteapi/plate/PlateSetParams.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import org.json.JSONObject;
44

5+
import java.util.Date;
6+
import java.util.Map;
7+
58
public class PlateSetParams
69
{
710
private boolean _archived;
@@ -22,6 +25,10 @@ public class PlateSetParams
2225
private boolean _template;
2326
private CreatePlateSetParams.PlateSetType _plateSetType;
2427

28+
private PlateSetParams()
29+
{
30+
}
31+
2532
public PlateSetParams(JSONObject json)
2633
{
2734
if (json.has("archived"))
@@ -58,6 +65,29 @@ public PlateSetParams(JSONObject json)
5865
_plateSetType = CreatePlateSetParams.PlateSetType.fromName(json.getString("type"));
5966
}
6067

68+
public static PlateSetParams fromQueryRow(Map<String, Object> row)
69+
{
70+
var params = new PlateSetParams();
71+
params._containerId = (String) row.get("Folder/EntityId");
72+
params._containerName = (String) row.get("Folder/Name");
73+
params._containerPath = (String) row.get("Folder/Path");
74+
params._created = row.get("Created").toString();
75+
params._createdBy = (Integer) row.get("CreatedBy");
76+
params._description = (String) row.get("Description");
77+
params._modified = row.get("Modified").toString();
78+
params._modifiedBy = (Integer) row.get("ModifiedBy");
79+
params._name = (String) row.get("Name");
80+
params._plateCount = (Integer) row.get("PlateCount");
81+
params._plateSetId = (String) row.get("PlateSetId");
82+
params._plateSetType = CreatePlateSetParams.PlateSetType.fromName((String) row.get("Type"));
83+
params._primaryPlateSetId = (Integer) row.get("PrimaryPlateSetId");
84+
params._rootPlateSetId = (Integer) row.get("RootPlateSetId");
85+
params._rowId = (Integer) row.get("RowId");
86+
params._template = (Boolean) row.get("Template");
87+
88+
return params;
89+
}
90+
6191
public boolean getArchived()
6292
{
6393
return _archived;

0 commit comments

Comments
 (0)