001package org.hl7.fhir.utilities.graphql; 002 003import java.util.ArrayList; 004import java.util.List; 005 006public class Field { 007 private String name; 008 private List<Selection> selectionSet = new ArrayList<Selection>(); 009 private String alias; 010 private List<Argument> arguments = new ArrayList<Argument>(); 011 private List<Directive> directives = new ArrayList<Directive>(); 012 013 public String getName() { 014 return name; 015 } 016 017 018 public void setName(String name) { 019 this.name = name; 020 } 021 022 023 public String getAlias() { 024 return alias; 025 } 026 027 028 public void setAlias(String alias) { 029 this.alias = alias; 030 } 031 032 033 public List<Selection> getSelectionSet() { 034 return selectionSet; 035 } 036 037 038 public List<Argument> getArguments() { 039 return arguments; 040 } 041 042 043 public List<Directive> getDirectives() { 044 return directives; 045 } 046 047 048 public Argument argument(String name) { 049 for (Argument p : arguments) { 050 if (p.name.equals(name)) 051 return p; 052 } 053 return null; 054 } 055 056 057 public boolean hasDirective(String name) { 058 for (Directive d : directives) 059 if (d.getName().equals(name)) 060 return true; 061 return false; 062 } 063 064 public Directive directive(String name) { 065 for (Directive d : directives) 066 if (d.getName().equals(name)) 067 return d; 068 return null; 069 } 070}