Class EntityFact
Entity
.
The backed entity can be queried for values (and related values, like `relA.relB.label`) and can be used to add new `EntityFact`s that are obtained via relation resolving.
The fact carries a map of `state` values. This can be used to add rule results, which is
normally modelled by an java bean property. Since this is a generalized fact, the results
can be arbitary objects. The `states` map defines a key of type EntityFact.Key
which also
carries type information about the value may be associated. The association, however, does
only depend on the name of the key. Thus a key `Key("name1", String.class)` can be used
to override a previously defined mapping from a key `Key("name1", Boolean.class)`. On
getStatus(Key)
the value is only returned, if the type of the given key is assignable
from the type of the value associated to the name of the key.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
@Nullable EntityFact
@Nullable EntityFact
boolean
@Nullable Object
getModel()
<T> Optional
<T> getStatus
(EntityFact.Key<T> key) int
hashCode()
boolean
boolean
@Nullable Object
key()
static <T> EntityFact.Key
<T> static <T> EntityFact.Key
<T> boolean
noStates()
@Nullable PrimaryKey
void
remove
(EntityFact.Key<?> key) <T> void
setStatus
(EntityFact.Key<T> key, T value) void
void
void
<T> void
void
@Nullable Object
Returns a state object for the given key name.toString()
boolean
-
Constructor Details
-
EntityFact
-
-
Method Details
-
toString
-
where
-
field
-
entity
@Nullable public @Nullable EntityFact entity(String relationPath, @Nullable @Nullable String conditions) -
entity
-
resolve
-
getModel
-
key
-
-
getEntity
-
entityState
-
setStatus
-
setStatus
-
setStatus
-
setStatus
-
setStatus
-
setStatus
-
getStatus
-
hasStatus
-
remove
-
clearStates
public void clearStates() -
hasStates
public boolean hasStates() -
noStates
public boolean noStates() -
state
Returns a state object for the given key name. This is meant to be used from within drools rules. Otherwise, thegetStatus(Key)
is preferred. -
equals
-
hashCode
public int hashCode() -
key
-
key
-