@@ -40,7 +40,7 @@ public class Protocol extends ResponseObject
40
40
private Map <String , String > _availableMetadataInputFormats ;
41
41
private String _selectedMetadataInputFormat ;
42
42
43
- private List <String > _availablePlateTemplates = new ArrayList <>() ;
43
+ private List <String > _availablePlateTemplates ;
44
44
private String _selectedPlateTemplate ;
45
45
46
46
private Map <String , String > _protocolParameters ;
@@ -90,31 +90,22 @@ public Protocol(JSONObject json)
90
90
_autoCopyTargetContainerId = (String )json .get ("autoCopyTargetContainerId" );
91
91
92
92
if (json .get ("availableDetectionMethods" ) instanceof JSONArray )
93
- {
94
- for (Object detectionMethod : (JSONArray )json .get ("availableDetectionMethods" ))
95
- _availableDetectionMethods .add ((String )detectionMethod );
96
- }
93
+ _availableDetectionMethods = new ArrayList <>((JSONArray )json .get ("availableDetectionMethods" ));
97
94
if (json .containsKey ("selectedDetectionMethod" ))
98
95
_selectedDetectionMethod = (String )json .get ("selectedDetectionMethod" );
99
- if (json .containsKey ("availableMetadataInputFormats" ))
100
- _availableMetadataInputFormats = ( HashMap <String , String > )json .get ("availableMetadataInputFormats" );
96
+ if (json .get ("availableMetadataInputFormats" ) instanceof JSONObject )
97
+ _availableMetadataInputFormats = new HashMap <>(( JSONObject )json .get ("availableMetadataInputFormats" ) );
101
98
if (json .containsKey ("selectedMetadataInputFormat" ))
102
99
_selectedMetadataInputFormat = (String )json .get ("selectedMetadataInputFormat" );
103
100
if (json .get ("availablePlateTemplates" ) instanceof JSONArray )
104
- {
105
- for (Object plateTemplate : (JSONArray )json .get ("availablePlateTemplates" ))
106
- _availablePlateTemplates .add ((String )plateTemplate );
107
- }
101
+ _availablePlateTemplates = new ArrayList <>((JSONArray )json .get ("availablePlateTemplates" ));
108
102
if (json .containsKey ("selectedPlateTemplate" ))
109
103
_selectedPlateTemplate = (String )json .get ("selectedPlateTemplate" );
110
104
111
- if (json .get ("protocolTransformScripts" ) instanceof JSONArray )
112
- {
113
- for (Object transformScript : (JSONArray )json .get ("protocolTransformScripts" ))
114
- _protocolTransformScripts .add ((String )transformScript );
115
- }
105
+ if (json .containsKey ("protocolTransformScripts" ))
106
+ _protocolTransformScripts = new ArrayList <>((JSONArray )json .get ("protocolTransformScripts" ));
116
107
if (json .containsKey ("protocolParameters" ))
117
- _protocolParameters = ( HashMap <String , String >) json .get ("protocolParameters" );
108
+ _protocolParameters = new HashMap <>(( JSONObject ) json .get ("protocolParameters" ) );
118
109
}
119
110
120
111
public JSONObject toJSONObject ()
@@ -318,6 +309,11 @@ public String getSelectedDetectionMethod()
318
309
return _selectedDetectionMethod ;
319
310
}
320
311
312
+ public Map <String , String > getAvailableMetadataInputFormats ()
313
+ {
314
+ return _availableMetadataInputFormats ;
315
+ }
316
+
321
317
public Protocol setSelectedMetadataInputFormat (String inputFormat )
322
318
{
323
319
_selectedMetadataInputFormat = inputFormat ;
0 commit comments