graphql.language.DirectivesContainer Maven / Gradle / Ivy
package graphql.language;
import java.util.List;
import java.util.Map;
import static graphql.language.NodeUtil.directivesByName;
/**
* Represents a language node that has a name
*/
public interface DirectivesContainer extends NamedNode {
/**
* @return a list of directives associated with the type or field
*/
List getDirectives();
/**
* @return a a map of directives by directive name
*/
default Map 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);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy