public class LenskitConfiguration extends AbstractConfigContext
A LensKit algorithm configuration. Once you have a configuration, you can pass it to LenskitRecommenderEngine.build(LenskitConfiguration) to build a recommender engine, or LenskitRecommender.build(LenskitConfiguration) to skip the engine and just build a recommender.
| Constructor and Description |
|---|
LenskitConfiguration()
Create a new LensKit configuration.
|
LenskitConfiguration(LenskitConfiguration other)
Create a new copy of a LensKit configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRoot(java.lang.Class<?> componentType)
Add the specified component type as a root component.
|
LenskitConfigContext |
at(java.lang.annotation.Annotation qualifier,
java.lang.Class<?> type) |
LenskitConfigContext |
at(java.lang.Class<?> type) |
LenskitConfigContext |
at(java.lang.Class<? extends java.lang.annotation.Annotation> qualifier,
java.lang.Class<?> type) |
<T> LenskitBinding<T> |
bind(java.lang.Class<T> type) |
DAGNode<Component,Dependency> |
buildGraph()
Deprecated.
This shouldn’t be used anymore.
|
void |
clearRoots()
Clear the set of roots, removing all configured and default roots.
|
LenskitConfiguration |
copy()
Convenience method to copy a LensKit configuration.
|
BindingFunctionBuilder |
getBindings() |
java.util.Set<java.lang.Class<?>> |
getRoots() |
LenskitConfigContext |
matching(ContextPattern pattern) |
LenskitConfigContext |
within(java.lang.annotation.Annotation qualifier,
java.lang.Class<?> type) |
LenskitConfigContext |
within(java.lang.Class<?> type) |
LenskitConfigContext |
within(java.lang.Class<? extends java.lang.annotation.Annotation> qualifier,
java.lang.Class<?> type) |
addComponent, addComponent, bind, bindAny, in, in, in, set, wrapContextpublic LenskitConfiguration()
Create a new LensKit configuration.
public LenskitConfiguration(LenskitConfiguration other)
Create a new copy of a LensKit configuration.
other - The configuration to copy.public LenskitConfiguration copy()
Convenience method to copy a LensKit configuration.
public void addRoot(java.lang.Class<?> componentType)
Add the specified component type as a root component. This forces it (and its dependencies) to be resolved, and makes it available from the resulting recommenders.
componentType - The type of component to add as a root (typically an interface).LenskitRecommender.get(Class)public void clearRoots()
Clear the set of roots, removing all configured and default roots. This is almost never desired in production, but is useful for testing.
public <T> LenskitBinding<T> bind(java.lang.Class<T> type)
public LenskitConfigContext within(java.lang.Class<?> type)
public LenskitConfigContext within(java.lang.Class<? extends java.lang.annotation.Annotation> qualifier, java.lang.Class<?> type)
public LenskitConfigContext within(java.lang.annotation.Annotation qualifier, java.lang.Class<?> type)
public LenskitConfigContext matching(ContextPattern pattern)
public LenskitConfigContext at(java.lang.Class<?> type)
public LenskitConfigContext at(java.lang.Class<? extends java.lang.annotation.Annotation> qualifier, java.lang.Class<?> type)
public LenskitConfigContext at(java.lang.annotation.Annotation qualifier, java.lang.Class<?> type)
public BindingFunctionBuilder getBindings()
public java.util.Set<java.lang.Class<?>> getRoots()
@Deprecated public DAGNode<Component,Dependency> buildGraph() throws RecommenderConfigurationException
Get a mockup of the full recommender graph. This fully resolves the graph so that it can be analyzed, but does not create any objects.
RecommenderConfigurationException