Package com.facebook.buck.rules.keys
Class AbstractRuleKeyBuilder<RULE_KEY>
- java.lang.Object
-
- com.facebook.buck.rules.keys.AbstractRuleKeyBuilder<RULE_KEY>
-
- Direct Known Subclasses:
RuleKeyBuilder
public abstract class AbstractRuleKeyBuilder<RULE_KEY> extends Object
Base class for rulekey builders. Implements much of the logic of computing keys fromAddToRuleKey
-annotated fields.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRuleKeyBuilder(RuleKeyScopedHasher scopedHasher)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract RULE_KEY
build()
<RESULT> RESULT
build(java.util.function.Function<RULE_KEY,RESULT> mapper)
A convenience method that builds the rule key hash and transforms it with a mapper.protected abstract AbstractRuleKeyBuilder<RULE_KEY>
setAction(Action action)
protected abstract AbstractRuleKeyBuilder<RULE_KEY>
setAddsToRuleKey(AddsToRuleKey appendable)
protected abstract AbstractRuleKeyBuilder<RULE_KEY>
setBuildRule(BuildRule rule)
protected abstract AbstractRuleKeyBuilder<RULE_KEY>
setNonHashingSourcePath(SourcePath sourcePath)
protected AbstractRuleKeyBuilder<RULE_KEY>
setReflectively(Object val)
Recursively serializes the value.AbstractRuleKeyBuilder<RULE_KEY>
setReflectively(String key, Object val)
Adds the key-value pair to the rulekey.AbstractRuleKeyBuilder<RULE_KEY>
setReflectivelyPathKey(Path key, Object val)
Adds the key-value pair to the rulekey.protected abstract AbstractRuleKeyBuilder<RULE_KEY>
setSingleValue(Object val)
protected abstract AbstractRuleKeyBuilder<RULE_KEY>
setSourcePath(SourcePath sourcePath)
-
-
-
Constructor Detail
-
AbstractRuleKeyBuilder
protected AbstractRuleKeyBuilder(RuleKeyScopedHasher scopedHasher)
-
-
Method Detail
-
setReflectively
public final AbstractRuleKeyBuilder<RULE_KEY> setReflectively(String key, @Nullable Object val)
Adds the key-value pair to the rulekey. If the builder skips adding the value, the key will also be skipped.
-
setReflectivelyPathKey
public AbstractRuleKeyBuilder<RULE_KEY> setReflectivelyPathKey(Path key, @Nullable Object val)
Adds the key-value pair to the rulekey. If the builder skips adding the value, the key will also be skipped.
-
setReflectively
protected AbstractRuleKeyBuilder<RULE_KEY> setReflectively(@Nullable Object val) throws IOException
Recursively serializes the value. Serialization of the key is handled outside.- Throws:
IOException
-
setSingleValue
protected abstract AbstractRuleKeyBuilder<RULE_KEY> setSingleValue(@Nullable Object val)
-
setAction
protected abstract AbstractRuleKeyBuilder<RULE_KEY> setAction(Action action)
-
setBuildRule
protected abstract AbstractRuleKeyBuilder<RULE_KEY> setBuildRule(BuildRule rule)
-
setAddsToRuleKey
protected abstract AbstractRuleKeyBuilder<RULE_KEY> setAddsToRuleKey(AddsToRuleKey appendable)
-
setSourcePath
protected abstract AbstractRuleKeyBuilder<RULE_KEY> setSourcePath(SourcePath sourcePath) throws IOException
- Throws:
IOException
-
setNonHashingSourcePath
protected abstract AbstractRuleKeyBuilder<RULE_KEY> setNonHashingSourcePath(SourcePath sourcePath)
-
build
public abstract RULE_KEY build()
-
build
public final <RESULT> RESULT build(java.util.function.Function<RULE_KEY,RESULT> mapper)
A convenience method that builds the rule key hash and transforms it with a mapper.
-
-