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

Explore the source code of the class PhotoSize.java


package com.antonioaltieri.telegram.botapi.types;

import com.google.gson.annotations.SerializedName;

/**
 * This object represents one size of a photo or a file / sticker thumbnail.
 *
 * Any getters labeled optional might return a default value (such as [email protected] null}).
 *
 * @see https://core.telegram.org/bots/api#photosize
 */
public class PhotoSize {

    @SerializedName("file_id")
    private String fileId;

    @SerializedName("width")
    private int width;

    @SerializedName("height")
    private int height;

    @SerializedName("file_size")
    private long fileSize = -1;

    /**
     * @return Unique identifier for this file
     */
    public String getFileId() {
        return fileId;
    }

    /**
     * @return Photo width
     */
    public int getWidth() {
        return width;
    }

    /**
     * @return Photo height
     */
    public int getHeight() {
        return height;
    }

    /**
     * Optional.
     *
     * @return File size
     */
    public long getFileSize() {
        return fileSize;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("PhotoSize{");
        sb.append("fileId='").append(fileId).append('\'');
        sb.append(", width=").append(width);
        sb.append(", height=").append(height);
        sb.append(", fileSize=").append(fileSize);
        sb.append('}');
        return sb.toString();
    }
}