Java 8 UnsupportedAddressTypeException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 UnsupportedAddressTypeException class.

This code example shows how to use the following methods:
            throw new NullPointerException("unresolvedAddress");
        } 
 
        if (!isSupported(address)) {
            // Address type not supported by the resolver 
            return executor().newFailedFuture(new UnsupportedAddressTypeException());
        } 
 
        if (isResolved(address)) {
            // Resolved already; no need to perform a lookup 
            @SuppressWarnings("unchecked") 
            final T cast = (T) address;
            return executor.newSucceededFuture(cast);
        } 
 
        try { 
            @SuppressWarnings("unchecked") 
            final T cast = (T) address;
            final Promise<T> promise = executor().newPromise();
            doResolve(cast, promise);
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getCause, getLocalizedMessage, getMessage
 
    /** 
     * @tests {@link java.nio.channels.UnsupportedAddressTypeException#UnsupportedAddressTypeException()} 
     */ 
    public void test_Constructor() { 
        UnsupportedAddressTypeException e = new UnsupportedAddressTypeException();
        assertNull(e.getMessage());
        assertNull(e.getLocalizedMessage());
        assertNull(e.getCause());
    } 
 
    /** 
     * @tests serialization/deserialization compatibility. 
     */ 
    @TestTargets({ 
        @TestTargetNew( 
            level = TestLevel.COMPLETE, 
            notes = "Verifies serialization/deserialization compatibility.", 
            method = "!SerializationSelf", 
            args = {} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getCause, getLocalizedMessage, getMessage
     
    /** 
     * @tests {@link java.nio.channels.UnsupportedAddressTypeException#UnsupportedAddressTypeException()} 
     */ 
    public void test_Constructor() { 
        UnsupportedAddressTypeException e = new UnsupportedAddressTypeException();
        assertNull(e.getMessage());
        assertNull(e.getLocalizedMessage());
        assertNull(e.getCause());
    } 
 
    /** 
     * @tests serialization/deserialization compatibility. 
     */ 
    public void testSerializationSelf() throws Exception {
 
        SerializationTest.verifySelf(new UnsupportedAddressTypeException());
    } 
 
    /** 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
 
    if (connectionPending)
      throw new ConnectionPendingException();
 
    if (!(remote instanceof InetSocketAddress))
      throw new UnsupportedAddressTypeException();
 
    connectAddress = (InetSocketAddress) remote;
 
    if (connectAddress.isUnresolved())
      throw new UnresolvedAddressException();
 
    connected = channel.connect(connectAddress, timeout);
    connectionPending = !connected;
    return connected;
  } 
 
  public boolean finishConnect() 
    throws IOException 
  { 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    static InetSocketAddress validateAddress(SocketAddress socketAddress) {
        if (null == socketAddress) {
            throw new IllegalArgumentException();
        } 
        if (!(socketAddress instanceof InetSocketAddress)) {
            throw new UnsupportedAddressTypeException();
        } 
        InetSocketAddress inetSocketAddress = (InetSocketAddress) socketAddress;
        if (inetSocketAddress.isUnresolved()) {
            throw new UnresolvedAddressException();
        } 
        return inetSocketAddress;
    } 
 
    /* 
     * Get local address. 
     */ 
    public InetAddress getLocalAddress() throws UnknownHostException {
        if (!isBound) {
            byte[] any_bytes = { 0, 0, 0, 0 };
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    static InetSocketAddress validateAddress(SocketAddress socketAddress) {
        if (null == socketAddress) {
            throw new IllegalArgumentException();
        } 
        if (!(socketAddress instanceof InetSocketAddress)) {
            throw new UnsupportedAddressTypeException();
        } 
        InetSocketAddress inetSocketAddress = (InetSocketAddress) socketAddress;
        if (inetSocketAddress.isUnresolved()) {
            throw new UnresolvedAddressException();
        } 
        return inetSocketAddress;
    } 
 
    /* 
     * Get local address. 
     */ 
    public InetAddress getLocalAddress() throws UnknownHostException {
        byte[] any_bytes = { 0, 0, 0, 0 };
        if (!isBound) {
2
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 UnsupportedAddressTypeException Methods: