Package graphql.validation
Class ValidationError
- java.lang.Object
-
- graphql.validation.ValidationError
-
- All Implemented Interfaces:
GraphQLError
,java.io.Serializable
@PublicApi public class ValidationError extends java.lang.Object implements GraphQLError
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ValidationError.Builder
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
description
private com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object>
extensions
private java.util.List<SourceLocation>
locations
private java.util.List<java.lang.String>
queryPath
private ValidationErrorClassification
validationErrorType
-
Constructor Summary
Constructors Modifier Constructor Description private
ValidationError(ValidationError.Builder builder)
ValidationError(ValidationErrorClassification validationErrorType)
Deprecated.ValidationError(ValidationErrorClassification validationErrorType, SourceLocation sourceLocation, java.lang.String description)
Deprecated.ValidationError(ValidationErrorType validationErrorType, SourceLocation sourceLocation, java.lang.String description, java.util.List<java.lang.String> queryPath)
Deprecated.ValidationError(ValidationErrorType validationErrorType, java.util.List<SourceLocation> sourceLocations, java.lang.String description)
Deprecated.ValidationError(ValidationErrorType validationErrorType, java.util.List<SourceLocation> sourceLocations, java.lang.String description, java.util.List<java.lang.String> queryPath)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getDescription()
ErrorType
getErrorType()
java.util.Map<java.lang.String,java.lang.Object>
getExtensions()
java.util.List<SourceLocation>
getLocations()
java.lang.String
getMessage()
java.util.List<java.lang.String>
getQueryPath()
ValidationErrorClassification
getValidationErrorType()
int
hashCode()
static ValidationError.Builder
newValidationError()
java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface graphql.GraphQLError
getPath, toSpecification
-
-
-
-
Field Detail
-
locations
private final java.util.List<SourceLocation> locations
-
description
private final java.lang.String description
-
validationErrorType
private final ValidationErrorClassification validationErrorType
-
queryPath
private final java.util.List<java.lang.String> queryPath
-
extensions
private final com.google.common.collect.ImmutableMap<java.lang.String,java.lang.Object> extensions
-
-
Constructor Detail
-
ValidationError
@Deprecated public ValidationError(ValidationErrorClassification validationErrorType)
Deprecated.
-
ValidationError
@Deprecated public ValidationError(ValidationErrorClassification validationErrorType, SourceLocation sourceLocation, java.lang.String description)
Deprecated.
-
ValidationError
@Deprecated public ValidationError(ValidationErrorType validationErrorType, SourceLocation sourceLocation, java.lang.String description, java.util.List<java.lang.String> queryPath)
Deprecated.
-
ValidationError
@Deprecated public ValidationError(ValidationErrorType validationErrorType, java.util.List<SourceLocation> sourceLocations, java.lang.String description)
Deprecated.
-
ValidationError
@Deprecated public ValidationError(ValidationErrorType validationErrorType, java.util.List<SourceLocation> sourceLocations, java.lang.String description, java.util.List<java.lang.String> queryPath)
Deprecated.
-
ValidationError
private ValidationError(ValidationError.Builder builder)
-
-
Method Detail
-
getValidationErrorType
public ValidationErrorClassification getValidationErrorType()
-
getMessage
public java.lang.String getMessage()
- Specified by:
getMessage
in interfaceGraphQLError
- Returns:
- a description of the error intended for the developer as a guide to understand and correct the error
-
getDescription
public java.lang.String getDescription()
-
getLocations
public java.util.List<SourceLocation> getLocations()
- Specified by:
getLocations
in interfaceGraphQLError
- Returns:
- the location(s) within the GraphQL document at which the error occurred. Each
SourceLocation
describes the beginning of an associated syntax element
-
getErrorType
public ErrorType getErrorType()
- Specified by:
getErrorType
in interfaceGraphQLError
- Returns:
- an object classifying this error
-
getQueryPath
public java.util.List<java.lang.String> getQueryPath()
-
getExtensions
public java.util.Map<java.lang.String,java.lang.Object> getExtensions()
- Specified by:
getExtensions
in interfaceGraphQLError
- Returns:
- a map of error extensions or null if there are none
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
newValidationError
public static ValidationError.Builder newValidationError()
-
-