public class ValidPort extends Object implements org.apache.kafka.common.config.ConfigDef.Validator
| Modifier and Type | Method and Description |
|---|---|
void |
ensureValid(String setting,
Object value)
Method is used to validate that the supplied port is within the valid range.
|
static ValidPort |
of()
Creates a default instance of the validator in the non privileged port range of 1025 through 65535.
|
static ValidPort |
of(int start,
int end)
Creates a validator in the port range specified.
|
public static ValidPort of()
public static ValidPort of(int start, int end)
start - The low port of the range.end - The high port of the range.IllegalStateException - Throws if the start not a valid port number.IllegalStateException - Throws if the end not a valid port number.IllegalStateException - Throws if the start is greater than end.public void ensureValid(String setting, Object value)
ensureValid in interface org.apache.kafka.common.config.ConfigDef.Validatorsetting - name of the setting being tested.value - value being tested.Copyright © 2016–2017. All rights reserved.