Skip to content

Method: getContent()

1: package migration.difffile.objects;
2:
3: /**
4: * Klassifizierung von nicht zuordbaren Inhalten.
5: *
6: * @author Jan Schering
7: *
8: */
9: public class DiffOtherContent implements DiffFileEntity {
10:
11:         /**
12:          * the content of the line.
13:          */
14:         private final String content;
15:
16:         /**
17:          * Creates a DiffOtherContent with the given content.
18:          *
19:          * @param content
20:          * the content
21:          */
22:         public DiffOtherContent(final String content) {
23:                 this.content = content;
24:         }
25:
26:         /**
27:          * @return the content
28:          */
29:         public String getContent() {
30:                 return content;
31:         }
32:
33:         @Override
34:         public String toString() {
35:                 return "Content: " + this.content;
36:         }
37:
38:         @Override
39:         public int hashCode() {
40:                 final int prime = 31;
41:                 int result = 1;
42:                 result = prime * result + ((content == null)
43:                                 ? 0
44:                                 : content.hashCode());
45:                 return result;
46:         }
47:
48:         @Override
49:         public boolean equals(final Object obj) {
50:                 if (this == obj) {
51:                         return true;
52:                 }
53:                 if (obj == null) {
54:                         return false;
55:                 }
56:                 if (getClass() != obj.getClass()) {
57:                         return false;
58:                 }
59:                 final DiffOtherContent other = (DiffOtherContent) obj;
60:                 if (content == null) {
61:                         if (other.content != null) {
62:                                 return false;
63:                         }
64:                 } else if (!content.equals(other.content)) {
65:                         return false;
66:                 }
67:                 return true;
68:         }
69:
70:         @Override
71:         public boolean hasSameContent(final DiffFileEntity line) {
72:                 return this.equals(line);
73:         }
74:
75: }