Package graphql.schema
Class FieldCoordinates
- java.lang.Object
-
- graphql.schema.FieldCoordinates
-
@PublicApi public class FieldCoordinates extends java.lang.Object
A field in graphql is uniquely located within a parent type and hence code elements likeDataFetcher
need to be specified using those coordinates.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertValidNames()
Checks the validity of the field coordinate names.static FieldCoordinates
coordinates(GraphQLFieldsContainer parentType, GraphQLFieldDefinition fieldDefinition)
Creates new field coordinatesstatic FieldCoordinates
coordinates(GraphQLFieldsContainer parentType, java.lang.String fieldName)
Creates new field coordinatesstatic FieldCoordinates
coordinates(java.lang.String parentType, java.lang.String fieldName)
Creates new field coordinatesboolean
equals(java.lang.Object o)
java.lang.String
getFieldName()
java.lang.String
getTypeName()
int
hashCode()
boolean
isSystemCoordinates()
static FieldCoordinates
systemCoordinates(java.lang.String fieldName)
The exception to the general rule is the system __xxxx Introspection fields which have no parent type and are able to be specified on any typejava.lang.String
toString()
-
-
-
Method Detail
-
getTypeName
public java.lang.String getTypeName()
-
getFieldName
public java.lang.String getFieldName()
-
isSystemCoordinates
public boolean isSystemCoordinates()
-
assertValidNames
public void assertValidNames() throws AssertException
Checks the validity of the field coordinate names. The validity checks vary by coordinate type. Standard coordinates validate both thetypeName
andfieldName
, while system coordinates do not have a parent so they only validate thefieldName
.- Throws:
AssertException
- if the coordinates are NOT valid; otherwise, returns normally.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
coordinates
public static FieldCoordinates coordinates(GraphQLFieldsContainer parentType, GraphQLFieldDefinition fieldDefinition)
Creates new field coordinates- Parameters:
parentType
- the container of the fieldfieldDefinition
- the field definition- Returns:
- new field coordinates represented by the two parameters
-
coordinates
public static FieldCoordinates coordinates(java.lang.String parentType, java.lang.String fieldName)
Creates new field coordinates- Parameters:
parentType
- the container of the fieldfieldName
- the field name- Returns:
- new field coordinates represented by the two parameters
-
coordinates
public static FieldCoordinates coordinates(GraphQLFieldsContainer parentType, java.lang.String fieldName)
Creates new field coordinates- Parameters:
parentType
- the container of the fieldfieldName
- the field name- Returns:
- new field coordinates represented by the two parameters
-
systemCoordinates
public static FieldCoordinates systemCoordinates(java.lang.String fieldName)
The exception to the general rule is the system __xxxx Introspection fields which have no parent type and are able to be specified on any type- Parameters:
fieldName
- the name of the system field which MUST start with __- Returns:
- the coordinates
-
-