/*
 * Copyright 2018-present Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may obtain
 * a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package com.facebook.buck.core.graph.transformation;

import java.util.Set;

/**
 * Interface for transformations with the {@link GraphTransformationEngine}.
 *
 * <p>The transformation is guaranteed the following conditions:
 *
 * <ul>
 *   <li>1. {@link #transform(Object, TransformationEnvironment)} is only called once per key if
 *       caching is enabled.
 *   <li>2. {@link #transform(Object, TransformationEnvironment)} is only called after all keys in
 *       {@link #discoverDeps(Object)} has been computed.
 * </ul>
 *
 * @param <Key> The types of Keys used to query for the result on the graph computation
 * @param <Result> The result of the computation given a specific key
 */
public interface GraphTransformer<Key, Result> {

  /**
   * @param key The Key of the requested result
   * @param env The execution environment containining results of keys from {@link
   *     #discoverDeps(Object)}
   * @return a future of the result requested
   */
  Result transform(Key key, TransformationEnvironment<Key, Result> env) throws Exception;

  /**
   * @param key the current key to transform
   * @return a set of keys that the transformation of the current key depends on
   */
  Set<Key> discoverDeps(Key key) throws Exception;
}

@@ -1289,16 +1289,17 @@
 ific key
+.
 %0A */%0Apub
@@ -1343,32 +1343,191 @@
 esult%3E %7B%0A%0A  /**%0A
+   * Perform a transformation identified by key %7B@link Key%7D into a final type %7B@link Result%7D. This%0A   * transformation should be performed synchronously.%0A   *%0A
    * @param key 
@@ -1609,18 +1609,16 @@
 ontainin
-in
 g result
@@ -1688,40 +1688,40 @@
 urn 
-a future of the result requested
+The result of the transformation
 %0A   
@@ -1816,24 +1816,254 @@
 ion;%0A%0A  /**%0A
+   * Compute dependent keys required to compute given key. The results of those computations will be%0A   * available in %7B@link #transform(Object, TransformationEnvironment)%7D as a part of %7B@link%0A   * TransformationEnvironment%7D%0A   *%0A
    * @param 

Change javadocs for GraphTransformer slightly