java.lang.Object
org.praxislive.core.Value
org.praxislive.core.types.PMap.MapBasedValue
org.praxislive.core.ComponentInfo
Information about the controls, ports, protocols and properties of a
Component.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.praxislive.core.Value
Value.Type<T extends Value> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOptional key for storing theComponentTypeof the Component in the properties map. value must be a valid component type.static final StringMap key for the controls map.static final StringOptional key for adding a hint how the component, and its children if a container, should be displayed.static final StringOptional key marking the fact that the response fromComponent.getInfo()orComponentProtocolmay change during the lifetime of the component.static final StringMap key for the ports map.static final StringMap key for the protocols list.static final StringValue type name. -
Method Summary
Modifier and TypeMethodDescriptioncontrolInfo(String control) Access theControlInfofor the given control.controls()The list of controls on the related component.static Optional<ComponentInfo> Coerce the provided Value into a ComponentInfo if possible.booleanhasProtocol(Class<? extends Protocol> protocol) Query whether the related component has the provided protocol.static ArgumentInfoinfo()Convenience method to create anArgumentInfofor a ComponentInfo argument.static ComponentInfoParse the provided String into a ComponentInfo if possible.Access thePortInfofor the given port.ports()The list of ports on the related component.Access the map of properties.The list ofProtocols supported by the related component.Methods inherited from class org.praxislive.core.types.PMap.MapBasedValue
dataMap, equals, equivalent, hashCode, toString
-
Field Details
-
TYPE_NAME
Value type name.- See Also:
-
KEY_CONTROLS
Map key for the controls map.- See Also:
-
KEY_PORTS
Map key for the ports map.- See Also:
-
KEY_PROTOCOLS
Map key for the protocols list.- See Also:
-
KEY_COMPONENT_TYPE
Optional key for storing theComponentTypeof the Component in the properties map. value must be a valid component type.- See Also:
-
KEY_DYNAMIC
Optional key marking the fact that the response fromComponent.getInfo()orComponentProtocolmay change during the lifetime of the component. Value must currently be a boolean.- See Also:
-
KEY_DISPLAY_HINT
Optional key for adding a hint how the component, and its children if a container, should be displayed. Value must be a map. Thetypekey is mandatory. Other keys may be used to provide additional configuration.- See Also:
-
-
Method Details
-
protocols
The list ofProtocols supported by the related component.- Returns:
- list of protocols
-
hasProtocol
Query whether the related component has the provided protocol.- Parameters:
protocol- protocol class- Returns:
- true if component has protocol
-
controls
The list of controls on the related component. To access theControlInfofor a control, usecontrolInfo(java.lang.String).- Returns:
- list of controls
-
controlInfo
Access theControlInfofor the given control.- Parameters:
control- name of control- Returns:
- control info (or null if not in the list of controls)
-
ports
The list of ports on the related component. To access thePortInfofor a port, useportInfo(java.lang.String).- Returns:
- list of ports
-
portInfo
Access thePortInfofor the given port.- Parameters:
port- name of port- Returns:
- port info (or null if not in the list of ports)
-
properties
Access the map of properties. The map includes all the controls, ports and protocols, as well as any custom or optional properties.This method is equivalent to calling
PMap.MapBasedValue.dataMap().- Returns:
- property map
-
from
Coerce the provided Value into a ComponentInfo if possible.- Parameters:
arg- value of unknown type- Returns:
- component info or empty optional
-
parse
Parse the provided String into a ComponentInfo if possible.- Parameters:
string- text to parse- Returns:
- component info
- Throws:
ValueFormatException- if parsing fails
-
info
Convenience method to create anArgumentInfofor a ComponentInfo argument.- Returns:
- argument info for ComponentInfo
-