Interface Callback<ResultT>

Type Parameters:
ResultT - the result type
All Known Implementing Classes:
MethodCallbackRecord

public interface Callback<ResultT>
Indicates a Callback type. A Callback is a reference to a specific addressable object within an ElementRegistry. This is a method call, expecting a result, from a specific service within an Element.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <NewResultT>
    Callback<NewResultT>
    as(Class<NewResultT> newResultTClass)
    Makes a new Callback which safely returns the requested type.
    call(Object... args)
    Executes the callback against the resolved service.
  • Method Details

    • call

      ResultT call(Object... args)
      Executes the callback against the resolved service.
      Parameters:
      args - the arguments
      Returns:
      the call to make
    • as

      default <NewResultT> Callback<NewResultT> as(Class<NewResultT> newResultTClass)
      Makes a new Callback which safely returns the requested type.
      Type Parameters:
      NewResultT - the new result type
      Parameters:
      newResultTClass - the new result type Class
      Returns:
      the new Callback as the specified type
      Throws:
      SdkException - if there is a missing callback type