Package io.openems.common.types
Class ChannelAddress
java.lang.Object
io.openems.common.types.ChannelAddress
- All Implemented Interfaces:
Comparable<ChannelAddress>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(ChannelAddress other) boolean
static ChannelAddress
fromString
(String address) Parses a string "Component-ID/Channel-ID" to a ChannelAddress.Gets the Channel-Id.Gets the Component-ID.int
hashCode()
static int
match
(ChannelAddress source, ChannelAddress pattern) Match two ChannelAddresses, considering wildcards.toString()
-
Constructor Details
-
ChannelAddress
-
-
Method Details
-
getComponentId
Gets the Component-ID.- Returns:
- the Component-ID
-
getChannelId
Gets the Channel-Id.- Returns:
- the Channel-Id
-
toString
-
fromString
Parses a string "Component-ID/Channel-ID" to a ChannelAddress.- Parameters:
address
- the address as a String- Returns:
- the ChannelAddress
- Throws:
OpenemsError.OpenemsNamedException
- on parse error
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ChannelAddress>
-
hashCode
public int hashCode() -
equals
-
match
Match two ChannelAddresses, considering wildcards.- if
equals(Object)
is true -> return 0 - if both
ChannelAddress
es match via wildcards -> return value > 1; bigger values represent a better match - if both
ChannelAddress
es do not match -> return -1
See
StringUtils.matchWildcard(String, String)
for implementation details.- Parameters:
source
- the sourceChannelAddress
pattern
- the patternChannelAddress
- Returns:
- an integer value representing the degree of matching
- if
-