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
ConstructorsModifierConstructorDescriptionprotectedProcessInfo(@Nullable String command, @Nullable String commandLine) Creates an instance of aProcessInforecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringcommand()Returns the value of thecommandrecord component.@Nullable StringReturns the value of thecommandLinerecord component.final booleanIndicates whether some other object is "equal to" this one.protected static ProcessAddonFinder.ProcessInfofrom(ProcessHandle.Info info) Initializes the command and commandLine fields.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ProcessInfo
Creates an instance of aProcessInforecord class.- Parameters:
command- the value for thecommandrecord componentcommandLine- the value for thecommandLinerecord 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 thecommandrecord component.- Returns:
- the value of the
commandrecord component
-
commandLine
Returns the value of thecommandLinerecord component.- Returns:
- the value of the
commandLinerecord component
-