Package com.facebook.buck.rules.keys
Class DefaultRuleKeyScopedHasher<HASH>
- java.lang.Object
-
- com.facebook.buck.rules.keys.DefaultRuleKeyScopedHasher<HASH>
-
- All Implemented Interfaces:
RuleKeyScopedHasher
public class DefaultRuleKeyScopedHasher<HASH> extends Object implements RuleKeyScopedHasher
A wrapper ofRuleKeyHasher
that provides scoped hashing facilities.Important: Container, wrapper and key signatures only get hashed if their scope was non-empty. I.e. if at least one thing gets hashed under their scope. This is to support rule key builders that ignore some fields.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultRuleKeyScopedHasher.DefaultContainerScope
-
Nested classes/interfaces inherited from interface com.facebook.buck.rules.keys.RuleKeyScopedHasher
RuleKeyScopedHasher.ContainerScope
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RuleKeyScopedHasher.ContainerScope
containerScope(RuleKeyHasher.Container container)
Hashes the container iff non-empty (i.e.CountingRuleKeyHasher<HASH>
getHasher()
Scope
keyScope(String key)
Hashes the key iff non-empty (i.e.Scope
pathKeyScope(Path key)
Hashes the key iff non-empty (i.e.Scope
wrapperScope(RuleKeyHasher.Wrapper wrapper)
Hashes the wrapper iff non-empty (i.e.
-
-
-
Method Detail
-
getHasher
public CountingRuleKeyHasher<HASH> getHasher()
-
keyScope
public Scope keyScope(String key)
Hashes the key iff non-empty (i.e. if anything gets hashed during its scope).- Specified by:
keyScope
in interfaceRuleKeyScopedHasher
-
pathKeyScope
public Scope pathKeyScope(Path key)
Hashes the key iff non-empty (i.e. if anything gets hashed during its scope).- Specified by:
pathKeyScope
in interfaceRuleKeyScopedHasher
-
wrapperScope
public Scope wrapperScope(RuleKeyHasher.Wrapper wrapper)
Hashes the wrapper iff non-empty (i.e. if any element gets hashed during its scope).- Specified by:
wrapperScope
in interfaceRuleKeyScopedHasher
-
containerScope
public RuleKeyScopedHasher.ContainerScope containerScope(RuleKeyHasher.Container container)
Hashes the container iff non-empty (i.e. if any element gets hashed during its scope).Note that an element scope needs to be created for each element!
- Specified by:
containerScope
in interfaceRuleKeyScopedHasher
-
-