package com.vk.api.sdk.objects.base;

import com.google.gson.annotations.SerializedName;
import com.vk.api.sdk.objects.photos.Photo;

import java.util.Objects;

/**
 * Link object
 */
public class Link {
    /**
     * Link URL
     */
    @SerializedName("url")
    private String url;

    /**
     * Link title
     */
    @SerializedName("title")
    private String title;

    /**
     * Link caption
     */
    @SerializedName("caption")
    private String caption;

    /**
     * Link description
     */
    @SerializedName("description")
    private String description;

    @SerializedName("photo")
    private Photo photo;

    /**
     * Information whether the link is external
     */
    @SerializedName("is_external")
    private BoolInt isExternal;

    /**
     * URL of the page with article preview
     */
    @SerializedName("preview_url")
    private String previewUrl;

    /**
     * String ID of the page with article preview
     */
    @SerializedName("preview_page")
    private String previewPage;

    @SerializedName("button")
    private LinkButton button;

    @SerializedName("product")
    private LinkProduct product;

    @SerializedName("rating")
    private LinkRating rating;

    @SerializedName("application")
    private LinkApplication application;

    public String getUrl() {
        return url;
    }

    public String getTitle() {
        return title;
    }

    public String getCaption() {
        return caption;
    }

    public String getDescription() {
        return description;
    }

    public Photo getPhoto() {
        return photo;
    }

    public boolean isIsExternal() {
        return isExternal == BoolInt.YES;
    }

    public String getPreviewUrl() {
        return previewUrl;
    }

    public String getPreviewPage() {
        return previewPage;
    }

    public LinkButton getButton() {
        return button;
    }

    public LinkProduct getProduct() {
        return product;
    }

    public LinkRating getRating() {
        return rating;
    }

    public LinkApplication getApplication() {
        return application;
    }

    @Override
    public int hashCode() {
        return Objects.hash(previewPage, button, product, previewUrl, isExternal, rating, caption, description, photo, title, url);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Link link = (Link) o;
        return Objects.equals(url, link.url) &&
                Objects.equals(title, link.title) &&
                Objects.equals(caption, link.caption) &&
                Objects.equals(description, link.description) &&
                Objects.equals(photo, link.photo) &&
                Objects.equals(isExternal, link.isExternal) &&
                Objects.equals(previewUrl, link.previewUrl) &&
                Objects.equals(previewPage, link.previewPage) &&
                Objects.equals(button, link.button) &&
                Objects.equals(product, link.product) &&
                Objects.equals(rating, link.rating) &&
                Objects.equals(application, link.application);
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Link{");
        sb.append("url='").append(url).append("'");
        sb.append(", title='").append(title).append("'");
        sb.append(", caption='").append(caption).append("'");
        sb.append(", description='").append(description).append("'");
        sb.append(", photo=").append(photo);
        sb.append(", isExternal=").append(isExternal);
        sb.append(", previewUrl='").append(previewUrl).append("'");
        sb.append(", previewPage='").append(previewPage).append("'");
        sb.append(", button=").append(button);
        sb.append(", product=").append(product);
        sb.append(", rating=").append(rating);
        sb.append(", application=").append(application);
        sb.append('}');
        return sb.toString();
    }
}

@@ -634,140 +634,8 @@
 o;%0A%0A
-    /**%0A     * Information whether the link is external%0A     */%0A    @SerializedName(%22is_external%22)%0A    private BoolInt isExternal;%0A%0A
     
@@ -674,32 +674,32 @@
 article preview%0A
+
      */%0A    @Ser
@@ -1473,93 +1473,8 @@
  %7D%0A%0A
-    public boolean isIsExternal() %7B%0A        return isExternal == BoolInt.YES;%0A    %7D%0A%0A
     
@@ -2008,20 +2008,8 @@
 Url,
- isExternal,
  rat
@@ -2527,71 +2527,8 @@
  &&%0A
-                Objects.equals(isExternal, link.isExternal) &&%0A
     
@@ -3228,32 +3228,32 @@
 n).append(%22'%22);%0A
+
         sb.appen
@@ -3285,63 +3285,8 @@
 o);%0A
-        sb.append(%22, isExternal=%22).append(isExternal);%0A
     

Remove old field from Link class