- 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 StringfalseValue()Gets the string value forfalse.booleanisFalse(String text)Indicates whether the given string is a representation forfalse.booleanisTrue(String text)Indicates whether the given string is a representation fortrue.StringtrueValue()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 oftruefalsity- the string representation offalse
-
-
Method Detail
-
falseValue
public String falseValue()
Description copied from class:TruthValuesGets the string value forfalse.- Overrides:
falseValuein classTruthValues- Returns:
- the canonical string representation of
false.
-
trueValue
public String trueValue()
Description copied from class:TruthValuesGets the string value fortrue.- Overrides:
trueValuein classTruthValues- Returns:
- the canonical string representation of
true.
-
isTrue
public boolean isTrue(String text)
Description copied from class:TruthValuesIndicates whether the given string is a representation fortrue.- Specified by:
isTruein classTruthValues- Parameters:
text- the string to check- Returns:
trueif the string represents truth
-
isFalse
public boolean isFalse(String text)
Description copied from class:TruthValuesIndicates whether the given string is a representation forfalse.- Specified by:
isFalsein classTruthValues- Parameters:
text- the string to check- Returns:
trueif the string represents falsity
-
-