Class CredentialItem

java.lang.Object
org.eclipse.jgit.transport.CredentialItem
Direct Known Subclasses:
CredentialItem.CharArrayType, CredentialItem.InformationalMessage, CredentialItem.StringType, CredentialItem.YesNoType

public abstract class CredentialItem extends Object
A credential requested from a CredentialsProvider. Most users should work with the specialized subclasses: This class is not thread-safe. Applications should construct their own instance for each use, as the value is held within the CredentialItem object.
  • Field Details

    • promptText

      private final String promptText
    • valueSecure

      private final boolean valueSecure
  • Constructor Details

    • CredentialItem

      public CredentialItem(String promptText, boolean maskValue)
      Initialize a prompt.
      Parameters:
      promptText - prompt to display to the user alongside of the input field. Should be sufficient text to indicate what to supply for this item.
      maskValue - true if the value should be masked from displaying during input. This should be true for passwords and other secrets, false for names and other public data.
  • Method Details

    • getPromptText

      public String getPromptText()
      Get prompt to display to the user.
      Returns:
      prompt to display to the user.
    • isValueSecure

      public boolean isValueSecure()
      Whether the value should be masked when entered.
      Returns:
      true if the value should be masked when entered.
    • clear

      public abstract void clear()
      Clear the stored value, destroying it as much as possible.