net.i2p.addressbook

## Class HostChecker.PingResult

- java.lang.Object
- - net.i2p.addressbook.HostChecker.PingResult

- Enclosing class:
    HostChecker

      public static class HostChecker.PingResult
      extends Object

  Ping result data structure containing the outcome of a host reachability test. Immutable - all fields are final.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `String` | `category` the host category from categories.txt, or null
    `String` | `leaseSetTypes` LeaseSet encryption types as a string like "[6,4]", or null
    `boolean` | `reachable` true if the host was reachable via LeaseSet lookup, ping, or HTTP HEAD
    `long` | `responseTime` response time in milliseconds, or -1 if not available
    `long` | `timestamp` timestamp of when this result was recorded (Java time)

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PingResult(boolean reachable, long timestamp, long responseTime)` Create a new PingResult with minimal fields.
    `PingResult(boolean reachable, long timestamp, long responseTime, String category)` Create a new PingResult without LeaseSet types.
    `PingResult(boolean reachable, long timestamp, long responseTime, String category, String leaseSetTypes)` Create a new PingResult with all fields.

  - ### Method Summary

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### category

          public final String category

      the host category from categories.txt, or null

    - #### leaseSetTypes

          public final String leaseSetTypes

      LeaseSet encryption types as a string like "[6,4]", or null

    - #### reachable

          public final boolean reachable

      true if the host was reachable via LeaseSet lookup, ping, or HTTP HEAD

    - #### responseTime

          public final long responseTime

      response time in milliseconds, or -1 if not available

    - #### timestamp

          public final long timestamp

      timestamp of when this result was recorded (Java time)

  - ### Constructor Detail

    - #### PingResult

          public PingResult(boolean reachable,
                            long timestamp,
                            long responseTime)

      Create a new PingResult with minimal fields.

    - #### PingResult

          public PingResult(boolean reachable,
                            long timestamp,
                            long responseTime,
                            String category)

      Create a new PingResult without LeaseSet types.

    - #### PingResult

          public PingResult(boolean reachable,
                            long timestamp,
                            long responseTime,
                            String category,
                            String leaseSetTypes)

      Create a new PingResult with all fields.
      Parameters:
        `reachable` - true if host was reachable
        `timestamp` - time of the test result
        `responseTime` - response time in ms, or -1
        `category` - the host category
        `leaseSetTypes` - the LeaseSet encryption types