Class ParseActionResponseFromJsonMap
- java.lang.Object
-
- org.openstack4j.core.transport.functions.ParseActionResponseFromJsonMap
-
- All Implemented Interfaces:
com.google.common.base.Function<Map<String,Object>,ActionResponse>,Function<Map<String,Object>,ActionResponse>
public class ParseActionResponseFromJsonMap extends Object implements com.google.common.base.Function<Map<String,Object>,ActionResponse>
Attempts to Parse a JSON Map created from an error response and map the message to an ActionResponse.- Author:
- Jeremy Unruh
-
-
Constructor Summary
Constructors Constructor Description ParseActionResponseFromJsonMap(HttpResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActionResponseapply(Map<String,Object> map)Parses the JSON Map for an Error message.
-
-
-
Constructor Detail
-
ParseActionResponseFromJsonMap
public ParseActionResponseFromJsonMap(HttpResponse response)
-
-
Method Detail
-
apply
public ActionResponse apply(Map<String,Object> map)
Parses the JSON Map for an Error message. An OpenStack error response typically is a Map of Map containing a single key which is "error", "badRequest", etc which contains a value of another Map containing the underlying message- Specified by:
applyin interfacecom.google.common.base.Function<Map<String,Object>,ActionResponse>- Specified by:
applyin interfaceFunction<Map<String,Object>,ActionResponse>- Parameters:
map- the JSON Map- Returns:
- ActionResponse or null if the map could not be parsed
-
-