1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.codec.xml;
17
18
19
20
21 public class XmlDocumentStart {
22
23 private final String encoding;
24 private final String version;
25 private final boolean standalone;
26 private final String encodingScheme;
27
28 public XmlDocumentStart(String encoding, String version, boolean standalone, String encodingScheme) {
29 this.encoding = encoding;
30 this.version = version;
31 this.standalone = standalone;
32 this.encodingScheme = encodingScheme;
33 }
34
35
36 public String encoding() {
37 return encoding;
38 }
39
40
41 public String version() {
42 return version;
43 }
44
45
46 public boolean standalone() {
47 return standalone;
48 }
49
50
51 public String encodingScheme() {
52 return encodingScheme;
53 }
54
55 @Override
56 public boolean equals(Object o) {
57 if (this == o) {
58 return true;
59 }
60 if (o == null || getClass() != o.getClass()) {
61 return false;
62 }
63
64 XmlDocumentStart that = (XmlDocumentStart) o;
65
66 if (standalone != that.standalone) {
67 return false;
68 }
69 if (encoding != null ? !encoding.equals(that.encoding) : that.encoding != null) {
70 return false;
71 }
72 if (encodingScheme != null ? !encodingScheme.equals(that.encodingScheme) : that.encodingScheme != null) {
73 return false;
74 }
75 if (version != null ? !version.equals(that.version) : that.version != null) {
76 return false;
77 }
78
79 return true;
80 }
81
82 @Override
83 public int hashCode() {
84 int result = encoding != null ? encoding.hashCode() : 0;
85 result = 31 * result + (version != null ? version.hashCode() : 0);
86 result = 31 * result + (standalone ? 1 : 0);
87 result = 31 * result + (encodingScheme != null ? encodingScheme.hashCode() : 0);
88 return result;
89 }
90
91 @Override
92 public String toString() {
93 return "XmlDocumentStart{" +
94 "encoding='" + encoding + '\'' +
95 ", version='" + version + '\'' +
96 ", standalone=" + standalone +
97 ", encodingScheme='" + encodingScheme + '\'' +
98 '}';
99 }
100 }