org.jboss.xnio.channels
Interface ChannelOption<T>

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
PlainChannelOption

public interface ChannelOption<T>
extends java.io.Serializable

An option that may be applied to a channel.


Method Summary
 boolean equals(java.lang.Object other)
          Determine whether this channel option is equal to another.
 java.lang.String getName()
          Get the name of this option.
 java.lang.Class<T> getType()
          Get the concrete type of the value for this option.
 int hashCode()
          The hash code for this option.
 java.lang.String toString()
          Return a human-readable string form of this option.
 T valueOf(java.lang.String string)
          Get the value of the given string as the value type of this channel option, if possible.
 

Method Detail

getName

java.lang.String getName()
Get the name of this option.

Returns:
the name

getType

java.lang.Class<T> getType()
Get the concrete type of the value for this option.

Returns:
the type

equals

boolean equals(java.lang.Object other)
Determine whether this channel option is equal to another. If the argument is not a ChannelOption, false will be returned. Two options are equal when they have the same name and are applicable to the same type.

Overrides:
equals in class java.lang.Object
Parameters:
other - the other channel option
Returns:
true if they are equal

hashCode

int hashCode()
The hash code for this option. It should always be equal to 31 * name.hashCode() + type.hashCode().

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

toString

java.lang.String toString()
Return a human-readable string form of this option.

Overrides:
toString in class java.lang.Object
Returns:
the name of the option

valueOf

T valueOf(java.lang.String string)
          throws java.lang.IllegalArgumentException
Get the value of the given string as the value type of this channel option, if possible.

Parameters:
string - the string representation of the value
Returns:
the value
Throws:
java.lang.IllegalArgumentException - if the value is not valid for this option