4191 |
31 Oct 16 |
nicklas |
1 |
package net.sf.basedb.inca; |
4191 |
31 Oct 16 |
nicklas |
2 |
|
4191 |
31 Oct 16 |
nicklas |
3 |
/** |
4191 |
31 Oct 16 |
nicklas |
Masker implementation that masks all values |
4191 |
31 Oct 16 |
nicklas |
with a constant string. |
4191 |
31 Oct 16 |
nicklas |
6 |
|
4191 |
31 Oct 16 |
nicklas |
@author nicklas |
4191 |
31 Oct 16 |
nicklas |
@since 1.1 |
4191 |
31 Oct 16 |
nicklas |
9 |
*/ |
4191 |
31 Oct 16 |
nicklas |
10 |
public class ConstMasker |
4191 |
31 Oct 16 |
nicklas |
11 |
implements Masker |
4191 |
31 Oct 16 |
nicklas |
12 |
{ |
4191 |
31 Oct 16 |
nicklas |
13 |
|
7060 |
14 Mar 23 |
nicklas |
14 |
public static final Masker EMPTY_STRING = new ConstMasker(""); |
7060 |
14 Mar 23 |
nicklas |
15 |
|
4191 |
31 Oct 16 |
nicklas |
16 |
private final String maskedValue; |
4191 |
31 Oct 16 |
nicklas |
17 |
|
4191 |
31 Oct 16 |
nicklas |
18 |
/** |
4191 |
31 Oct 16 |
nicklas |
Create a masker that always return the given value. |
4191 |
31 Oct 16 |
nicklas |
20 |
*/ |
4191 |
31 Oct 16 |
nicklas |
21 |
public ConstMasker(String maskedValue) |
4191 |
31 Oct 16 |
nicklas |
22 |
{ |
4191 |
31 Oct 16 |
nicklas |
23 |
this.maskedValue = maskedValue; |
4191 |
31 Oct 16 |
nicklas |
24 |
} |
4191 |
31 Oct 16 |
nicklas |
25 |
|
4191 |
31 Oct 16 |
nicklas |
26 |
/** |
4191 |
31 Oct 16 |
nicklas |
@return Always the 'maskedValue' given in the constructor |
4191 |
31 Oct 16 |
nicklas |
28 |
*/ |
4191 |
31 Oct 16 |
nicklas |
29 |
@Override |
4191 |
31 Oct 16 |
nicklas |
30 |
public String getMaskedValue(String value) |
4191 |
31 Oct 16 |
nicklas |
31 |
{ |
4191 |
31 Oct 16 |
nicklas |
32 |
return maskedValue; |
4191 |
31 Oct 16 |
nicklas |
33 |
} |
4191 |
31 Oct 16 |
nicklas |
34 |
} |