Class FunctionResultMetadata<UsageType>

  • Type Parameters:
    UsageType - The result type of the function invocation.

    public class FunctionResultMetadata<UsageType>
    extends Object
    Metadata about the result of a function invocation.

    This class is used to return metadata about the result of a function invocation.

    • Constructor Detail

      • FunctionResultMetadata

        public FunctionResultMetadata()
        Create a new instance of FunctionResultMetadata.
      • FunctionResultMetadata

        public FunctionResultMetadata​(CaseInsensitiveMap<ContextVariable<?>> metadata)
        Create a new instance of FunctionResultMetadata.
        Parameters:
        metadata - Metadata about the result of the function invocation.
    • Method Detail

      • build

        public static FunctionResultMetadata<?> build​(String id)
        Create a new instance of FunctionResultMetadata.
        Parameters:
        id - The id of the result of the function invocation.
        Returns:
        A new instance of FunctionResultMetadata.
      • build

        public static <UsageType> FunctionResultMetadata<UsageType> build​(String id,
                                                                          @Nullable
                                                                          UsageType usage,
                                                                          @Nullable
                                                                          OffsetDateTime createdAt)
        Create a new instance of FunctionResultMetadata.
        Type Parameters:
        UsageType - The result type of the function invocation.
        Parameters:
        id - The id of the result of the function invocation.
        usage - The usage of the result of the function invocation.
        createdAt - The time the result was created.
        Returns:
        A new instance of FunctionResultMetadata.
      • empty

        public static FunctionResultMetadata<?> empty()
        Create a new instance of FunctionResultMetadata with no metadata.
        Returns:
        A new instance of FunctionResultMetadata.
      • getMetadata

        public CaseInsensitiveMap<ContextVariable<?>> getMetadata()
        Get the metadata about the result of the function invocation.
        Returns:
        The metadata about the result of the function invocation.
      • getId

        @Nullable
        public String getId()
        Get the id of the result of the function invocation.
        Returns:
        The id of the result of the function invocation.
      • getUsage

        @Nullable
        public UsageType getUsage()
        Get the usage of the result of the function invocation.
        Returns:
        The usage of the result of the function invocation.
      • getCreatedAt

        @Nullable
        public OffsetDateTime getCreatedAt()
        Get the time the result was created.
        Returns:
        The time the result was created.