/** * Obtains a {@link Capture} based on a provided {@link Iterator}. * * @param iterator the {@link Iterator} * @param <T> the type of the value captured * * @return the {@link Capture} of the {@link Iterator} */ public static <T> Capture<T> of(Iterator<T> iterator) { return new Capture<>(iterator); } }
/** * Obtains a {@link Capture} based on a provided {@link Iterator}. * * @param iterator the {@link Iterator} * @param <T> the type of the value captured * * @return the {@link Capture} of the {@link Iterator} */ public static <T> Capture<T> of(Iterator<T> iterator) { return new Capture<>(iterator); } }
/** * Constructs a local {@link ListenAddress}, choosing a port from the * {@link AvailablePortIterator}. * * @param ports the available ports */ public ListenAddress(AvailablePortIterator ports) { this(ports.getInetAddresses().iterator().next(), new Capture<>(ports)); }
/** * Constructs a local {@link TransportAddress}, choosing a port from the * {@link AvailablePortIterator}. * * @param ports the available ports */ public TransportAddress(AvailablePortIterator ports) { // NOTE: Currently Java Debugging only supports IPv4 on the server-side so we must // filter the AvailablePortIterator addresses into those that are IPv4 this(NetworkHelper.getInetAddresses(ports.getInetAddresses(), NetworkHelper.IPv4_ADDRESS).iterator().next(), new Capture<>(ports)); }
/** * Constructs a local {@link TransportAddress}, choosing a port from the * {@link AvailablePortIterator}. * * @param ports the available ports */ public TransportAddress(AvailablePortIterator ports) { // NOTE: Currently Java Debugging only supports IPv4 on the server-side so we must // filter the AvailablePortIterator addresses into those that are IPv4 this(NetworkHelper.getInetAddresses(ports.getInetAddresses(), NetworkHelper.IPv4_ADDRESS).iterator().next(), new Capture<>(ports)); }
/** * Constructs a {@link ListenAddress} with the specified port. * * @param address the address * @param port the port */ public ListenAddress(InetAddress address, int port) { this(address, new Capture<>(new PerpetualIterator<>(port))); }
/** * Constructs a {@link TransportAddress} with the specified port. * * @param address the address * @param port the port */ public TransportAddress(InetAddress address, int port) { this(address, new Capture<>(new PerpetualIterator<>(port))); }
/** * Constructs a {@link TransportAddress} with the specified port. * * @param address the address * @param port the port */ public TransportAddress(InetAddress address, int port) { this(address, new Capture<>(new PerpetualIterator<>(port))); }
/** * Constructs a local {@link TransportAddress} for the specified port. * * @param port the port */ public TransportAddress(int port) { this(null, new Capture<>(new PerpetualIterator<>(port))); }
/** * Constructs a local {@link TransportAddress} for the specified port. * * @param port the port */ public TransportAddress(int port) { this(null, new Capture<>(new PerpetualIterator<>(port))); }
/** * Constructs a local {@link ListenAddress} for the specified port. * * @param port the port */ public ListenAddress(int port) { this(null, new Capture<>(new PerpetualIterator<>(port))); }
/** * Constructs a {@link ListenAddress} with the specified port. * * @param address the address * @param port the port */ public ListenAddress(InetAddress address, Capture<Integer> port) { if (port == null) { new Capture<>(new PerpetualIterator<>(DEFAULT_PORT)); } else { this.address = address; this.port = port; } }
ports = new Capture<>(LocalPlatform.get().getAvailablePorts());
ports = new Capture<>(LocalPlatform.get().getAvailablePorts());
ports = new Capture<>(LocalPlatform.get().getAvailablePorts());