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 Details

    • OBSCURETYPE_ObscureDigitsButLast4

      public static final String OBSCURETYPE_ObscureDigitsButLast4
      Obscure Digits but last 4 = 904 (default)
      See Also:
    • OBSCURETYPE_ObscureDigitsButFirstLast4

      public static final String OBSCURETYPE_ObscureDigitsButFirstLast4
      Obscure Digits but first/last 4 = 944
      See Also:
    • OBSCURETYPE_ObscureAlphaNumericButFirstLast4

      public static final String OBSCURETYPE_ObscureAlphaNumericButFirstLast4
      Obscure AlphaNumeric but first/last 4 = A44
      See Also:
    • OBSCURETYPE_ObscureAlphaNumericButLast4

      public static final String OBSCURETYPE_ObscureAlphaNumericButLast4
      Obscure AlphaNumeric but last 4 = A04
      See Also:
    • 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:
  • Constructor Details

    • Obscure

      public Obscure()
      Obscure
    • Obscure

      public Obscure(String clearValue)
      Obscure. Obscure Digits but last 4
      Parameters:
      clearValue - clear value
    • Obscure

      public Obscure(String clearValue, String obscureType)
      Obscure
      Parameters:
      clearValue - clear value
      obscureType - Obscure Type
  • Method Details

    • 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 value
      obscureType - 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