{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/81320374","pull_request_review_id":2308469,"id":81320374,"diff_hunk":"@@ -1,93 +1,286 @@\n package com.mapswithme.maps.widget.placepage;\n \n+import android.support.annotation.NonNull;\n+import android.support.annotation.Nullable;\n import android.support.annotation.UiThread;\n import android.text.TextUtils;\n \n+import com.mapswithme.maps.bookmarks.data.MapObject;\n+import com.mapswithme.maps.bookmarks.data.Metadata;\n+import com.mapswithme.maps.gallery.Image;\n+import com.mapswithme.maps.review.Review;\n+\n import java.lang.ref.WeakReference;\n import java.util.HashMap;\n import java.util.Map;\n \n-import com.mapswithme.maps.bookmarks.data.MapObject;\n-import com.mapswithme.maps.bookmarks.data.Metadata;\n-\n @UiThread\n final class SponsoredHotel\n {\n   private static class Price\n   {\n-    final String price;\n-    final String currency;\n+    @NonNull\n+    final String mPrice;\n+    @NonNull\n+    final String mCurrency;\n+\n+    private Price(@NonNull String price, @NonNull String currency)\n+    {\n+      this.mPrice = price;\n+      this.mCurrency = currency;\n+    }\n+  }\n+\n+  static class FacilityType\n+  {\n+    @NonNull\n+    private final String mKey;\n+    @NonNull\n+    private final String mName;\n+\n+    public FacilityType(@NonNull String key, @NonNull String name)\n+    {\n+      this.mKey = key;\n+      this.mName = name;\n+    }\n+\n+    @NonNull\n+    public String getKey()\n+    {\n+      return mKey;\n+    }\n \n-    private Price(String price, String currency)\n+    @NonNull\n+    public String getName()\n     {\n-      this.price = price;\n-      this.currency = currency;\n+      return mName;\n+    }\n+  }\n+\n+  static class NearbyObject\n+  {\n+    @NonNull\n+    private final String mCategory;\n+    @NonNull\n+    private final String mTitle;\n+    @NonNull\n+    private final String mDistance;\n+    private final double mLatitude;\n+    private final double mLongitude;\n+\n+    public NearbyObject(@NonNull String category, @NonNull String title,\n+                        @NonNull String distance, double lat, double lon)\n+    {\n+      this.mCategory = category;\n+      this.mTitle = title;\n+      this.mDistance = distance;\n+      this.mLatitude = lat;\n+      this.mLongitude = lon;\n+    }\n+\n+    @NonNull\n+    public String getCategory()\n+    {\n+      return mCategory;\n+    }\n+\n+    @NonNull\n+    public String getTitle()\n+    {\n+      return mTitle;\n+    }\n+\n+    @NonNull\n+    public String getDistance()\n+    {\n+      return mDistance;\n+    }\n+\n+    public double getLatitude()\n+    {\n+      return mLatitude;\n+    }\n+\n+    public double getLongitude()\n+    {\n+      return mLongitude;\n+    }\n+  }\n+\n+  static class HotelInfo\n+  {\n+    @Nullable\n+    final String mDescription;\n+    @Nullable\n+    final Image[] mPhotos;\n+    @Nullable\n+    final FacilityType[] mFacilities;\n+    @Nullable\n+    final Review[] mReviews;\n+    @Nullable\n+    final NearbyObject[] mNearby;\n+\n+    public HotelInfo(@Nullable String description, @Nullable Image[] photos,\n+                     @Nullable FacilityType[] facilities, @Nullable Review[] reviews,\n+                     @Nullable NearbyObject[] nearby)\n+    {\n+      this.mDescription = description;\n+      this.mPhotos = photos;\n+      this.mFacilities = facilities;\n+      this.mReviews = reviews;\n+      this.mNearby = nearby;\n     }\n   }\n \n   interface OnPriceReceivedListener\n   {\n-    void onPriceReceived(String id, String price, String currency);\n+    /**\n+     * This method is called from the native core on the UI thread\n+     * when the Hotel price will be obtained\n+     *\n+     * @param id A hotel id\n+     * @param price A price\n+     * @param currency A price currency\n+     */\n+    @UiThread\n+    void onPriceReceived(@NonNull String id, @NonNull String price, @NonNull String currency);\n+  }\n+\n+  interface OnInfoReceivedListener\n+  {\n+    /**\n+     * This method is called from the native core on the UI thread\n+     * when the Hotel information will be obtained\n+     *\n+     * @param id A hotel id\n+     * @param info A hotel info\n+     */\n+    @UiThread\n+    void onInfoReceived(@NonNull String id, @NonNull HotelInfo info);\n   }\n \n   // Hotel ID -> Price\n+  @NonNull\n   private static final Map<String, Price> sPriceCache = new HashMap<>();\n-  private static WeakReference<OnPriceReceivedListener> sListener;\n+  // Hotel ID -> Description\n+  @NonNull\n+  private static final Map<String, HotelInfo> sInfoCache = new HashMap<>();\n+  @Nullable\n+  private static WeakReference<OnPriceReceivedListener> sPriceListener;\n+  @Nullable\n+  private static WeakReference<OnInfoReceivedListener> sInfoListener;","path":"android/src/com/mapswithme/maps/widget/placepage/SponsoredHotel.java","position":null,"original_position":181,"commit_id":"e3f6cc5bfa556b33efd68539d51031c028c00914","original_commit_id":"0caac98134dad3242b6835f21b1e1c18d5e7a0fc","user":{"login":"alexzatsepin","id":8442156,"avatar_url":"https://avatars.githubusercontent.com/u/8442156?v=3","gravatar_id":"","url":"https://api.github.com/users/alexzatsepin","html_url":"https://github.com/alexzatsepin","followers_url":"https://api.github.com/users/alexzatsepin/followers","following_url":"https://api.github.com/users/alexzatsepin/following{/other_user}","gists_url":"https://api.github.com/users/alexzatsepin/gists{/gist_id}","starred_url":"https://api.github.com/users/alexzatsepin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexzatsepin/subscriptions","organizations_url":"https://api.github.com/users/alexzatsepin/orgs","repos_url":"https://api.github.com/users/alexzatsepin/repos","events_url":"https://api.github.com/users/alexzatsepin/events{/privacy}","received_events_url":"https://api.github.com/users/alexzatsepin/received_events","type":"User","site_admin":false},"body":"@goblinr Ответь, пожалуйста, на первый вопрос про static","created_at":"2016-09-30T11:14:51Z","updated_at":"2016-09-30T11:14:51Z","html_url":"https://github.com/mapsme/omim/pull/4367#discussion_r81320374","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/4367","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/81320374"},"html":{"href":"https://github.com/mapsme/omim/pull/4367#discussion_r81320374"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4367"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/4367","id":86480579,"html_url":"https://github.com/mapsme/omim/pull/4367","diff_url":"https://github.com/mapsme/omim/pull/4367.diff","patch_url":"https://github.com/mapsme/omim/pull/4367.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/4367","number":4367,"state":"open","locked":false,"title":"[android] place page booking","user":{"login":"goblinr","id":2997073,"avatar_url":"https://avatars.githubusercontent.com/u/2997073?v=3","gravatar_id":"","url":"https://api.github.com/users/goblinr","html_url":"https://github.com/goblinr","followers_url":"https://api.github.com/users/goblinr/followers","following_url":"https://api.github.com/users/goblinr/following{/other_user}","gists_url":"https://api.github.com/users/goblinr/gists{/gist_id}","starred_url":"https://api.github.com/users/goblinr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goblinr/subscriptions","organizations_url":"https://api.github.com/users/goblinr/orgs","repos_url":"https://api.github.com/users/goblinr/repos","events_url":"https://api.github.com/users/goblinr/events{/privacy}","received_events_url":"https://api.github.com/users/goblinr/received_events","type":"User","site_admin":false},"body":"Added place page hotel gallery block.\r\nAdded hotel gallery list activity.\r\nAdded fullscreen gallery activity.\r\nAdded place page hotel details block.\r\nAdded place page hotel reviews block.\r\nAdded reviews activity.\r\nAdded place page hotel facilities block.","created_at":"2016-09-23T09:27:46Z","updated_at":"2016-09-30T11:14:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6533ee6b30b05afb0e9eb1226c4a6b92fec7084","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/4367/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/4367/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/4367/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/e3f6cc5bfa556b33efd68539d51031c028c00914","head":{"label":"goblinr:MAPSME-1-external-place-page-booking","ref":"MAPSME-1-external-place-page-booking","sha":"e3f6cc5bfa556b33efd68539d51031c028c00914","user":{"login":"goblinr","id":2997073,"avatar_url":"https://avatars.githubusercontent.com/u/2997073?v=3","gravatar_id":"","url":"https://api.github.com/users/goblinr","html_url":"https://github.com/goblinr","followers_url":"https://api.github.com/users/goblinr/followers","following_url":"https://api.github.com/users/goblinr/following{/other_user}","gists_url":"https://api.github.com/users/goblinr/gists{/gist_id}","starred_url":"https://api.github.com/users/goblinr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goblinr/subscriptions","organizations_url":"https://api.github.com/users/goblinr/orgs","repos_url":"https://api.github.com/users/goblinr/repos","events_url":"https://api.github.com/users/goblinr/events{/privacy}","received_events_url":"https://api.github.com/users/goblinr/received_events","type":"User","site_admin":false},"repo":{"id":68004519,"name":"omim","full_name":"goblinr/omim","owner":{"login":"goblinr","id":2997073,"avatar_url":"https://avatars.githubusercontent.com/u/2997073?v=3","gravatar_id":"","url":"https://api.github.com/users/goblinr","html_url":"https://github.com/goblinr","followers_url":"https://api.github.com/users/goblinr/followers","following_url":"https://api.github.com/users/goblinr/following{/other_user}","gists_url":"https://api.github.com/users/goblinr/gists{/gist_id}","starred_url":"https://api.github.com/users/goblinr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goblinr/subscriptions","organizations_url":"https://api.github.com/users/goblinr/orgs","repos_url":"https://api.github.com/users/goblinr/repos","events_url":"https://api.github.com/users/goblinr/events{/privacy}","received_events_url":"https://api.github.com/users/goblinr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/goblinr/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/goblinr/omim","forks_url":"https://api.github.com/repos/goblinr/omim/forks","keys_url":"https://api.github.com/repos/goblinr/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/goblinr/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/goblinr/omim/teams","hooks_url":"https://api.github.com/repos/goblinr/omim/hooks","issue_events_url":"https://api.github.com/repos/goblinr/omim/issues/events{/number}","events_url":"https://api.github.com/repos/goblinr/omim/events","assignees_url":"https://api.github.com/repos/goblinr/omim/assignees{/user}","branches_url":"https://api.github.com/repos/goblinr/omim/branches{/branch}","tags_url":"https://api.github.com/repos/goblinr/omim/tags","blobs_url":"https://api.github.com/repos/goblinr/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/goblinr/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/goblinr/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/goblinr/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/goblinr/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/goblinr/omim/languages","stargazers_url":"https://api.github.com/repos/goblinr/omim/stargazers","contributors_url":"https://api.github.com/repos/goblinr/omim/contributors","subscribers_url":"https://api.github.com/repos/goblinr/omim/subscribers","subscription_url":"https://api.github.com/repos/goblinr/omim/subscription","commits_url":"https://api.github.com/repos/goblinr/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/goblinr/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/goblinr/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/goblinr/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/goblinr/omim/contents/{+path}","compare_url":"https://api.github.com/repos/goblinr/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/goblinr/omim/merges","archive_url":"https://api.github.com/repos/goblinr/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/goblinr/omim/downloads","issues_url":"https://api.github.com/repos/goblinr/omim/issues{/number}","pulls_url":"https://api.github.com/repos/goblinr/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/goblinr/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/goblinr/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/goblinr/omim/labels{/name}","releases_url":"https://api.github.com/repos/goblinr/omim/releases{/id}","deployments_url":"https://api.github.com/repos/goblinr/omim/deployments","created_at":"2016-09-12T11:50:39Z","updated_at":"2016-09-12T11:52:10Z","pushed_at":"2016-09-30T11:04:10Z","git_url":"git://github.com/goblinr/omim.git","ssh_url":"git@github.com:goblinr/omim.git","clone_url":"https://github.com/goblinr/omim.git","svn_url":"https://github.com/goblinr/omim","homepage":null,"size":2715248,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"87312eac6498904a0f33cf51fe3524aff83b61cc","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-09-30T06:02:43Z","pushed_at":"2016-09-30T11:11:59Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2809655,"stargazers_count":1987,"watchers_count":1987,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":361,"mirror_url":null,"open_issues_count":327,"forks":361,"open_issues":327,"watchers":1987,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4367"},"html":{"href":"https://github.com/mapsme/omim/pull/4367"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/4367"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/4367/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4367/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/4367/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/e3f6cc5bfa556b33efd68539d51031c028c00914"}}}}
{"actor":{"display_login":"alexzatsepin"}}