@ProviderType @NotThreadSafe public class ChannelRecord extends java.lang.Object
createReadRecord(String, DataType)
or Channel.createReadRecord()
methods.
createWriteRecord(String, TypedValue)
or Channel.createWriteRecord(TypedValue)
methods.
ChannelStatus
instance.
The status contains a flag, an exception message and an exception
instance.
A channel record suitable for this use case can be created using the
createStatusRecord(String, ChannelStatus)
method.
Map<String, Object>
instance.
This configuration can be used to provide additional information concerning the
operation to be performed.Modifier and Type | Method and Description |
---|---|
static ChannelRecord |
createReadRecord(java.lang.String channelName,
DataType valueType)
Creates a channel record that represents a read request.
|
static ChannelRecord |
createStatusRecord(java.lang.String channelName,
ChannelStatus status)
Creates a channel record that describes the status of an operation.
|
static ChannelRecord |
createWriteRecord(java.lang.String channelName,
TypedValue<?> value)
Creates a channel record that represents a write request.
|
boolean |
equals(java.lang.Object obj) |
java.util.Map<java.lang.String,java.lang.Object> |
getChannelConfig()
Returns the channel configuration as provided.
|
java.lang.String |
getChannelName()
Returns the name of the channel associated to the operation represented by this channel record
|
ChannelStatus |
getChannelStatus()
Returns the channel operation status.
|
long |
getTimestamp()
Returns the associated timestamp.
|
TypedValue<?> |
getValue()
Returns the value associated to the operation represented by this channel record
|
DataType |
getValueType()
Returns the type of the value associated to the operation represented by this channel record
|
int |
hashCode() |
void |
setChannelConfig(java.util.Map<java.lang.String,java.lang.Object> channelConfig)
Sets the channel configuration as provided.
|
void |
setChannelStatus(ChannelStatus status)
Sets the status.
|
void |
setTimestamp(long timestamp)
Sets the timestamp as provided.
|
void |
setValue(TypedValue<?> value)
Sets the value associated to the operation represented by this channel record
|
java.lang.String |
toString() |
public static ChannelRecord createReadRecord(java.lang.String channelName, DataType valueType)
channelName
- The name of the channelvalueType
- The type of the value to be readjava.lang.NullPointerException
- If any of the provided arguments is nullpublic static ChannelRecord createWriteRecord(java.lang.String channelName, TypedValue<?> value)
channelName
- The name of the channelvalue
- The value to be writtenjava.lang.NullPointerException
- If any of the provided arguments is nullpublic static ChannelRecord createStatusRecord(java.lang.String channelName, ChannelStatus status)
channelName
- The name of the channelstatus
- The statusjava.lang.NullPointerException
- If any of the provided arguments is nullpublic java.util.Map<java.lang.String,java.lang.Object> getChannelConfig()
public ChannelStatus getChannelStatus()
public long getTimestamp()
public void setChannelConfig(java.util.Map<java.lang.String,java.lang.Object> channelConfig)
channelConfig
- the channel configurationjava.lang.NullPointerException
- if the argument is nullpublic void setChannelStatus(ChannelStatus status)
status
- the new driver statusjava.lang.NullPointerException
- if the argument is nullpublic void setTimestamp(long timestamp)
timestamp
- the new timestamppublic java.lang.String getChannelName()
public DataType getValueType()
public TypedValue<?> getValue()
public void setValue(TypedValue<?> value)
value
- the value to be setjava.lang.NullPointerException
- if the provided value is nullpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object