public class AlgorithmInstanceBuilder extends Object implements org.apache.commons.lang3.builder.Builder<AlgorithmInstance>
Builder for algorithm instances.
Constructor and Description |
---|
AlgorithmInstanceBuilder()
Construct a new algorithm instance builder.
|
AlgorithmInstanceBuilder(String name)
Construct a new algorithm instance builder with a name.
|
Modifier and Type | Method and Description |
---|---|
AlgorithmInstance |
build() |
AlgorithmInstanceBuilder |
extend()
Create a new builder that inherits from this builder.
|
Map<String,Object> |
getAllAttributes()
Get all attributes of this algorithm instance.
|
Map<String,Object> |
getAttributes()
Get the attributes of this algorithm instance.
|
LenskitConfiguration |
getConfig()
Get the LensKit configuration.
|
List<LenskitConfiguration> |
getConfigurations()
Get the list of configurations that comprise this instance.
|
String |
getName()
Get the algorithm name.
|
AlgorithmInstanceBuilder |
setAttribute(String attr,
Object value)
Set an attribute for this algorithm instance.
|
AlgorithmInstanceBuilder |
setConfig(LenskitConfiguration cfg)
Set the LensKit configuration to use.
|
AlgorithmInstanceBuilder |
setName(String n)
Set the algorithm name.
|
public AlgorithmInstanceBuilder()
Construct a new algorithm instance builder.
public AlgorithmInstanceBuilder(String name)
Construct a new algorithm instance builder with a name.
name
- The algorithm name.public AlgorithmInstanceBuilder setName(String n)
Set the algorithm name.
n
- The name for this algorithm instance.public String getName()
Get the algorithm name.
public AlgorithmInstanceBuilder setAttribute(@Nonnull String attr, @Nonnull Object value)
Set an attribute for this algorithm instance. Used for distinguishing similar instances in an algorithm family.
attr
- The attribute name.value
- The attribute value.public Map<String,Object> getAttributes()
Get the attributes of this algorithm instance.
public Map<String,Object> getAllAttributes()
Get all attributes of this algorithm instance.
public LenskitConfiguration getConfig()
Get the LensKit configuration.
public AlgorithmInstanceBuilder setConfig(LenskitConfiguration cfg)
Set the LensKit configuration to use.
cfg
- The configuration to use. This will override any non-inherited configuration.public List<LenskitConfiguration> getConfigurations()
Get the list of configurations that comprise this instance.
public AlgorithmInstanceBuilder extend()
Create a new builder that inherits from this builder. Changes to the returned builder will not affect this builder, but subsequent changes to this builder will affect the inherited builder.
public AlgorithmInstance build()
build
in interface org.apache.commons.lang3.builder.Builder<AlgorithmInstance>