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 Details

    • ProcessInfo

      protected ProcessInfo(@Nullable String command, @Nullable String commandLine)
      Creates an instance of a ProcessInfo record class.
      Parameters:
      command - the value for the command record component
      commandLine - the value for the commandLine record component
  • Method Details

    • from

      protected static ProcessAddonFinder.ProcessInfo from(ProcessHandle.Info info)
      Initializes the command and commandLine fields. If the command field is not present, it parses the first token in the command line.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • command

      public @Nullable String command()
      Returns the value of the command record component.
      Returns:
      the value of the command record component
    • commandLine

      public @Nullable String commandLine()
      Returns the value of the commandLine record component.
      Returns:
      the value of the commandLine record component