Record Class ProcessAddonFinder.ProcessInfo
java.lang.Object
java.lang.Record
org.openhab.core.config.discovery.addon.process.ProcessAddonFinder.ProcessInfo
- Enclosing class:
ProcessAddonFinder
protected static record ProcessAddonFinder.ProcessInfo(@Nullable String command, @Nullable String commandLine)
extends Record
Private record to extract match property parameters from a
ProcessHandle.Info
object.
Tries to mitigate differences on different operating systems.-
Constructor Summary
ModifierConstructorDescriptionprotected
ProcessInfo
(@Nullable String command, @Nullable String commandLine) Creates an instance of aProcessInfo
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable String
command()
Returns the value of thecommand
record component.@Nullable String
Returns the value of thecommandLine
record component.final boolean
Indicates whether some other object is "equal to" this one.protected static ProcessAddonFinder.ProcessInfo
from
(ProcessHandle.Info info) Initializes the command and commandLine fields.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ProcessInfo
Creates an instance of aProcessInfo
record class.- Parameters:
command
- the value for thecommand
record componentcommandLine
- the value for thecommandLine
record component
-
-
Method Details
-
from
Initializes the command and commandLine fields. If the command field is not present, it parses the first token in the command line. -
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)
. -
command
Returns the value of thecommand
record component.- Returns:
- the value of the
command
record component
-
commandLine
Returns the value of thecommandLine
record component.- Returns:
- the value of the
commandLine
record component
-