Package org.refcodes.net
Class BeararAuthCredentialsImpl
- java.lang.Object
-
- org.refcodes.net.BeararAuthCredentialsImpl
-
- All Implemented Interfaces:
org.refcodes.mixin.TokenAccessor
,org.refcodes.mixin.Validatable<TokenCredentials>
,AuthTypeAccessor
,AuthTypeCredentials<BearerAuthCredentials,TokenCredentials>
,BearerAuthCredentials
,TokenCredentials
public class BeararAuthCredentialsImpl extends Object implements BearerAuthCredentials
Implementation of theBearerAuthCredentials
interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.AuthTypeAccessor
AuthTypeAccessor.AuthTypeBuilder<B extends AuthTypeAccessor.AuthTypeBuilder<B>>, AuthTypeAccessor.AuthTypeMutator, AuthTypeAccessor.AuthTypeProperty
-
-
Field Summary
-
Fields inherited from interface org.refcodes.net.BearerAuthCredentials
DELIMITER_AUTH_TYPE
-
-
Constructor Summary
Constructors Constructor Description BeararAuthCredentialsImpl()
Instantiates a new bearer auth credentials impl.BeararAuthCredentialsImpl(String aToken)
Instantiates a new bearer auth credentials impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
void
fromHttpAuthorization(String aHttpAuthorization)
Initializes thisAuthTypeCredentials
instance from theHeaderField.AUTHORIZATION
Header-Fields's value.String
getToken()
int
hashCode()
String
toHttpAuthorization()
Creates aHeaderField.AUTHORIZATION
HTTP Header-Field value from theAuthTypeCredentials
instance.String
toString()
-
Methods inherited from interface org.refcodes.net.BearerAuthCredentials
getAuthType, validate, validate, withHttpAuthorization
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.net.TokenCredentials
isValid, isValid
-
-
-
-
Constructor Detail
-
BeararAuthCredentialsImpl
public BeararAuthCredentialsImpl()
Instantiates a new bearer auth credentials impl.
-
BeararAuthCredentialsImpl
public BeararAuthCredentialsImpl(String aToken)
Instantiates a new bearer auth credentials impl.- Parameters:
aToken
- the secret
-
-
Method Detail
-
getToken
public String getToken()
- Specified by:
getToken
in interfaceorg.refcodes.mixin.TokenAccessor
-
fromHttpAuthorization
public void fromHttpAuthorization(String aHttpAuthorization)
Initializes thisAuthTypeCredentials
instance from theHeaderField.AUTHORIZATION
Header-Fields's value.- Specified by:
fromHttpAuthorization
in interfaceAuthTypeCredentials<BearerAuthCredentials,TokenCredentials>
- Parameters:
aHttpAuthorization
- TheHeaderField.AUTHORIZATION
header field's value
-
toHttpAuthorization
public String toHttpAuthorization()
Creates aHeaderField.AUTHORIZATION
HTTP Header-Field value from theAuthTypeCredentials
instance.- Specified by:
toHttpAuthorization
in interfaceAuthTypeCredentials<BearerAuthCredentials,TokenCredentials>
- Returns:
- The according HTTP Header-Field's value.
-
-