Class AbstractRuleSource
java.lang.Object
ch.tocco.nice2.optional.drools.api.util.AbstractRuleSource
- All Implemented Interfaces:
RuleSource
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.optional.drools.api.RuleSource
RuleSource.Type
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractRuleSource
(String id, URI uri, @Nullable RuleSource.Type type, long timestamp) -
Method Summary
Modifier and TypeMethodDescriptionaddContextAttribute
(String name, Object value) <T> T
getContextAttribute
(String name, Class<T> type) getId()
Get an ID for the source.long
Get the timestamp when the source was last changed.@Nullable RuleSource.Type
getType()
Get theRuleSource.Type
of the source.getUri()
Get a URI for the source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.optional.drools.api.RuleSource
getResource
-
Constructor Details
-
AbstractRuleSource
protected AbstractRuleSource(String id, URI uri, @Nullable @Nullable RuleSource.Type type, long timestamp)
-
-
Method Details
-
getId
Description copied from interface:RuleSource
Get an ID for the source.- Specified by:
getId
in interfaceRuleSource
- Returns:
- An ID.
-
getUri
Description copied from interface:RuleSource
Get a URI for the source. This may be the URL it has been loaded from, the URI of an entity/field, or whatever identifies the source.- Specified by:
getUri
in interfaceRuleSource
- Returns:
- A URI for the source.
-
getType
Description copied from interface:RuleSource
Get theRuleSource.Type
of the source.- Specified by:
getType
in interfaceRuleSource
- Returns:
- The
RuleSource.Type
of the source.
-
getTimestamp
public long getTimestamp()Description copied from interface:RuleSource
Get the timestamp when the source was last changed. Used for caching.- Specified by:
getTimestamp
in interfaceRuleSource
- Returns:
- The timestamp of the last change.
-
getContextAttribute
- Specified by:
getContextAttribute
in interfaceRuleSource
-
addContextAttribute
- Specified by:
addContextAttribute
in interfaceRuleSource
-