Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.crosoften.maislista.model;
- import com.fasterxml.jackson.annotation.JsonIgnore;
- import com.fasterxml.jackson.annotation.JsonProperty;
- public class MonthAndCount {
- @JsonProperty(value = "month")
- private String month;
- @JsonProperty(value = "count")
- private int count;
- @JsonIgnore
- private int numMonth;
- public MonthAndCount() {
- }
- public MonthAndCount(int numMonth, int count) {
- this.numMonth = numMonth;
- this.count = count;
- this.convertNumMonthToString();
- }
- private void convertNumMonthToString() {
- switch (numMonth) {
- case 1:
- this.month = "Janeiro";
- break;
- case 2:
- this.month = "Fevereiro";
- break;
- case 3:
- this.month = "Março";
- break;
- case 4:
- this.month = "Abril";
- break;
- case 5:
- this.month = "Maio";
- break;
- case 6:
- this.month = "Junho";
- break;
- case 7:
- this.month = "Julho";
- break;
- case 8:
- this.month = "Agosto";
- break;
- case 9:
- this.month = "Setembro";
- break;
- case 10:
- this.month = "Outubro";
- break;
- case 11:
- this.month = "Novembro";
- break;
- case 12:
- this.month = "Dezembro";
- break;
- default:
- this.month = "Janeiro";
- break;
- }
- }
- public String getMonth() {
- return month;
- }
- public void setMonth(String month) {
- this.month = month;
- }
- public int getCount() {
- return count;
- }
- public void setCount(int count) {
- this.count = count;
- }
- public int getNumMonth() {
- return numMonth;
- }
- public void setNumMonth(int numMonth) {
- this.numMonth = numMonth;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement