Package org.drools.core.facttemplates
Class FactImpl
- java.lang.Object
-
- org.drools.core.facttemplates.FactImpl
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Fact
public class FactImpl extends Object implements Fact, Externalizable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FactImpl()
FactImpl(FactTemplate template, long id)
FactImpl(FactTemplate template, Object[] values, long id)
this is the default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
long
getFactId()
Return the long factIdFactTemplate
getFactTemplate()
Return the deftemplate for the factObject
getFieldValue(int index)
Method returns the value of the given slot at the id.Object
getFieldValue(String name)
int
hashCode()
void
readExternal(ObjectInput in)
protected void
resetId(Fact fact)
this is used to reset the id, in the event an user tries to assert the same fact again, we reset the id to the existing one.void
setFieldValue(int index, Object value)
void
setFieldValue(String name, Object value)
void
writeExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
FactImpl
public FactImpl()
-
FactImpl
public FactImpl(FactTemplate template, Object[] values, long id)
this is the default constructor- Parameters:
instance
-values
-
-
FactImpl
public FactImpl(FactTemplate template, long id)
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
getFieldValue
public Object getFieldValue(int index)
Method returns the value of the given slot at the id.- Specified by:
getFieldValue
in interfaceFact
- Parameters:
id
-- Returns:
-
getFieldValue
public Object getFieldValue(String name)
- Specified by:
getFieldValue
in interfaceFact
-
setFieldValue
public void setFieldValue(String name, Object value)
- Specified by:
setFieldValue
in interfaceFact
-
setFieldValue
public void setFieldValue(int index, Object value)
- Specified by:
setFieldValue
in interfaceFact
-
getFactId
public long getFactId()
Return the long factId
-
resetId
protected void resetId(Fact fact)
this is used to reset the id, in the event an user tries to assert the same fact again, we reset the id to the existing one.- Parameters:
fact
-
-
getFactTemplate
public FactTemplate getFactTemplate()
Return the deftemplate for the fact- Specified by:
getFactTemplate
in interfaceFact
- Returns:
-
-