public class MaskValueMetadataImpl extends java.lang.Object implements MaskValueMetadata
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DATE_TIME_FORMAT |
static java.lang.String |
DEFAULT_DATE_TIME_SENTINEL |
UNKNOWN_LENGTH_SENTINEL, UNLIMITED_LENGTH_SENTINEL
Constructor and Description |
---|
MaskValueMetadataImpl()
Create a MaskValueMetadataImpl object with default values.
|
MaskValueMetadataImpl(MaskValueMetadata inputObject)
Create a MaskValueMetadataImpl object with values taken from an object that implements
MaskValueMetadata.
|
Modifier and Type | Method and Description |
---|---|
MaskValueMetadataImpl |
autoIncrementField(boolean isAutoIncrementFieldIn) |
MaskValueMetadataImpl |
dataPathFieldName(java.lang.String dataPathFieldNameIn) |
MaskValueMetadataImpl |
dataPathParentName(java.lang.String dataPathParentNameIn) |
MaskValueMetadataImpl |
dateFormat(java.lang.String dateFormatIn)
Set the Date Format string used to construct the DateTimeFormatter.
|
java.lang.String |
getDataPathFieldName()
Get the field or column name of the data this metadata applies to, or null if no path
information is available.
|
java.lang.String |
getDataPathParentName()
Get the record or table name of the data this metadata applies to, or null if no path
information is available.
|
java.time.format.DateTimeFormatter |
getDateTimeFormatter()
Get a formatter appropriate for converting String values to and from LocalDateTime objects.
|
MaskingAlgorithm.MaskingType |
getMaskingType()
Get the
MaskingAlgorithm.MaskingType type of the values being masked. |
long |
getMaxLength()
Get the maximum size of the value being masked.
|
int |
getNumericPrecision()
Get the numeric precision, in digits, of the field.
|
UnderlyingDataType |
getStorageType()
Get the
UnderlyingDataType value indicating the storage type of the value masked. |
java.lang.String |
getStringCharsetName()
Get the name of the
Charset used to encode string values in the underlying data
format. |
int |
getStringMaxLength()
Get the maximum length of String that will fit in the field.
|
boolean |
isAutoIncrementField()
Get a boolean value indicating whether the field is AUTO_INCREMENT.
|
boolean |
isStringMaxLengthEncoded()
Get a boolean value indicating whether the value returned by
MaskValueMetadata.getStringMaxLength() method represents the maximum Java String length
in characters (false), or a byte length limit that should be applied to the encoded String
(true). |
MaskValueMetadataImpl |
markReadOnly()
Mark this object read-only.
|
MaskValueMetadataImpl |
maskingType(MaskingAlgorithm.MaskingType typeIn)
Set the maskType value to use for the masked value.
|
MaskValueMetadataImpl |
maxLength(long maxLengthIn) |
MaskValueMetadataImpl |
numericPrecision(int precisionIn) |
MaskValueMetadataImpl |
storageType(UnderlyingDataType typeIn) |
MaskValueMetadataImpl |
stringCharset(java.lang.String stringCharsetNameIn)
Set the stringCharset value to use for the masked value.
|
MaskValueMetadataImpl |
stringMaxLength(int stringMaxLengthIn)
Set the stringMaxLength value to use for the masked value.
|
MaskValueMetadataImpl |
stringMaxLengthEncoded(boolean stringMaxLengthEncodedIn)
Set the stringMaxLengthEncoded value to use for the masked value.
|
public static final java.lang.String DEFAULT_DATE_TIME_SENTINEL
public static final java.lang.String DEFAULT_DATE_TIME_FORMAT
public MaskValueMetadataImpl()
public MaskValueMetadataImpl(MaskValueMetadata inputObject)
inputObject
- The source objectpublic java.time.format.DateTimeFormatter getDateTimeFormatter()
MaskValueMetadata
getDateTimeFormatter
in interface MaskValueMetadata
public int getStringMaxLength()
MaskValueMetadata
getStringMaxLength
in interface MaskValueMetadata
public boolean isStringMaxLengthEncoded()
MaskValueMetadata
MaskValueMetadata.getStringMaxLength()
method represents the maximum Java String length
in characters (false), or a byte length limit that should be applied to the encoded String
(true).isStringMaxLengthEncoded
in interface MaskValueMetadata
public java.lang.String getStringCharsetName()
MaskValueMetadata
Charset
used to encode string values in the underlying data
format.getStringCharsetName
in interface MaskValueMetadata
Charset
.public MaskingAlgorithm.MaskingType getMaskingType()
MaskValueMetadata
MaskingAlgorithm.MaskingType
type of the values being masked. This
information is provided to allow ADVANCED_OBJECT type algorithms to determine the underlying
object type for values being masked.getMaskingType
in interface MaskValueMetadata
public UnderlyingDataType getStorageType()
MaskValueMetadata
Get the UnderlyingDataType
value indicating the storage type of the value masked.
This information more precisely reflects storage type of the value than MaskingType. The
result will be null when this information is not available.
The special values MaskValueMetadata.UNKNOWN_LENGTH_SENTINEL
and MaskValueMetadata.UNLIMITED_LENGTH_SENTINEL
represent special case values for maximum length. Presence of these sentinels typically means
no length restriction will be applied to the mask value.
getStorageType
in interface MaskValueMetadata
public long getMaxLength()
MaskValueMetadata
MaskValueMetadata.isStringMaxLengthEncoded()
returns
true.getMaxLength
in interface MaskValueMetadata
public int getNumericPrecision()
MaskValueMetadata
Get the numeric precision, in digits, of the field. This is the maximum number of base 10 digits that can be store in the field without rounding. This value is approximate when storageType is LONG or DOUBLE, and indicates the number of full decimal digits the field can carry. For example, a 16-bit integer will show value of 4, since the values from 32,768 - 99,999 cannot be represented.
This value is undefined for storage types other than BIG_DECIMAL, LONG and DOUBLE.
A value of 0 will be returned if the numeric precision is known
getNumericPrecision
in interface MaskValueMetadata
@Nullable public java.lang.String getDataPathFieldName()
MaskValueMetadata
getDataPathFieldName
in interface MaskValueMetadata
@Nullable public java.lang.String getDataPathParentName()
MaskValueMetadata
getDataPathParentName
in interface MaskValueMetadata
public boolean isAutoIncrementField()
MaskValueMetadata
isAutoIncrementField
in interface MaskValueMetadata
public MaskValueMetadataImpl dateFormat(java.lang.String dateFormatIn)
DEFAULT_DATE_TIME_SENTINEL
value may be used to reset to the
default format.dateFormatIn
- The new date format, which should be compatible with
DateTimeFormatterBuilder.appendPattern(java.lang.String)
public MaskValueMetadataImpl stringMaxLength(int stringMaxLengthIn)
stringMaxLengthIn
- the new stringMaxLength valuepublic MaskValueMetadataImpl stringMaxLengthEncoded(boolean stringMaxLengthEncodedIn)
stringMaxLengthEncodedIn
- the new stringMaxLengthEncoded valuepublic MaskValueMetadataImpl stringCharset(java.lang.String stringCharsetNameIn)
stringCharsetNameIn
- The string name of the Charset
to use.public MaskValueMetadataImpl maskingType(MaskingAlgorithm.MaskingType typeIn)
typeIn
- The MaskingAlgorithm.MaskingType
value to use.public MaskValueMetadataImpl storageType(UnderlyingDataType typeIn)
public MaskValueMetadataImpl numericPrecision(int precisionIn)
public MaskValueMetadataImpl maxLength(long maxLengthIn)
public MaskValueMetadataImpl dataPathFieldName(java.lang.String dataPathFieldNameIn)
public MaskValueMetadataImpl dataPathParentName(java.lang.String dataPathParentNameIn)
public MaskValueMetadataImpl autoIncrementField(boolean isAutoIncrementFieldIn)
public MaskValueMetadataImpl markReadOnly()
MaskValueMetadata
objects retrieved by algorithms are
read-only. Calling this method marks this read-only to prevent modification. It is generally
not useful to call this method in the context of an algorithm implementation.