- java.lang.Object
-
- com.pervasive.datarush.encoding.text.TruthValues
-
- com.pervasive.datarush.encoding.text.InsensitiveTruthMapping
-
public class InsensitiveTruthMapping extends TruthValues
A one-to-one mapping of strings to boolean values which does case-insensitive comparisons.
-
-
Field Summary
-
Fields inherited from class com.pervasive.datarush.encoding.text.TruthValues
falsity, truth
-
-
Constructor Summary
Constructors Constructor Description InsensitiveTruthMapping(String truth, String falsity)
Creates a new case-insensitive mapping with the given values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
falseValue()
Gets the string value forfalse
.boolean
isFalse(String text)
Indicates whether the given string is a representation forfalse
.boolean
isTrue(String text)
Indicates whether the given string is a representation fortrue
.String
trueValue()
Gets the string value fortrue
.
-
-
-
Constructor Detail
-
InsensitiveTruthMapping
public InsensitiveTruthMapping(String truth, String falsity)
Creates a new case-insensitive mapping with the given values. The case of the canonical string representations is preserved when formatting.- Parameters:
truth
- the string representation oftrue
falsity
- the string representation offalse
-
-
Method Detail
-
falseValue
public String falseValue()
Description copied from class:TruthValues
Gets the string value forfalse
.- Overrides:
falseValue
in classTruthValues
- Returns:
- the canonical string representation of
false
.
-
trueValue
public String trueValue()
Description copied from class:TruthValues
Gets the string value fortrue
.- Overrides:
trueValue
in classTruthValues
- Returns:
- the canonical string representation of
true
.
-
isTrue
public boolean isTrue(String text)
Description copied from class:TruthValues
Indicates whether the given string is a representation fortrue
.- Specified by:
isTrue
in classTruthValues
- Parameters:
text
- the string to check- Returns:
true
if the string represents truth
-
isFalse
public boolean isFalse(String text)
Description copied from class:TruthValues
Indicates whether the given string is a representation forfalse
.- Specified by:
isFalse
in classTruthValues
- Parameters:
text
- the string to check- Returns:
true
if the string represents falsity
-
-