Class NumAPICallbacksDefaultHandler

java.lang.Object
uk.num.numlib.api.NumAPICallbacksDefaultHandler
All Implemented Interfaces:
NumAPICallbacks

public class NumAPICallbacksDefaultHandler
extends java.lang.Object
implements NumAPICallbacks
A default no-op implementation of the NumAPICallbacks.
  • Constructor Details

  • Method Details

    • setResult

      public void setResult​(java.lang.String result)
      Called when the query result is available.

      Note: This may be called multiple times if the result if from the NUM scraping service, because more detailed records might become available after the initial quick response.

      Clients should provide their own implementation of this method to receive those additional responses.

      Specified by:
      setResult in interface NumAPICallbacks
      Parameters:
      result - the lookup result JSON String
    • setErrorResult

      public void setErrorResult​(java.lang.String error)
      Called if an error occurs while retrieving or processing the NUM recocrd.
      Specified by:
      setErrorResult in interface NumAPICallbacks
      Parameters:
      error - The error String.
    • receivedFrom

      public NumAPICallbacks.Location receivedFrom()
      The type of location the NUM record was received from.
      Specified by:
      receivedFrom in interface NumAPICallbacks
      Returns:
      Location::INDEPENDENT, Location::HOSTED, Location::POPULATED