Advertisement
Guest User

MonthAndCount

a guest
Jul 21st, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.16 KB | None | 0 0
  1. package com.crosoften.maislista.model;
  2.  
  3. import com.fasterxml.jackson.annotation.JsonIgnore;
  4. import com.fasterxml.jackson.annotation.JsonProperty;
  5.  
  6. public class MonthAndCount {
  7.     @JsonProperty(value = "month")
  8.     private String month;
  9.     @JsonProperty(value = "count")
  10.     private int count;
  11.  
  12.     @JsonIgnore
  13.     private int numMonth;
  14.  
  15.     public MonthAndCount() {
  16.  
  17.     }
  18.  
  19.     public MonthAndCount(int numMonth, int count) {
  20.         this.numMonth = numMonth;
  21.         this.count = count;
  22.         this.convertNumMonthToString();
  23.     }
  24.  
  25.     private void convertNumMonthToString() {
  26.         switch (numMonth) {
  27.             case 1:
  28.                 this.month = "Janeiro";
  29.                 break;
  30.             case 2:
  31.                 this.month = "Fevereiro";
  32.                 break;
  33.             case 3:
  34.                 this.month = "Março";
  35.                 break;
  36.             case 4:
  37.                 this.month = "Abril";
  38.                 break;
  39.             case 5:
  40.                 this.month = "Maio";
  41.                 break;
  42.             case 6:
  43.                 this.month = "Junho";
  44.                 break;
  45.             case 7:
  46.                 this.month = "Julho";
  47.                 break;
  48.             case 8:
  49.                 this.month = "Agosto";
  50.                 break;
  51.             case 9:
  52.                 this.month = "Setembro";
  53.                 break;
  54.             case 10:
  55.                 this.month = "Outubro";
  56.                 break;
  57.             case 11:
  58.                 this.month = "Novembro";
  59.                 break;
  60.             case 12:
  61.                 this.month = "Dezembro";
  62.                 break;
  63.             default:
  64.                 this.month = "Janeiro";
  65.                 break;
  66.         }
  67.  
  68.     }
  69.  
  70.     public String getMonth() {
  71.         return month;
  72.     }
  73.  
  74.     public void setMonth(String month) {
  75.         this.month = month;
  76.     }
  77.  
  78.     public int getCount() {
  79.         return count;
  80.     }
  81.  
  82.     public void setCount(int count) {
  83.         this.count = count;
  84.     }
  85.  
  86.     public int getNumMonth() {
  87.         return numMonth;
  88.     }
  89.  
  90.     public void setNumMonth(int numMonth) {
  91.         this.numMonth = numMonth;
  92.     }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement