Package org.gitlab4j.api.utils
Class SecretString
java.lang.Object
org.gitlab4j.api.utils.SecretString
- All Implemented Interfaces:
AutoCloseable
,CharSequence
This class implements a CharSequence that can be cleared of it's contained characters.
This class is utilized to pass around secrets (passwords) instead of a String instance.
-
Constructor Summary
ConstructorsConstructorDescriptionSecretString
(char[] chars) SecretString
(char[] chars, int start, int end) SecretString
(CharSequence charSequence) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty, toString
-
Constructor Details
-
SecretString
-
SecretString
public SecretString(char[] chars) -
SecretString
public SecretString(char[] chars, int start, int end)
-
-
Method Details
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
clear
public void clear()Clear the contents of this SecretString instance by setting each character to 0. This is automatically done in the finalize() method. -
finalize
-