All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vk.api.sdk.objects.base.CropPhotoRect Maven / Gradle / Ivy

Go to download

Java library for VK API interaction, includes OAuth 2.0 authorization and API methods.

The newest version!
// Autogenerated from vk-api-schema. Please don't edit it manually.
package com.vk.api.sdk.objects.base;

import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.vk.api.sdk.objects.Validable;
import com.vk.api.sdk.objects.annotations.Required;

import java.util.Objects;

/**
 * CropPhotoRect object
 */
public class CropPhotoRect implements Validable {
    /**
     * Coordinate X of the left upper corner
     */
    @SerializedName("x")
    @Required
    private Number x;

    /**
     * Coordinate X of the right lower corner
     */
    @SerializedName("x2")
    @Required
    private Number x2;

    /**
     * Coordinate Y of the left upper corner
     */
    @SerializedName("y")
    @Required
    private Number y;

    /**
     * Coordinate Y of the right lower corner
     */
    @SerializedName("y2")
    @Required
    private Number y2;

    public Number getX() {
        return x;
    }

    public CropPhotoRect setX(Number x) {
        this.x = x;
        return this;
    }

    public Number getX2() {
        return x2;
    }

    public CropPhotoRect setX2(Number x2) {
        this.x2 = x2;
        return this;
    }

    public Number getY() {
        return y;
    }

    public CropPhotoRect setY(Number y) {
        this.y = y;
        return this;
    }

    public Number getY2() {
        return y2;
    }

    public CropPhotoRect setY2(Number y2) {
        this.y2 = y2;
        return this;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y, y2, x2);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CropPhotoRect cropPhotoRect = (CropPhotoRect) o;
        return Objects.equals(x, cropPhotoRect.x) &&
                Objects.equals(y, cropPhotoRect.y) &&
                Objects.equals(y2, cropPhotoRect.y2) &&
                Objects.equals(x2, cropPhotoRect.x2);
    }

    @Override
    public String toString() {
        final Gson gson = new Gson();
        return gson.toJson(this);
    }

    public String toPrettyString() {
        final StringBuilder sb = new StringBuilder("CropPhotoRect{");
        sb.append("x=").append(x);
        sb.append(", y=").append(y);
        sb.append(", y2=").append(y2);
        sb.append(", x2=").append(x2);
        sb.append('}');
        return sb.toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy