Record Class SudoInformation
java.lang.Object
java.lang.Record
org.sentrysoftware.metricshub.engine.strategy.utils.SudoInformation
- Record Components:
isUseSudo- Indicates if sudo is to be used.useSudoCommands- A set of commands that specifically require sudo.sudoCommand- The actual sudo command string to be used.
public record SudoInformation(boolean isUseSudo, Set<String> useSudoCommands, String sudoCommand)
extends Record
Represents the necessary information to manage the sudo commands.
This record contains settings that determine whether sudo is used, which commands require sudo,
and the specific sudo command to be used.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSudoInformation(boolean isUseSudo, Set<String> useSudoCommands, String sudoCommand) Creates an instance of aSudoInformationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisUseSudorecord component.Returns the value of thesudoCommandrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theuseSudoCommandsrecord component.
-
Field Details
-
SUDO
Default SUDO command- See Also:
-
-
Constructor Details
-
SudoInformation
Creates an instance of aSudoInformationrecord class.- Parameters:
isUseSudo- the value for theisUseSudorecord componentuseSudoCommands- the value for theuseSudoCommandsrecord componentsudoCommand- the value for thesudoCommandrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
isUseSudo
public boolean isUseSudo()Returns the value of theisUseSudorecord component.- Returns:
- the value of the
isUseSudorecord component
-
useSudoCommands
Returns the value of theuseSudoCommandsrecord component.- Returns:
- the value of the
useSudoCommandsrecord component
-
sudoCommand
Returns the value of thesudoCommandrecord component.- Returns:
- the value of the
sudoCommandrecord component
-