Package org.apache.wiki.workflow
Class Fact
- java.lang.Object
-
- org.apache.wiki.workflow.Fact
-
- All Implemented Interfaces:
java.io.Serializable
public final class Fact extends java.lang.Object implements java.io.Serializable
Represents a contextual artifact, which can be any serializable object, useful for making a Decision. Facts are key-value pairs, where the key is a String (message key) and the value is an arbitrary object. Generally, the supplied object'stoString()method should return a human-readable String. Facts are immutable objects.- Since:
- 2.5
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Fact(java.lang.String messageKey, java.io.Serializable value)Constructs a new Fact with a supplied message key and value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Two Facts are considered equal if their message keys and value objects are equal.java.lang.StringgetMessageKey()Returns this Fact's name, as represented an i18n message key.java.io.SerializablegetValue()Returns this Fact's value.inthashCode()java.lang.StringtoString()Returns a String representation of this Fact.
-
-
-
Constructor Detail
-
Fact
public Fact(java.lang.String messageKey, java.io.Serializable value)
Constructs a new Fact with a supplied message key and value.- Parameters:
messageKey- the "name" of this fact, which should be an i18n message keyvalue- the object to associate with the name
-
-
Method Detail
-
getMessageKey
public java.lang.String getMessageKey()
Returns this Fact's name, as represented an i18n message key.- Returns:
- the message key
-
getValue
public java.io.Serializable getValue()
Returns this Fact's value.- Returns:
- the value object
-
equals
public boolean equals(java.lang.Object obj)
Two Facts are considered equal if their message keys and value objects are equal.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to test- Returns:
trueif logically equal,falseif not
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Returns a String representation of this Fact.- Overrides:
toStringin classjava.lang.Object- Returns:
- the representation
-
-