org.apache.wiki.workflow
Class Fact

java.lang.Object
  extended by org.apache.wiki.workflow.Fact
All Implemented Interfaces:
Serializable

public final class Fact
extends Object
implements 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's toString() method should return a human-readable String. Facts are immutable objects.

Since:
2.5
See Also:
Serialized Form

Constructor Summary
Fact(String messageKey, Serializable value)
          Constructs a new Fact with a supplied message key and value.
 
Method Summary
 boolean equals(Object obj)
          Two Facts are considered equal if their message keys and value objects are equal.
 String getMessageKey()
          Returns this Fact's name, as represented an i18n message key.
 Serializable getValue()
          Returns this Fact's value.
 int hashCode()
          
 String toString()
          Returns a String representation of this Fact.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Fact

public Fact(String messageKey,
            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 key
value - the object to associate with the name
Method Detail

getMessageKey

public String getMessageKey()
Returns this Fact's name, as represented an i18n message key.

Returns:
the message key

getValue

public Serializable getValue()
Returns this Fact's value.

Returns:
the value object

equals

public boolean equals(Object obj)
Two Facts are considered equal if their message keys and value objects are equal.

Overrides:
equals in class Object
Parameters:
obj - the object to test
Returns:
true if logically equal, false if not

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()
Returns a String representation of this Fact.

Overrides:
toString in class Object
Returns:
the representation


Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.