Example usage for io.netty.channel.local LocalChannel hasAttr

List of usage examples for io.netty.channel.local LocalChannel hasAttr

Introduction

In this page you can find the example usage for io.netty.channel.local LocalChannel hasAttr.

Prototype

@Override
    public <T> boolean hasAttr(AttributeKey<T> key) 

Source Link

Usage

From source file:com.turo.pushy.apns.AugmentingReflectiveChannelFactoryTest.java

License:Open Source License

@Test
public void testNewChannel() {
    final AttributeKey<String> attributeKey = AttributeKey.valueOf(getClass(), "attributeKey");

    final AugmentingReflectiveChannelFactory<LocalChannel, String> factory = new AugmentingReflectiveChannelFactory<>(
            LocalChannel.class, attributeKey, "Test!");

    final LocalChannel channel = factory.newChannel();

    assertTrue("Newly-created channels should have attribute provided to factory.",
            channel.hasAttr(attributeKey));
}