- All Superinterfaces:
AssignableFromByteArray,AssignableFromString
- All Known Implementing Classes:
DtlsAddress,GenericAddress,IpAddress,SMIAddress,TcpAddress,TlsAddress,TransportIpAddress,UdpAddress
The
Address interface serves as a base class for all SNMP transport addresses.- Version:
- 3.2.0
- Author:
- Frank Fock
-
Method Summary
Modifier and TypeMethodDescriptionGets the protocol family of this address.Gets the socket address of this address.default booleanisTransportCompatible(Class<?> other) Checks if the supplied address class is compatible with this class.booleanisValid()Checks whether thisAddressis a valid transport address.booleanparseAddress(String address) Parses the address from the supplied string representation.voidSets the address value from the supplied String.Methods inherited from interface org.snmp4j.smi.AssignableFromByteArray
setValue, toByteArray
-
Method Details
-
isValid
boolean isValid()Checks whether thisAddressis a valid transport address.- Returns:
trueif the address is valid,falseotherwise.
-
parseAddress
Parses the address from the supplied string representation.- Parameters:
address- a String representation of this address.- Returns:
trueifaddresscould be successfully parsed and has been assigned to this address object,falseotherwise.
-
setValue
Sets the address value from the supplied String. The string must match the format required for the Address instance implementing this interface. Otherwise anIllegalArgumentExceptionruntime exception is thrown.- Specified by:
setValuein interfaceAssignableFromString- Parameters:
address- an address String.- Since:
- 1.7
-
isTransportCompatible
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- theAddressclass to check for compatibility.- Returns:
trueif the provided address class has the same (compatible) on-the-wire characteristics than this address class. By default, this istrueif the provided classotheris the same or a subclass than this class.- Since:
- 3.2.0
-
getFamily
ProtocolFamily getFamily()Gets the protocol family of this address.- Returns:
- a protocol family.
- Since:
- 3.7.0
-
getSocketAddress
SocketAddress getSocketAddress()Gets the socket address of this address.- Returns:
- the socket address representation (if available) of this address or
nullif that does not exist (yet). - Since:
- 3.7.0
-