package graphql.language;


import graphql.PublicApi;

import java.util.List;
import java.util.Map;

import static graphql.language.NodeUtil.directivesByName;

/**
 * Represents a language node that has a name
 */
@PublicApi
public interface DirectivesContainer<T extends DirectivesContainer> extends NamedNode<T> {

    /**
     * @return a list of directives associated with the type or field
     */
    List<Directive> getDirectives();

    /**
     * @return a a map of directives by directive name
     */
    default Map<String, Directive> getDirectivesByName() {
        return directivesByName(getDirectives());
    }

    /**
     * Returns a named directive
     *
     * @param directiveName the name of the directive to retrieve
     *
     * @return the directive or null if there is one one with that name
     */
    default Directive getDirective(String directiveName) {
        return getDirectivesByName().get(directiveName);
    }
}

@@ -196,18 +196,31 @@
 hat 
-has a name
+can contain Directives.
 %0A */
@@ -389,23 +389,15 @@
 h th
-e type or field
+is Node
 %0A   
@@ -655,14 +655,8 @@
 s a 
-named 
 dire
@@ -660,16 +660,39 @@
 irective
+ with the provided name
 %0A     *%0A

fix javadoc