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

com.github.tmdb.model.StatusCode Maven / Gradle / Ivy

The newest version!
package com.github.tmdb.model;

import org.apache.log4j.Logger;
import org.codehaus.jackson.annotate.JsonAnySetter;
import org.codehaus.jackson.annotate.JsonProperty;

/**
 *
 * @author Stuart
 */
public class StatusCode {
    /*
     * Logger
     */

    private static final Logger LOGGER = Logger.getLogger(StatusCode.class);
    /*
     * Properties
     */
    @JsonProperty("status_code")
    private int statusCode;
    @JsonProperty("status_message")
    private String statusMessage;

    //
    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }
    //

    //
    public String getStatusMessage() {
        return statusMessage;
    }

    public void setStatusMessage(String statusMessage) {
        this.statusMessage = statusMessage;
    }
    //

    /**
     * Handle unknown properties and print a message
     * @param key
     * @param value
     */
    @JsonAnySetter
    public void handleUnknown(String key, Object value) {
        StringBuilder sb = new StringBuilder();
        sb.append("Unknown property: '").append(key);
        sb.append("' value: '").append(value).append("'");
        LOGGER.warn(sb.toString());
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Status Code: ").append(statusCode);
        sb.append(", Message: ").append(statusMessage);
        return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy