1
1
package org .simplejavamail .api .mailer .config ;
2
2
3
3
import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
4
+ import lombok .EqualsAndHashCode ;
4
5
import org .jetbrains .annotations .NotNull ;
5
- import org .jetbrains .annotations .Nullable ;
6
6
import org .simplejavamail .internal .util .MiscUtil ;
7
7
8
8
import java .io .File ;
9
9
import java .io .FileInputStream ;
10
10
import java .io .IOException ;
11
11
import java .io .InputStream ;
12
- import java .util .Arrays ;
13
- import java .util .Objects ;
14
12
15
13
import static java .lang .String .format ;
16
14
17
15
/**
18
16
* Config holder for PKCS12 store+key info used for S/MIME encrypting / decrypting.
19
17
*/
20
- // FIXME LOMBOK!!
18
+ @ EqualsAndHashCode
21
19
public final class Pkcs12Config {
22
20
23
21
@ NotNull private final byte [] pkcs12StoreData ;
@@ -31,7 +29,6 @@ private Pkcs12Config(@NotNull byte[] pkcs12StoreData, @NotNull char[] storePassw
31
29
this .keyAlias = keyAlias ;
32
30
this .keyPassword = keyPassword ;
33
31
}
34
-
35
32
@ NotNull
36
33
public static Pkcs12ConfigBuilder builder () {
37
34
return new Pkcs12ConfigBuilder ();
@@ -68,29 +65,6 @@ public String toString() {
68
65
return sb .toString ();
69
66
}
70
67
71
- @ Override
72
- public boolean equals (@ Nullable final Object o ) {
73
- if (this == o ) {
74
- return true ;
75
- }
76
- if (o == null || getClass () != o .getClass ()) {
77
- return false ;
78
- }
79
- final Pkcs12Config that = (Pkcs12Config ) o ;
80
- return Arrays .equals (pkcs12StoreData , that .pkcs12StoreData ) &&
81
- Arrays .equals (storePassword , that .storePassword ) &&
82
- keyAlias .equals (that .keyAlias ) &&
83
- Arrays .equals (keyPassword , that .keyPassword );
84
- }
85
-
86
- @ Override
87
- public int hashCode () {
88
- int result = Objects .hash (Arrays .hashCode (pkcs12StoreData ), keyAlias );
89
- result = 31 * result + Arrays .hashCode (storePassword );
90
- result = 31 * result + Arrays .hashCode (keyPassword );
91
- return result ;
92
- }
93
-
94
68
public static class Pkcs12ConfigBuilder {
95
69
private byte [] pkcs12StoreData ;
96
70
private char [] storePassword ;
0 commit comments