1 20 21 package org.snmp4j.smi; 22 23 import java.net.InetAddress ; 24 25 30 public class UdpAddress extends TransportIpAddress { 31 32 static final long serialVersionUID = -4390734262648716203L; 33 34 public UdpAddress() { 35 } 36 37 public UdpAddress(InetAddress inetAddress, int port) { 38 setInetAddress(inetAddress); 39 setPort(port); 40 } 41 42 public UdpAddress(int port) { 43 setPort(port); 44 } 45 46 public UdpAddress(String address) { 47 if (!parseAddress(address)) { 48 throw new IllegalArgumentException (address); 49 } 50 } 51 52 public static Address parse(String address) { 53 try { 54 UdpAddress a = new UdpAddress(); 55 if (a.parseAddress(address)) { 56 return a; 57 } 58 } 59 catch (Exception ex) { 60 } 61 return null; 62 } 63 64 } 65 66 | Popular Tags |