-
- All Superinterfaces:
AssignableFromByteArray
,AssignableFromString
- All Known Implementing Classes:
DtlsAddress
,GenericAddress
,IpAddress
,SMIAddress
,TcpAddress
,TlsAddress
,TransportIpAddress
,UdpAddress
public interface Address extends AssignableFromString, AssignableFromByteArray
TheAddress
interface serves as a base class for all SNMP transport addresses.- Version:
- 3.2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
isTransportCompatible(java.lang.Class<?> other)
Checks if the supplied address class is compatible with this class.boolean
isValid()
Checks whether thisAddress
is a valid transport address.boolean
parseAddress(java.lang.String address)
Parses the address from the supplied string representation.void
setValue(java.lang.String address)
Sets the address value from the supplied String.-
Methods inherited from interface org.snmp4j.smi.AssignableFromByteArray
setValue, toByteArray
-
-
-
-
Method Detail
-
isValid
boolean isValid()
Checks whether thisAddress
is a valid transport address.- Returns:
true
if the address is valid,false
otherwise.
-
parseAddress
boolean parseAddress(java.lang.String address)
Parses the address from the supplied string representation.- Parameters:
address
- a String representation of this address.- Returns:
true
ifaddress
could be successfully parsed and has been assigned to this address object,false
otherwise.
-
setValue
void setValue(java.lang.String address)
Sets the address value from the supplied String. The string must match the format required for the Address instance implementing this interface. Otherwise anIllegalArgumentException
runtime exception is thrown.- Specified by:
setValue
in interfaceAssignableFromString
- Parameters:
address
- an address String.- Since:
- 1.7
-
isTransportCompatible
default boolean isTransportCompatible(java.lang.Class<?> other)
Checks if the supplied address class is compatible with this class. For example, secure transport classes like TLS are not compatible with TCP because the latter is not able to provide the required security characteristics.- Parameters:
other
- theAddress
class to check for compatibility.- Returns:
true
if the provided address class has the same (compatible) on-the-wire characteristics than this address class. By default this istrue
if the provided classother
is the same or a sub class than this class.- Since:
- 3.2.0
-
-