public Host(DomainName _domainName) { super(); this._domainName = _domainName; this._ipAddress = null; this._value = _domainName.getValue().toString().toCharArray(); }
/** * Return a String representing the value of this union. * * @return String representation of this union's value. */ public String stringValue() { if (_ipAddress != null) { return _ipAddress.stringValue(); } if (_domainName != null) { return _domainName.getValue().toString(); } throw new IllegalStateException("No value assinged"); }
public char[] getValue() { if (_value == null) { if (_ipAddress != null) { _value = _ipAddress.getValue(); } else if (_domainName != null) { _value = _domainName.getValue().toString().toCharArray(); } } return _value == null ? null : _value.clone(); }
private InetSocketAddress getSocketAddress(final Host host, int port) { if(host.getDomainName() != null) { return new InetSocketAddress(host.getDomainName().getValue(), port); } else { final IpAddress ipAddress = host.getIpAddress(); final String ip = ipAddress.getIpv4Address() != null ? ipAddress.getIpv4Address().getValue() : ipAddress.getIpv6Address().getValue(); return new InetSocketAddress(ip, port); } }
private void transformIdentityToRequest( final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ipsec.rev181214.identity.grouping.Identity identityData, final Ikev2ProfileSetId request) { if (identityData instanceof Ipv4Address) { request.idType = 1; request.data = ipv4AddressNoZoneToArray(((Ipv4Address) identityData).getIpv4Address().getValue()); } else if (identityData instanceof FqdnString) { request.idType = 2; request.data = ((FqdnString) identityData).getFqdnString().getValue().getBytes(); } else if (identityData instanceof Rfc822AddressString) { request.idType = 3; request.data = ((Rfc822AddressString) identityData).getRfc822AddressString().getBytes(); } else if (identityData instanceof Ipv6Address) { request.idType = 5; request.data = ipv6AddressNoZoneToArray(((Ipv6Address) identityData).getIpv6Address()); } request.dataLen = request.data.length; }