Package org.compiere.model
Class Obscure
- java.lang.Object
-
- org.compiere.model.Obscure
-
public class Obscure extends Object
Obscure Strings (e.g. Credit Card Numbers). Obscure Type defined in AD_Field- Version:
- $Id: Obscure.java,v 1.4 2006/10/02 05:19:06 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description static String
OBSCURETYPE_ObscureAlphaNumericButFirstLast4
Obscure AlphaNumeric but first/last 4 = A44static String
OBSCURETYPE_ObscureAlphaNumericButLast4
Obscure AlphaNumeric but last 4 = A04static String
OBSCURETYPE_ObscureDigitsButFirstLast4
Obscure Digits but first/last 4 = 944static String
OBSCURETYPE_ObscureDigitsButLast4
Obscure Digits but last 4 = 904 (default)static String
OBSCURETYPE_ObscureMaskMax10Asterisk
Obscure by max 10 asterisk characters, use for EncryptedField - internal, not in the list of obscure type field
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getClearValue()
Get Clear ValueString
getObscuredValue()
Get Obscured ValueString
getObscuredValue(int maxlength)
Get Obscured Value with a max lengthString
getObscuredValue(String clearValue)
Get Obscured ValueString
getObscuredValue(String clearValue, int maxlength)
Get Obscured ValueString
getType()
Get Obscure Typestatic void
main(String[] args)
teststatic String
obscure(String clearValue)
Obscure clear value.static String
obscure(String clearValue, String obscureType)
Obscure clear valuevoid
setClearValue(String clearValue)
Set Clear Valuevoid
setType(String obscureType)
Set Type
-
-
-
Field Detail
-
OBSCURETYPE_ObscureDigitsButLast4
public static final String OBSCURETYPE_ObscureDigitsButLast4
Obscure Digits but last 4 = 904 (default)- See Also:
- Constant Field Values
-
OBSCURETYPE_ObscureDigitsButFirstLast4
public static final String OBSCURETYPE_ObscureDigitsButFirstLast4
Obscure Digits but first/last 4 = 944- See Also:
- Constant Field Values
-
OBSCURETYPE_ObscureAlphaNumericButFirstLast4
public static final String OBSCURETYPE_ObscureAlphaNumericButFirstLast4
Obscure AlphaNumeric but first/last 4 = A44- See Also:
- Constant Field Values
-
OBSCURETYPE_ObscureAlphaNumericButLast4
public static final String OBSCURETYPE_ObscureAlphaNumericButLast4
Obscure AlphaNumeric but last 4 = A04- See Also:
- Constant Field Values
-
OBSCURETYPE_ObscureMaskMax10Asterisk
public static final String OBSCURETYPE_ObscureMaskMax10Asterisk
Obscure by max 10 asterisk characters, use for EncryptedField - internal, not in the list of obscure type field- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Obscure
public Obscure()
Obscure
-
Obscure
public Obscure(String clearValue)
Obscure. Obscure Digits but last 4- Parameters:
clearValue
- clear value
-
-
Method Detail
-
obscure
public static String obscure(String clearValue)
Obscure clear value. Obscure Digits but last 4- Parameters:
clearValue
- clear value- Returns:
- obscured value or "-"
-
obscure
public static String obscure(String clearValue, String obscureType)
Obscure clear value- Parameters:
clearValue
- clear valueobscureType
- Obscure Type- Returns:
- obscured value
-
setType
public void setType(String obscureType)
Set Type- Parameters:
obscureType
- Obscure Type
-
getType
public String getType()
Get Obscure Type- Returns:
- type
-
getClearValue
public String getClearValue()
Get Clear Value- Returns:
- Returns the clear Value.
-
setClearValue
public void setClearValue(String clearValue)
Set Clear Value- Parameters:
clearValue
- The clearValue to set.
-
getObscuredValue
public String getObscuredValue(String clearValue, int maxlength)
Get Obscured Value- Parameters:
clearValue
- The clearValue to set.maxlength
- maximum length of the obscured value- Returns:
- Returns the obscuredValue.
-
getObscuredValue
public String getObscuredValue(String clearValue)
Get Obscured Value- Parameters:
clearValue
- The clearValue to set.- Returns:
- Returns the obscuredValue.
-
getObscuredValue
public String getObscuredValue(int maxlength)
Get Obscured Value with a max length- Parameters:
maxlength
- maximum length of the obscured value- Returns:
- Returns the obscuredValue.
-
getObscuredValue
public String getObscuredValue()
Get Obscured Value- Returns:
- Returns the obscuredValue.
-
main
public static void main(String[] args)
test- Parameters:
args
- ignored
-
-