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

com.github.naviit.libs.common.model.DTTResponse Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
/************************************************
 * Copyright 2017 by DTT - All rights reserved. *    
 ************************************************/
package com.github.naviit.libs.common.model;

import java.io.Serializable;

import com.github.naviit.libs.common.util.JsonUtil;

/**
 * @author  Dang Thanh Tung 
 * {@literal }
 * @since   28/12/2017
 */
public class DTTResponse implements Serializable {

  private static final long serialVersionUID = 2282925303635918496L;

  protected int code;
  protected String message;
  protected T data;

  public DTTResponse() {}

  public DTTResponse(int code, String message) {
    this.code = code;
    this.message = message;
  }

  public DTTResponse(int code, String message, T data) {
    this.code = code;
    this.message = message;
    this.data = data;
  }

  public int getCode() { return code; }
  public void setCode(int code) { this.code = code; }

  public String getMessage() { return message; }
  public void setMessage(String message) { this.message = message; }

  public T getData() { return data; }
  public void setData(T data) { this.data = data; }

  @Override
  public String toString() {
    return JsonUtil.toJson(this);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy