Package graphql.execution
Class FieldValueInfo
- java.lang.Object
-
- graphql.execution.FieldValueInfo
-
@PublicApi public class FieldValueInfo extends java.lang.Object
TheFieldValueInfo
holds the type of field that was fetched and completed along with the completed value.A field value is considered when its is both fetch via a
DataFetcher
to a raw value, and then it is serialized into scalar or enum or if it's an object type, it is completed as an object given its field sub selectionThe
getFieldValueObject()
method returns either a materialized value or aCompletableFuture
promise to a materialized value. Simple in-memory values will tend to be materialized, while complicated values might need a call to a database or other systems will tend to beCompletableFuture
promises.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldValueInfo.CompleteValueType
-
Constructor Summary
Constructors Constructor Description FieldValueInfo(FieldValueInfo.CompleteValueType completeValueType, java.lang.Object fieldValueObject)
FieldValueInfo(FieldValueInfo.CompleteValueType completeValueType, java.lang.Object fieldValueObject, java.util.List<FieldValueInfo> fieldValueInfos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldValueInfo.CompleteValueType
getCompleteValueType()
This is an enum that represents the type of field value that was completed for a fieldjava.util.concurrent.CompletableFuture<java.lang.Object>
getFieldValueFuture()
This returns the value inCompletableFuture
form.java.util.List<FieldValueInfo>
getFieldValueInfos()
When thegetCompleteValueType()
isFieldValueInfo.CompleteValueType.LIST
this holds the list of completed values inside that list object.java.lang.Object
getFieldValueObject()
This value can be either an object that is materialized or aCompletableFuture
promise to a valueboolean
isFutureValue()
java.lang.String
toString()
-
-
-
Constructor Detail
-
FieldValueInfo
public FieldValueInfo(FieldValueInfo.CompleteValueType completeValueType, java.lang.Object fieldValueObject)
-
FieldValueInfo
public FieldValueInfo(FieldValueInfo.CompleteValueType completeValueType, java.lang.Object fieldValueObject, java.util.List<FieldValueInfo> fieldValueInfos)
-
-
Method Detail
-
getCompleteValueType
public FieldValueInfo.CompleteValueType getCompleteValueType()
This is an enum that represents the type of field value that was completed for a field- Returns:
- the type of field value
-
getFieldValueObject
public java.lang.Object getFieldValueObject()
This value can be either an object that is materialized or aCompletableFuture
promise to a value- Returns:
- either an object that is materialized or a
CompletableFuture
promise to a value
-
getFieldValueFuture
public java.util.concurrent.CompletableFuture<java.lang.Object> getFieldValueFuture()
This returns the value inCompletableFuture
form. If it is already aCompletableFuture
it is returned directly, otherwise the materialized value is wrapped in aCompletableFuture
and returned- Returns:
- a
CompletableFuture
promise to the value
-
isFutureValue
public boolean isFutureValue()
- Returns:
- true if the value is a
CompletableFuture
promise to a value
-
getFieldValueInfos
public java.util.List<FieldValueInfo> getFieldValueInfos()
When thegetCompleteValueType()
isFieldValueInfo.CompleteValueType.LIST
this holds the list of completed values inside that list object.- Returns:
- the list of completed field values inside a list
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-