@NotThreadSafe @ProviderType public class Channel extends java.lang.Object
Constructor and Description |
---|
Channel(java.lang.String name,
ChannelType type,
DataType valueType,
java.util.Map<java.lang.String,java.lang.Object> config)
Instantiates a new channel.
|
Modifier and Type | Method and Description |
---|---|
ChannelRecord |
createReadRecord()
Creates a new
ChannelRecord that represents a read request
for the value of this Channel . |
ChannelRecord |
createWriteRecord(TypedValue<?> value)
Creates a new
ChannelRecord that represents a write request for this
Channel . |
boolean |
equals(java.lang.Object obj) |
java.util.Map<java.lang.String,java.lang.Object> |
getConfiguration()
Gets the configuration of the communication channel.
|
java.lang.String |
getName()
Gets the name of the communication channel.
|
ChannelType |
getType()
Gets the type of the communication channel.
|
DataType |
getValueType()
Gets the value type as expected for operations.
|
int |
hashCode() |
void |
setName(java.lang.String name)
Sets the name.
|
void |
setType(ChannelType type)
Sets the type.
|
void |
setValueType(DataType valueType)
Sets the value type.
|
java.lang.String |
toString() |
public Channel(java.lang.String name, ChannelType type, DataType valueType, java.util.Map<java.lang.String,java.lang.Object> config)
name
- the name for this channeltype
- the typevalueType
- the value typeconfig
- the configurationjava.lang.NullPointerException
- if any of the arguments is nullpublic java.util.Map<java.lang.String,java.lang.Object> getConfiguration()
public java.lang.String getName()
public ChannelType getType()
public DataType getValueType()
public void setName(java.lang.String name)
name
- the new namejava.lang.NullPointerException
- if the argument is nullpublic void setType(ChannelType type)
type
- the new typejava.lang.NullPointerException
- if the argument is nullpublic void setValueType(DataType valueType)
valueType
- the new value typejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String toString()
toString
in class java.lang.Object
public ChannelRecord createReadRecord()
ChannelRecord
that represents a read request
for the value of this Channel
.ChannelRecord
public ChannelRecord createWriteRecord(TypedValue<?> value)
ChannelRecord
that represents a write request for this
Channel
.vlaue
- The value to be written.CheannelRecord
java.lang.IllegalArgumentException
- If the DataType
of the provided value differs from the data type
of this channeljava.lang.NullPointerException
- If the provided value is nullpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object