Interface BuildRuleResolver

    • Method Detail

      • getRuleOptional

        Optional<BuildRule> getRuleOptional​(BuildTarget buildTarget)
        Returns the BuildRule associated with the given BuildTarget if it is already present.
      • getRuleOptionalWithType

        <T> Optional<T> getRuleOptionalWithType​(BuildTarget buildTarget,
                                                Class<T> cls)
        Returns the BuildRule associated with the given BuildTarget if it is already present, casting it to an expected type.
        Throws:
        HumanReadableException - if the BuildRule is not an instance of the given class.
      • getRuleWithType

        <T> T getRuleWithType​(BuildTarget buildTarget,
                              Class<T> cls)
        Returns the BuildRule associated with the buildTarget, casting it to an expected type.
        Throws:
        HumanReadableException - if no rule is associated with the BuildTarget, or if the rule is not an instance of the given class.