public enum ENetworkProtocol extends Enum<ENetworkProtocol> implements com.helger.commons.id.IHasID<String>
| Modifier and Type | Method and Description |
|---|---|
static ENetworkProtocol |
getFromIDOrNull(String sID) |
String |
getID() |
abstract boolean |
isPortAvailable(int nPort)
Determine if the specified port for this type is currently available on
localhost.
|
boolean |
isPortUsed(int nPort)
Determine if the specified port for this type is currently used on
localhost.
|
static ENetworkProtocol |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ENetworkProtocol[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ENetworkProtocol TCP
public static final ENetworkProtocol UDP
public static ENetworkProtocol[] values()
for (ENetworkProtocol c : ENetworkProtocol.values()) System.out.println(c);
public static ENetworkProtocol valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic abstract boolean isPortAvailable(int nPort)
nPort - The port to check. Must be > 0 and < 0xfffftrue if the port is available, false if
not.isPortUsed(int)public boolean isPortUsed(int nPort)
nPort - The port to check. Must be > 0 and < 0xfffftrue if the port is used, false if not.isPortAvailable(int)@Nonnull @Nonempty public String getID()
getID in interface com.helger.commons.id.IHasID<String>@Nullable public static ENetworkProtocol getFromIDOrNull(@Nullable String sID)
Copyright © 2016–2019 Philip Helger. All rights reserved.