Class FieldValueInfo


  • @PublicApi
    public class FieldValueInfo
    extends java.lang.Object
    The FieldValueInfo 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 selection

    The getFieldValueObject() method returns either a materialized value or a CompletableFuture 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 be CompletableFuture promises.

    • 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 a CompletableFuture 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 in CompletableFuture form. If it is already a CompletableFuture it is returned directly, otherwise the materialized value is wrapped in a CompletableFuture and returned
        Returns:
        a CompletableFuture promise to the value
      • getFieldValue

        @Deprecated(since="2023-09-11")
        public java.util.concurrent.CompletableFuture<ExecutionResult> getFieldValue()
        Deprecated.
        Kept for legacy reasons - this method is no longer sensible and is no longer used by the graphql-java engine and is kept only for backwards compatible API reasons.
        Returns:
        a promise to the ExecutionResult that wraps the field value.
      • isFutureValue

        public boolean isFutureValue()
        Returns:
        true if the value is a CompletableFuture promise to a value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object