Interface HostMapper<T>

All Known Implementing Classes:
RingMemberHostMapper
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface HostMapper<T>
An interface used by CqlTemplate for mapping Nodes of metadata on a per-item basis.. Implementations of this interface perform the actual work of mapping each host to a result object, but don't need to worry about exception handling. DriverException will be caught and handled by the calling CqlTemplate.
Author:
Matthew T. Adams, Mark Paluch
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    mapHosts(Iterable<com.datastax.oss.driver.api.core.metadata.Node> hosts)
    Implementations must implement this method to map each Node.
  • Method Details

    • mapHosts

      Collection<T> mapHosts(Iterable<com.datastax.oss.driver.api.core.metadata.Node> hosts) throws com.datastax.oss.driver.api.core.DriverException
      Implementations must implement this method to map each Node.
      Parameters:
      hosts - the Iterable of Nodes to map, must not be null.
      Returns:
      the result objects for the given hosts.
      Throws:
      com.datastax.oss.driver.api.core.DriverException - if a DriverException is encountered mapping values (that is, there's no need to catch DriverException).