Record Class CredentialLookup.Credential
java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.git.api.CredentialLookup.Credential
- Enclosing interface:
CredentialLookup
public static record CredentialLookup.Credential(CredentialLookup.Kind kind, String username, String secret, Path keyFile)
extends Record
A credential. For
CredentialLookup.Kind.HTTPS: username and secret (password or token). For
CredentialLookup.Kind.SSH_KEY: keyFile and, if the key is protected, its passphrase in secret.-
Constructor Summary
ConstructorsConstructorDescriptionCredential(CredentialLookup.Kind kind, String username, String secret, Path keyFile) Creates an instance of aCredentialrecord 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.static CredentialLookup.CredentialA user name with a password or access token for HTTPS.keyFile()Returns the value of thekeyFilerecord component.kind()Returns the value of thekindrecord component.secret()Returns the value of thesecretrecord component.static CredentialLookup.CredentialA private key file for SSH;passphraseis empty ornullif the key is not protected.toString()Never prints the secret.username()Returns the value of theusernamerecord component.
-
Constructor Details
-
Credential
Creates an instance of aCredentialrecord class.- Parameters:
kind- the value for thekindrecord componentusername- the value for theusernamerecord componentsecret- the value for thesecretrecord componentkeyFile- the value for thekeyFilerecord component
-
-
Method Details
-
https
A user name with a password or access token for HTTPS. -
sshKey
A private key file for SSH;passphraseis empty ornullif the key is not protected. -
toString
Never prints the secret. -
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). -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
secret
Returns the value of thesecretrecord component.- Returns:
- the value of the
secretrecord component
-
keyFile
Returns the value of thekeyFilerecord component.- Returns:
- the value of the
keyFilerecord component
-