/** * Constructs a {@link RandomIterator} for numbers between * 0 and the specified range (exclusive). * * @param range the upper bound of the range */ public RandomIterator(long range) { this(new PerpetualIterator<Long>(range)); }
/** * Constructs a {@link RandomIterator} for numbers between * 0 and the specified range (exclusive). * * @param range the upper bound of the range */ public RandomIterator(long range) { this(new PerpetualIterator<Long>(range)); }
/** * 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))); }
/** * Obtains a {@link ClusterPort} for a specified port. * * @param port the port for a {@link ClusterPort} * * @return a {@link ClusterPort} for the specified port */ public static ClusterPort of(int port) { return new ClusterPort(new PerpetualIterator<>(port)); }
/** * Obtains a {@link ClusterPort} for a specified port. * * @param port the port for a {@link ClusterPort} * * @return a {@link ClusterPort} for the specified port */ public static ClusterPort of(int port) { return new ClusterPort(new PerpetualIterator<>(port)); }
/** * Obtains a {@link ClusterPort} for a specified port. * * @param port the port for a {@link ClusterPort} * * @return a {@link ClusterPort} for the specified port */ public static ClusterPort of(int port) { return new ClusterPort(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))); }
/** * Obtains a {@link WellKnownAddress} for a specified address and port. * * @param address the address of the {@link WellKnownAddress} * @param port the port of the {@link WellKnownAddress} * * @return a {@link WellKnownAddress} for the specified address and port */ public static WellKnownAddress of(String address, int port) { return new WellKnownAddress(address, new PerpetualIterator<>(port)); }
/** * Obtains a {@link WellKnownAddress} for a specified address and port. * * @param address the address of the {@link WellKnownAddress} * @param port the port of the {@link WellKnownAddress} * * @return a {@link WellKnownAddress} for the specified address and port */ public static WellKnownAddress of(String address, int port) { return new WellKnownAddress(address, 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))); }
/** * Obtains a {@link WellKnownAddress} for a specified address and port. * * @param address the address of the {@link WellKnownAddress} * @param port the port of the {@link WellKnownAddress} * * @return a {@link WellKnownAddress} for the specified address and port */ public static WellKnownAddress of(String address, int port) { return new WellKnownAddress(address, new PerpetualIterator<>(port)); }
/** * Obtains a {@link LocalHost} for a specified address and port. * * @param address the address of the {@link LocalHost} * @param port the port of the {@link LocalHost} * * @return a {@link LocalHost} for the specified address and port */ public static LocalHost of(String address, int port) { return new LocalHost(address, new PerpetualIterator<>(port)); }
/** * Obtains a {@link LocalHost} for a specified address and port. * * @param address the address of the {@link LocalHost} * @param port the port of the {@link LocalHost} * * @return a {@link LocalHost} for the specified address and port */ public static LocalHost of(String address, int port) { return new LocalHost(address, new PerpetualIterator<>(port)); }
/** * Obtains a {@link LocalHost} for a specified address and port. * * @param address the address of the {@link LocalHost} * @param port the port of the {@link LocalHost} * * @return a {@link LocalHost} for the specified address and port */ public static LocalHost of(String address, int port) { return new LocalHost(address, 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; } }
/** * Obtains a {@link RetryFrequency} representing fixed retry {@link Duration}s. * * @param duration the duration * @param unit the {@link TimeUnit} for the {@link Duration} * * @return a {@link RetryFrequency} */ public static RetryFrequency every(long duration, TimeUnit unit) { return new RetryFrequency(() -> new PerpetualIterator<>(Duration.of(duration, unit))); }
/** * Obtains a {@link RetryFrequency} representing fixed retry {@link Duration}s. * * @param duration the duration * @param unit the {@link TimeUnit} for the {@link Duration} * * @return a {@link RetryFrequency} */ public static RetryFrequency every(long duration, TimeUnit unit) { return new RetryFrequency(() -> new PerpetualIterator<>(Duration.of(duration, unit))); }