- java.lang.Object
-
- org.eclipse.jgit.transport.CredentialItem
-
- org.eclipse.jgit.transport.CredentialItem.StringType
-
- Direct Known Subclasses:
CredentialItem.Username
- Enclosing class:
- CredentialItem
public static class CredentialItem.StringType extends CredentialItem
An item whose value is stored as a string. When working with secret data, considerCredentialItem.CharArrayTypeinstead, as the internal members of the array can be cleared, reducing the chances that the password is left in memory after authentication is completed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jgit.transport.CredentialItem
CredentialItem.CharArrayType, CredentialItem.InformationalMessage, CredentialItem.Password, CredentialItem.StringType, CredentialItem.Username, CredentialItem.YesNoType
-
-
Constructor Summary
Constructors Constructor Description StringType(String promptText, boolean maskValue)Initialize a prompt for a single string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the stored value, destroying it as much as possible.StringgetValue()voidsetValue(String newValue)-
Methods inherited from class org.eclipse.jgit.transport.CredentialItem
getPromptText, isValueSecure
-
-
-
-
Constructor Detail
-
StringType
public StringType(String promptText, boolean maskValue)
Initialize a prompt for a single string.- 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 Detail
-
clear
public void clear()
Description copied from class:CredentialItemClear the stored value, destroying it as much as possible.- Specified by:
clearin classCredentialItem
-
getValue
public String getValue()
- Returns:
- the current value
-
setValue
public void setValue(String newValue)
- Parameters:
newValue-
-
-