public String serialize(Object obj,String contentType) throws ApiException {
  if (contentType.startsWith("application/json")) {
    return json.serialize(obj);
  }
 else {
    throw new ApiException(400,"can not serialize object into Content-Type: " + contentType);
  }
}

public String serialize ( Object obj , String contentType ) throws ApiException { if ( contentType . startsWith ( "application/json" ) ) { return json . serialize ( obj ) ; } else { throw new ApiException ( 400 , "can not serialize object into Content-Type: " + contentType ) ; } }
serialize the given java object into string according the given content - type ( only json is supported for now ) .
