Enum RecPair.Label
- java.lang.Object
-
- java.lang.Enum<RecPair.Label>
-
- com.tibco.patterns.learn.api.project.RecPair.Label
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<RecPair.Label>
- Enclosing class:
- RecPair
public static enum RecPair.Label extends java.lang.Enum<RecPair.Label>
Defines a label that can be assigned to a record pair: True, False or Unsure. Wraps the XML RecPairLabelType enum. Adds methods to determine and convert to boolean labels.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description charasChar()static charasChar(RecPair.Label label)com.tibco.patterns.learn.jaxb.model.RecPairLabelTypeasXmlLabel()static java.util.Set<RecPair.Label>bools()static RecPair.LabelfromBool(boolean value)static RecPair.LabelfromXml(com.tibco.patterns.learn.jaxb.model.RecPairLabelType xmlLabel)booleanisBool()static booleanisBool(com.tibco.patterns.learn.jaxb.model.RecPairLabelType xmlLabel)RecPair.Labelopposite()abstract doublescore()booleantoBool()static RecPair.LabelvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static RecPair.Label[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FALSE
public static final RecPair.Label FALSE
A False label - records do not match.
-
TRUE
public static final RecPair.Label TRUE
A True label - records match.
-
UNSURE
public static final RecPair.Label UNSURE
An Unsure label - user was not sure whether the records match.
-
-
Method Detail
-
values
public static RecPair.Label[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RecPair.Label c : RecPair.Label.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RecPair.Label valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
score
public abstract double score()
- Returns:
- the RLink score that is equivalent to the value of this label.
- Throws:
java.lang.IllegalArgumentException- if label is not TRUE or FALSE.
-
bools
public static java.util.Set<RecPair.Label> bools()
- Returns:
- an unmodifiable set containing FALSE and TRUE labels.
-
asXmlLabel
public com.tibco.patterns.learn.jaxb.model.RecPairLabelType asXmlLabel()
- Returns:
- the XML label equivalent to this label.
-
fromXml
public static RecPair.Label fromXml(com.tibco.patterns.learn.jaxb.model.RecPairLabelType xmlLabel)
- Returns:
- Label corresponding to the given xmlLabel; null if null is passed
-
asChar
public char asChar()
- Returns:
- a character that represents this label.
-
asChar
public static char asChar(RecPair.Label label)
- Returns:
- a character that represents the given label, including null label.
-
isBool
public boolean isBool()
- Returns:
- true if the label is either TRUE or FALSE.
-
toBool
public boolean toBool()
- Throws:
java.lang.IllegalArgumentException- if label is not TRUE or FALSE
-
isBool
public static boolean isBool(com.tibco.patterns.learn.jaxb.model.RecPairLabelType xmlLabel)
- Returns:
- true if xmlLabel is TRUE or FALSE. Return false for UNSURE and null labels.
-
fromBool
public static RecPair.Label fromBool(boolean value)
- Parameters:
value- - a boolean value of the label.- Returns:
- a Label object that corresponds to the boolean value.
-
opposite
public RecPair.Label opposite()
- Returns:
- the opposite label. If this label is not TRUE or FALSE, returns unchanged label.
-
-