Interface AttributeRead<T>

Type Parameters:
T - the Java value type of the selected Attribute or AttributeMap instance
All Known Implementing Classes:
Attribute, AttributeMapInstance

public interface AttributeRead<T>
Selects one Attribute value for Client.getAttributes(String, AttributeRead...).

Two types implement this interface. An Attribute reads a singleton Attribute. An AttributeMapInstance, created with AttributeMap.instance(String), reads one AttributeMap instance. Pass any mix of them to getAttributes. Then pass the same read, or an equal one, to AttributeValues.get(AttributeRead) to obtain its typed value.

An AttributeMap itself is not a read, because a read needs one instance key. A ChannelMap instance cannot be read. Applications must not implement this interface. getAttributes rejects any other implementation with IllegalArgumentException.

Attribute<String> orderStatus = orderFlow.orderStatus;
AttributeMapInstance<Note> firstNote = orderFlow.notes.instance("n1");

AttributeValues values = client.getAttributes("order-42", orderStatus, firstNote);
Optional<String> status = values.get(orderStatus);
Optional<Note> note = values.get(orderFlow.notes.instance("n1"));