net.i2p.router.tunnel.pool

## Class TunnelPeerSelector.HopChainValidator

- java.lang.Object
- - net.i2p.router.tunnel.pool.ExcluderBase
  - - net.i2p.router.tunnel.pool.TunnelPeerSelector.HopChainValidator

- All Implemented Interfaces:
    Iterable<Hash>, Collection<Hash>, Set<Hash>
  Enclosing class:
    TunnelPeerSelector

      protected class TunnelPeerSelector.HopChainValidator
      extends ExcluderBase

  Validates peer-to-peer connectivity in a tunnel hop chain. Excludes peers that cannot connect to the previous hop in the chain. Reduces tunnel build failures due to incompatible peers (e.g., IPv4-only ↔ IPv6-only).

- - ### Field Summary

    - ### Fields inherited from class net.i2p.router.tunnel.pool.ExcluderBase

      `s`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HopChainValidator(List<Hash> selectedHops)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(Object o)` Automatically check if peer is allowed and add the Hash to the set if not.

    - ### Methods inherited from class net.i2p.router.tunnel.pool.ExcluderBase

      `add, addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Set

      `spliterator`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, removeIf, stream`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Constructor Detail

    - #### HopChainValidator

          public HopChainValidator(List<Hash> selectedHops)

  - ### Method Detail

    - #### contains

          public boolean contains(Object o)

      Description copied from class: `ExcluderBase`
      Automatically check if peer is allowed and add the Hash to the set if not.
      Specified by:
        `contains` in interface `Collection<Hash>`
      Specified by:
        `contains` in interface `Set<Hash>`
      Specified by:
        `contains` in class `ExcluderBase`
      Parameters:
        `o` - a Hash
      Returns:
        true if peer should be excluded