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(Class<?> componentType)
Add the specified component type as a root component.
|
LenskitConfigContext |
at(Annotation qualifier,
Class<?> type) |
LenskitConfigContext |
at(Class<?> type) |
LenskitConfigContext |
at(Class<? extends Annotation> qualifier,
Class<?> type) |
<T> LenskitBinding<T> |
bind(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() |
Set<Class<?>> |
getRoots() |
LenskitConfigContext |
matching(ContextPattern pattern) |
LenskitConfigContext |
within(Annotation qualifier,
Class<?> type) |
LenskitConfigContext |
within(Class<?> type) |
LenskitConfigContext |
within(Class<? extends Annotation> qualifier,
Class<?> type) |
addComponent, addComponent, bind, bindAny, in, in, in, set, wrapContext
public 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(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(Class<T> type)
public LenskitConfigContext within(Class<?> type)
public LenskitConfigContext within(Class<? extends Annotation> qualifier, Class<?> type)
public LenskitConfigContext within(Annotation qualifier, Class<?> type)
public LenskitConfigContext matching(ContextPattern pattern)
public LenskitConfigContext at(Class<?> type)
public LenskitConfigContext at(Class<? extends Annotation> qualifier, Class<?> type)
public LenskitConfigContext at(Annotation qualifier, Class<?> type)
public BindingFunctionBuilder getBindings()
@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