RisultatoStato.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.core.controllo_traffico.beans;

  21. import java.io.Serializable;
  22. import java.text.SimpleDateFormat;
  23. import java.util.Date;

  24. import org.openspcoop2.utils.date.DateUtils;

  25. /**
  26.  * RisultatoAllarme
  27.  *
  28.  * @author Andrea Poli (poli@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */
  32. public class RisultatoStato implements Serializable {

  33.     /**
  34.      *
  35.      */
  36.     private static final long serialVersionUID = 1L;
  37.     private Integer stato;
  38.     private Date dateCheck;
  39.    
  40.     public Integer getStato() {
  41.         return this.stato;
  42.     }
  43.     public void setStato(Integer stato) {
  44.         this.stato = stato;
  45.     }
  46.     public Date getDateCheck() {
  47.         return this.dateCheck;
  48.     }
  49.     public void setDateCheck(Date dateCheck) {
  50.         this.dateCheck = dateCheck;
  51.     }
  52.    
  53.     @Override
  54.     public String toString(){
  55.        
  56.         StringBuilder bf = new StringBuilder();
  57.        
  58.         bf.append("Stato: ");
  59.         if(this.stato!=null)
  60.             bf.append(this.stato);
  61.         else
  62.             bf.append("-");
  63.        
  64.         bf.append("\n");
  65.        
  66.         SimpleDateFormat dateFormat = DateUtils.getSimpleDateFormatMs();
  67.         bf.append("UltimoAggiornamento: ");
  68.         if(this.dateCheck!=null)
  69.             bf.append(dateFormat.format(this.dateCheck));
  70.         else
  71.             bf.append("-");
  72.        
  73.         return bf.toString();
  74.     }
  75.    
  76.    
  77. }