1 package org.apache.maven.wagon.providers.ssh.knownhost;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 public class KnownHostEntry
23 {
24
25 private String hostName;
26
27 private String keyType;
28
29 private String keyValue;
30
31 public KnownHostEntry()
32 {
33
34 }
35
36 public KnownHostEntry( String hostName, String keyType, String keyValue )
37 {
38 this.hostName = hostName;
39 this.keyType = keyType;
40 this.keyValue = keyValue;
41 }
42
43 public String getHostName()
44 {
45 return hostName;
46 }
47
48 public void setHostName( String hostName )
49 {
50 this.hostName = hostName;
51 }
52
53 public String getKeyType()
54 {
55 return keyType;
56 }
57
58 public void setKeyType( String keyType )
59 {
60 this.keyType = keyType;
61 }
62
63 public String getKeyValue()
64 {
65 return keyValue;
66 }
67
68 public void setKeyValue( String keyValue )
69 {
70 this.keyValue = keyValue;
71 }
72
73 public int hashCode()
74 {
75 final int prime = 31;
76 int result = 1;
77 result = prime * result + ( ( hostName == null ) ? 0 : hostName.hashCode() );
78 result = prime * result + ( ( keyType == null ) ? 0 : keyType.hashCode() );
79 result = prime * result + ( ( keyValue == null ) ? 0 : keyValue.hashCode() );
80 return result;
81 }
82
83 public boolean equals( Object obj )
84 {
85 if ( this == obj )
86 return true;
87 if ( obj == null )
88 return false;
89 if ( getClass() != obj.getClass() )
90 return false;
91 KnownHostEntry other = (KnownHostEntry) obj;
92 if ( hostName == null )
93 {
94 if ( other.hostName != null )
95 return false;
96 }
97 else if ( !hostName.equals( other.hostName ) )
98 return false;
99 if ( keyType == null )
100 {
101 if ( other.keyType != null )
102 return false;
103 }
104 else if ( !keyType.equals( other.keyType ) )
105 return false;
106 if ( keyValue == null )
107 {
108 if ( other.keyValue != null )
109 return false;
110 }
111 else if ( !keyValue.equals( other.keyValue ) )
112 return false;
113 return true;
114 }
115
116 }