Updated
This commit is contained in:
@@ -19,14 +19,10 @@
|
||||
*/
|
||||
package com.omertron.themoviedbapi.methods;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.omertron.themoviedbapi.MovieDbException;
|
||||
import com.omertron.themoviedbapi.tools.HttpTools;
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.yamj.api.common.exception.ApiExceptionType;
|
||||
|
||||
/**
|
||||
* Abstract methods
|
||||
@@ -55,19 +51,4 @@ public class AbstractMethod {
|
||||
this.httpTools = httpTools;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use Jackson to convert Map to JSON string.
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
protected static String convertToJson(Map<String, ?> map) throws MovieDbException {
|
||||
try {
|
||||
return MAPPER.writeValueAsString(map);
|
||||
} catch (JsonProcessingException ex) {
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "JSON conversion failed", "", ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user