Interface RuleKeyFactoryWithDiagnostics<RULE_KEY>

  • All Superinterfaces:
    RuleKeyFactory<RULE_KEY>
    All Known Implementing Classes:
    DefaultRuleKeyFactory

    public interface RuleKeyFactoryWithDiagnostics<RULE_KEY>
    extends RuleKeyFactory<RULE_KEY>
    A rule key factory that provides diagnostic facilities.
    • Method Detail

      • buildForDiagnostics

        <DIAG_KEY> RuleKeyDiagnostics.Result<RULE_KEY,​DIAG_KEY> buildForDiagnostics​(BuildEngineAction action,
                                                                                          RuleKeyHasher<DIAG_KEY> hasher)
        Builds a diagnostic result for the given rule or appendable.

        This method is intended to be used exclusively for diagnostic purposes and not for computing rule keys used for build process in any other way.

        The provided custom hasher is used for all the elements hashed under this rule or appendable.

        Note however that if the factory chooses to hash nested build rules and appendables separately, and only include their final hash for the computation of this hash, this choice applies both to real rule keys and the diagnostic keys. The client may need to perform a separate call for each build rule or appendable of interest. Moreover, the hash for the nested build rules and appendables is obtained by using the default hasher and not the provided custom hasher. This is the natural choice as it allows the custom hasher to see precisely those elements that the default hasher sees. It is also more efficient because factories usually cache rule keys computed with the default hasher, whereas using the custom hasher prevents that and would require hashing all of its transitive dependencies.