Package io.openems.edge.core.appmanager
Record Class ComponentUtil.PreferredRelay
java.lang.Object
java.lang.Record
io.openems.edge.core.appmanager.ComponentUtil.PreferredRelay
- Enclosing interface:
ComponentUtil
public static record ComponentUtil.PreferredRelay(Predicate<ComponentUtil.RelayInfo> matchesRelay, int[] preferredRelays)
extends Record
-
Constructor Summary
ConstructorDescriptionPreferredRelay
(Predicate<ComponentUtil.RelayInfo> matchesRelay, int[] preferredRelays) Creates an instance of aPreferredRelay
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thematchesRelay
record component.static ComponentUtil.PreferredRelay
of
(int numberOfRelays, int[] preferredRelays) Creates aComponentUtil.PreferredRelay
for a relay with the given amount of relay contacts.int[]
Returns the value of thepreferredRelays
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PreferredRelay
Creates an instance of aPreferredRelay
record class.- Parameters:
matchesRelay
- the value for thematchesRelay
record componentpreferredRelays
- the value for thepreferredRelays
record component
-
-
Method Details
-
of
Creates aComponentUtil.PreferredRelay
for a relay with the given amount of relay contacts.- Parameters:
numberOfRelays
- the number of relay contactspreferredRelays
- the preferred relays- Returns:
- the
ComponentUtil.PreferredRelay
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
matchesRelay
Returns the value of thematchesRelay
record component.- Returns:
- the value of the
matchesRelay
record component
-
preferredRelays
public int[] preferredRelays()Returns the value of thepreferredRelays
record component.- Returns:
- the value of the
preferredRelays
record component
-