-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathCEP.java
More file actions
101 lines (83 loc) · 2.27 KB
/
CEP.java
File metadata and controls
101 lines (83 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package br.com.brasilapi.api;
import java.util.Objects;
/**
* Classe CEP. Representa o CEP com seus atributos.
*
* O CEP (Código de Endereçamento Postal) é um sistema de códigos que visa
* racionalizar o processo de encaminhamento e entrega de correspondências
* através da divisão do paás em regiões postais. ... Atualmente, o CEP é
* composto por oito dígitos, cinco de um lado e três de outro. Cada algarismo
* do CEP possui um significado.
*
* @version 1
* @author Sávio Andres
* @see br.com.brasilapi.api.CEP2
* @see <a href=
* "https://brasilapi.com.br/docs#tag/CEP">https://brasilapi.com.br/docs#tag/CEP</a>
*/
public class CEP extends API {
private String cep;
private String state;
private String city;
private String neighborhood;
private String street;
private String service;
public String getCep() {
return cep;
}
public void setCep(String cep) {
this.cep = cep;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getNeighborhood() {
return neighborhood;
}
public void setNeighborhood(String neighborhood) {
this.neighborhood = neighborhood;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getService() {
return service;
}
public void setService(String service) {
this.service = service;
}
@Override
public int hashCode() {
return Objects.hash(cep, city, neighborhood, service, state, street);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CEP other = (CEP) obj;
return Objects.equals(cep, other.cep) && Objects.equals(city, other.city)
&& Objects.equals(neighborhood, other.neighborhood) && Objects.equals(service, other.service)
&& Objects.equals(state, other.state) && Objects.equals(street, other.street);
}
@Override
public String toString() {
return "Cep [cep=" + cep + ", state=" + state + ", city=" + city + ", neighborhood=" + neighborhood
+ ", street=" + street + ", service=" + service + "]";
}
}