java.lang.Object
net.i2p.client.impl.LkupResult
All Implemented Interfaces:
LookupResult

public class LkupResultextends Object implements LookupResult
  • Field Details

    • _code

      private final int _code
      Result code from the lookup.
    • _dest

      private final Destination _dest
      The destination found, null if there was none.
    • _nonce

      private final int _nonce
      Nonce echoed back to the requester.
  • Constructor Details

    • LkupResult

      LkupResult(int code, Destination dest)
      Lkup result.
      Parameters:
      code - the LookupResult result code: zero on success, nonzero on failure
      dest - the destination the lookup resolved to, null when it failed
    • LkupResult

      LkupResult(int nonce)
      Holds the deferred result code, carrying only the nonce of the pending reply.
      Parameters:
      nonce - the nonce to carry on the deferred reply
    • LkupResult

      LkupResult(int code, Destination dest, int nonce)
      Full constructor.
      Parameters:
      code - zero for success, nonzero for failure, or RESULT_DEFERRED for a reply still pending
      dest - destination found by the lookup, or null on failure or while deferred
      nonce - the nonce of the reply this result answers
  • Method Details

    • getResultCode

      public int getResultCode()
      Result code of the lookup.
      Specified by:
      getResultCode in interface LookupResult
      Returns:
      zero for success, nonzero for failure
    • getDestination

      public Destination getDestination()
      Destination found by the lookup.
      Specified by:
      getDestination in interface LookupResult
      Returns:
      the destination on success, null on failure
    • getNonce

      public int getNonce()
      For async calls only. Nonce will be non-zero. Callback called later with final result and same nonce.
      Specified by:
      getNonce in interface LookupResult
      Returns:
      the nonzero token supplied to the async lookup and handed back to the callback, for correlating the reply with the request