Commit 45c6176cf072abe150e4d8fa9440232f09cc02c4
1 parent
5a5e6d42
Exists in
master
nova classe contato
Showing
1 changed file
with
93 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,93 @@ |
1 | +package br.com.model.entity; | |
2 | + | |
3 | +public class Contato { | |
4 | + | |
5 | + private String nome; | |
6 | + private String email; | |
7 | + private String assunto; | |
8 | + private String mensagem; | |
9 | + | |
10 | + public Contato() { | |
11 | + // TODO Auto-generated constructor stub | |
12 | + } | |
13 | + | |
14 | + public Contato(String nome, String email, String assunto, String mensagem) { | |
15 | + this.nome = nome; | |
16 | + this.email = email; | |
17 | + this.assunto = assunto; | |
18 | + this.mensagem = mensagem; | |
19 | + } | |
20 | + | |
21 | + | |
22 | + public String getNome() { | |
23 | + return nome; | |
24 | + } | |
25 | + public void setNome(String nome) { | |
26 | + this.nome = nome; | |
27 | + } | |
28 | + public String getEmail() { | |
29 | + return email; | |
30 | + } | |
31 | + public void setEmail(String email) { | |
32 | + this.email = email; | |
33 | + } | |
34 | + public String getAssunto() { | |
35 | + return assunto; | |
36 | + } | |
37 | + public void setAssunto(String assunto) { | |
38 | + this.assunto = assunto; | |
39 | + } | |
40 | + public String getMensagem() { | |
41 | + return mensagem; | |
42 | + } | |
43 | + public void setMensagem(String mensagem) { | |
44 | + this.mensagem = mensagem; | |
45 | + } | |
46 | + | |
47 | + | |
48 | + @Override | |
49 | + public int hashCode() { | |
50 | + final int prime = 31; | |
51 | + int result = 1; | |
52 | + result = prime * result + ((assunto == null) ? 0 : assunto.hashCode()); | |
53 | + result = prime * result + ((email == null) ? 0 : email.hashCode()); | |
54 | + result = prime * result | |
55 | + + ((mensagem == null) ? 0 : mensagem.hashCode()); | |
56 | + result = prime * result + ((nome == null) ? 0 : nome.hashCode()); | |
57 | + return result; | |
58 | + } | |
59 | + | |
60 | + | |
61 | + @Override | |
62 | + public boolean equals(Object obj) { | |
63 | + if (this == obj) | |
64 | + return true; | |
65 | + if (obj == null) | |
66 | + return false; | |
67 | + if (getClass() != obj.getClass()) | |
68 | + return false; | |
69 | + Contato other = (Contato) obj; | |
70 | + if (assunto == null) { | |
71 | + if (other.assunto != null) | |
72 | + return false; | |
73 | + } else if (!assunto.equals(other.assunto)) | |
74 | + return false; | |
75 | + if (email == null) { | |
76 | + if (other.email != null) | |
77 | + return false; | |
78 | + } else if (!email.equals(other.email)) | |
79 | + return false; | |
80 | + if (mensagem == null) { | |
81 | + if (other.mensagem != null) | |
82 | + return false; | |
83 | + } else if (!mensagem.equals(other.mensagem)) | |
84 | + return false; | |
85 | + if (nome == null) { | |
86 | + if (other.nome != null) | |
87 | + return false; | |
88 | + } else if (!nome.equals(other.nome)) | |
89 | + return false; | |
90 | + return true; | |
91 | + } | |
92 | + | |
93 | +} | ... | ... |