- java.lang.Object
-
- com.pervasive.datarush.schema.TextConversionDefaults
-
public final class TextConversionDefaults extends Object
Describes behaviors used during conversion of token values to and from text. These settings are typically used to describe default behavior for a schema. Text types are not required to honor any of these settings. The default behavior for text type processing is:- Null values are indicated by an empty string ("").
- String-valued types do not perform whitespace trimming and tread the empty string as a null value.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_NULL_MARKER
The default text value used to indicate a null value, the empty string ("").
-
Constructor Summary
Constructors Constructor Description TextConversionDefaults()
Creates a descriptor specifying default behavior.TextConversionDefaults(TextTypes.StringConversion behavior)
Creates a descriptor having the specified string processing behavior.TextConversionDefaults(String nullIndicator)
Creates a descriptor having the specified null indicator.TextConversionDefaults(String nullIndicator, TextTypes.StringConversion behavior)
Creates a descriptor having the specified behavior.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
applyDefaultNullMarker(String value)
Merges the given null indicator with the default.TextTypes.StringConversion
applyDefaultStringHandling(TextTypes.StringConversion value)
Merges the given string conversion behavior with the default.boolean
equals(Object o)
String
getNullIndicator()
Gets the text value used to represent null values.TextTypes.StringConversion
getStringHandling()
Gets the behavior for processing string-valued types.int
hashCode()
void
setNullIndicator(String value)
Sets the text value used to represent null values.void
setStringHandling(TextTypes.StringConversion behavior)
Sets the behavior for processing string-valued types.
-
-
-
Field Detail
-
DEFAULT_NULL_MARKER
public static final String DEFAULT_NULL_MARKER
The default text value used to indicate a null value, the empty string ("").- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TextConversionDefaults
public TextConversionDefaults()
Creates a descriptor specifying default behavior.
-
TextConversionDefaults
public TextConversionDefaults(String nullIndicator)
Creates a descriptor having the specified null indicator. All other behavior is default.- Parameters:
nullIndicator
- the string used to represent a null value
-
TextConversionDefaults
public TextConversionDefaults(TextTypes.StringConversion behavior)
Creates a descriptor having the specified string processing behavior. All other behavior is default.- Parameters:
behavior
- indicates how string-valued type should be converted from text
-
TextConversionDefaults
public TextConversionDefaults(String nullIndicator, TextTypes.StringConversion behavior)
Creates a descriptor having the specified behavior.- Parameters:
nullIndicator
- the string used to represent a null valuebehavior
- indicates how string-valued type should be converted from text
-
-
Method Detail
-
getNullIndicator
public String getNullIndicator()
Gets the text value used to represent null values.- Returns:
- the string indicating a null value
-
applyDefaultNullMarker
public String applyDefaultNullMarker(String value)
Merges the given null indicator with the default.- Parameters:
value
- the input null indicator- Returns:
value
ifvalue != null
, otherwise the null indicator value in the defaults
-
setNullIndicator
public void setNullIndicator(String value)
Sets the text value used to represent null values.- Parameters:
value
- the string used to indicate a null value
-
getStringHandling
public TextTypes.StringConversion getStringHandling()
Gets the behavior for processing string-valued types.- Returns:
- how string-valued types should be converted from text
-
setStringHandling
public void setStringHandling(TextTypes.StringConversion behavior)
Sets the behavior for processing string-valued types.- Parameters:
behavior
- indicates how string-valued types should be converted from text
-
applyDefaultStringHandling
public TextTypes.StringConversion applyDefaultStringHandling(TextTypes.StringConversion value)
Merges the given string conversion behavior with the default.- Parameters:
value
- the input string conversion behavior- Returns:
value
ifvalue != null
, otherwise the string conversion behavior in the defaults
-
-