Class CredentialItem

  extended by 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.

Nested Class Summary
static class CredentialItem.CharArrayType
          An item whose value is stored as a char[] and is therefore clearable.
static class CredentialItem.InformationalMessage
          An advice message presented to the user, with no response required.
static class CredentialItem.Password
          Prompt for a password, which is masked on input.
static class CredentialItem.StringType
          An item whose value is stored as a string.
static class CredentialItem.Username
          Prompt for a username, which is not masked on input.
static class CredentialItem.YesNoType
          An item whose value is a boolean choice, presented as Yes/No.
Constructor Summary
CredentialItem(String promptText, boolean maskValue)
          Initialize a prompt.
Method Summary
abstract  void clear()
          Clear the stored value, destroying it as much as possible.
 String getPromptText()
 boolean isValueSecure()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CredentialItem(String promptText,
                      boolean maskValue)
Initialize a prompt.

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 Detail


public String getPromptText()
prompt to display to the user.


public boolean isValueSecure()
true if the value should be masked when entered.


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

Copyright © 2012. All Rights Reserved.