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
ConstructorsModifierConstructorDescriptionprotectedAbstractRuleSource(String id, URI uri, @Nullable RuleSource.Type type, long timestamp) -
Method Summary
Modifier and TypeMethodDescriptionaddContextAttribute(String name, Object value) <T> TgetContextAttribute(String name, Class<T> type) getId()Get an ID for the source.longGet the timestamp when the source was last changed.@Nullable RuleSource.TypegetType()Get theRuleSource.Typeof 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, waitMethods 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:RuleSourceGet an ID for the source.- Specified by:
getIdin interfaceRuleSource- Returns:
- An ID.
-
getUri
Description copied from interface:RuleSourceGet 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:
getUriin interfaceRuleSource- Returns:
- A URI for the source.
-
getType
Description copied from interface:RuleSourceGet theRuleSource.Typeof the source.- Specified by:
getTypein interfaceRuleSource- Returns:
- The
RuleSource.Typeof the source.
-
getTimestamp
public long getTimestamp()Description copied from interface:RuleSourceGet the timestamp when the source was last changed. Used for caching.- Specified by:
getTimestampin interfaceRuleSource- Returns:
- The timestamp of the last change.
-
getContextAttribute
- Specified by:
getContextAttributein interfaceRuleSource
-
addContextAttribute
- Specified by:
addContextAttributein interfaceRuleSource
-