public class AlgorithmInstanceBuilder extends java.lang.Object implements org.apache.commons.lang3.builder.Builder<AlgorithmInstance>
Builder for algorithm instances.
Constructor and Description |
---|
AlgorithmInstanceBuilder()
Construct a new algorithm instance builder.
|
AlgorithmInstanceBuilder(java.lang.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.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAllAttributes()
Get all attributes of this algorithm instance.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Get the attributes of this algorithm instance.
|
LenskitConfiguration |
getConfig()
Get the LensKit configuration.
|
java.util.List<LenskitConfiguration> |
getConfigurations()
Get the list of configurations that comprise this instance.
|
java.lang.String |
getName()
Get the algorithm name.
|
AlgorithmInstanceBuilder |
setAttribute(java.lang.String attr,
java.lang.Object value)
Set an attribute for this algorithm instance.
|
AlgorithmInstanceBuilder |
setConfig(LenskitConfiguration cfg)
Set the LensKit configuration to use.
|
AlgorithmInstanceBuilder |
setName(java.lang.String n)
Set the algorithm name.
|
public AlgorithmInstanceBuilder()
Construct a new algorithm instance builder.
public AlgorithmInstanceBuilder(java.lang.String name)
Construct a new algorithm instance builder with a name.
name
- The algorithm name.public AlgorithmInstanceBuilder setName(java.lang.String n)
Set the algorithm name.
n
- The name for this algorithm instance.public java.lang.String getName()
Get the algorithm name.
public AlgorithmInstanceBuilder setAttribute(@Nonnull java.lang.String attr, @Nonnull java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Get the attributes of this algorithm instance.
public java.util.Map<java.lang.String,java.lang.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 java.util.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>