public class BasicChannel extends Object implements AgentChannel
AgentChannel.AgentChannel.Key| Modifier and Type | Field and Description |
|---|---|
protected HashMap<String,Object> |
data |
protected Object |
value |
| Constructor and Description |
|---|
BasicChannel(AgentChannel other)
Copy constructor.
|
BasicChannel(BasicChannel other)
Copy constructor.
|
BasicChannel(String path,
org.lsst.ccs.bus.data.AgentInfo agent)
Constructs an instance.
|
BasicChannel(String path,
org.lsst.ccs.bus.data.AgentInfo agent,
Map<String,Object> attributes,
Object value)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
<T> T |
get()
Returns the current central value of this channel.
|
<T> T |
get(Object key)
Returns the value of the channel attribute identified by the
key. |
org.lsst.ccs.bus.data.AgentInfo |
getAgent()
Returns the descriptor of the
Agent this channel belongs to. |
String |
getAgentName()
Returns the name of the
Agent this channel belongs to. |
List<String> |
getAttributes()
Returns the list of keys of attributes this channel has.
|
String |
getLocalPath()
Returns the path of this channel with the agent name and the following slash stripped.
|
String |
getPath()
Return the unique path of this channel.
|
int |
hashCode() |
boolean |
set(Object value)
Sets the value of this channel.
|
boolean |
set(Object key,
Object value)
Sets the value of the specified attribute.
|
String |
toString() |
public BasicChannel(String path, org.lsst.ccs.bus.data.AgentInfo agent)
path - Unique path identifying this channel.agent - Agent this channel belongs to.public BasicChannel(String path, org.lsst.ccs.bus.data.AgentInfo agent, Map<String,Object> attributes, Object value)
path - Unique path identifying this channel.agent - Agent this channel belongs to.attributes - Static attributes and metadata associated with this channel.value - Current value.public BasicChannel(BasicChannel other)
other - Channel to copy.public BasicChannel(AgentChannel other)
other - Channel to copy.public String getPath()
getPath in interface AgentChannelpublic String getAgentName()
Agent this channel belongs to.getAgentName in interface AgentChannelpublic org.lsst.ccs.bus.data.AgentInfo getAgent()
Agent this channel belongs to.getAgent in interface AgentChannelpublic String getLocalPath()
getLocalPath in interface AgentChannelpublic <T> T get(Object key)
key.get in interface AgentChannelT - Type of the attribute value.key - Attribute key. If VALUE or null, the central value is returned.null if this channel does not have the specified attribute.public <T> T get()
get in interface AgentChannelT - Type of the central value.public List<String> getAttributes()
AgentChannelgetAttributes in interface AgentChannelpublic boolean set(Object key, Object value)
set in interface AgentChannelkey - The attribute is identified by the string returned by toString() method of the key object.
If key is null or evaluates to AgentChannel.Key.VALUE, the central value is set.value - The new value.true if the attribute value has changed as a result of this call.public boolean set(Object value)
set in interface AgentChannelvalue - New value.true if the value has changed as a result of this call.Copyright © 2023 LSST. All rights reserved.