Class MapToStringTransformer
java.lang.Object
org.biojava.nbio.ws.alignment.qblast.MapToStringTransformer
Transforms Map to String. Used by NCBIQBlastService to join
given map of arguments to a single String to pass to QBlast service
- Author:
- Gediminas Rimsa
-
Constructor Summary
ConstructorDescriptionCreatesMapToStringTransformer
with defaults:MapToStringTransformer
(String mappingSequence, String separatorSequence, String nullValue) CreatesMapToStringTransformer
with given values -
Method Summary
Modifier and TypeMethodDescriptionvoid
setMappingSequence
(String mappingSequence) void
setNullValue
(String nullValue) void
setSeparatorSequence
(String separatorSequence) TransformsMap
toString
, representing every entry askey
mappingSequence
value
, joined byseparatorSequence
-
Constructor Details
-
MapToStringTransformer
public MapToStringTransformer()CreatesMapToStringTransformer
with defaults:mappingSequence = "="; separatorSequence = "&"; nullValue = "null";
-
MapToStringTransformer
CreatesMapToStringTransformer
with given values- Parameters:
mappingSequence
- sequence inserted betweenkey
andvalue
separatorSequence
- sequence inserted between every pair ofMap
entriesnullValue
- sequence inserted for everynull
key or value
-
-
Method Details
-
transform
TransformsMap
toString
, representing every entry askey
mappingSequence
value
, joined byseparatorSequence
Calls
toString()
for keys and values, replacingnull
with the value ofnullValue
propertyFor example, if we have a map with two entries:
("key1", "1")
and("key2", "2")
this method would return"key1=1&key2=2"
ifmappingSequence
is "=" and separator sequence is "&";- Parameters:
map
- map of arguments- Returns:
- String resulting string
-
getMappingSequence
-
setMappingSequence
-
getSeparatorSequence
-
setSeparatorSequence
-
getNullValue
-
setNullValue
-