java.lang.Object
org.refcodes.web.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 the
BearerAuthCredentials interface.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.web.AuthTypeAccessor
AuthTypeAccessor.AuthTypeBuilder<B extends AuthTypeAccessor.AuthTypeBuilder<B>>, AuthTypeAccessor.AuthTypeMutator, AuthTypeAccessor.AuthTypePropertyNested classes/interfaces inherited from interface org.refcodes.mixin.TokenAccessor
org.refcodes.mixin.TokenAccessor.TokenBuilder<B extends org.refcodes.mixin.TokenAccessor.TokenBuilder<B>>, org.refcodes.mixin.TokenAccessor.TokenMutator, org.refcodes.mixin.TokenAccessor.TokenProperty -
Field Summary
Fields inherited from interface org.refcodes.web.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
Modifier and Type Method Description booleanequals(Object obj)voidfromHttpAuthorization(String aHttpAuthorization)Initializes thisAuthTypeCredentialsinstance from theHeaderField.AUTHORIZATIONHeader-Fields's value.StringgetToken()inthashCode()StringtoHttpAuthorization()Creates aHeaderField.AUTHORIZATIONHTTP Header-Field value from theAuthTypeCredentialsinstance.StringtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.refcodes.web.BearerAuthCredentials
getAuthType, validate, validate, withHttpAuthorizationMethods inherited from interface org.refcodes.web.TokenCredentials
isValid, isValid
-
Constructor Details
-
BeararAuthCredentialsImpl
public BeararAuthCredentialsImpl()Instantiates a new bearer auth credentials impl. -
BeararAuthCredentialsImpl
Instantiates a new bearer auth credentials impl.- Parameters:
aToken- the secret
-
-
Method Details
-
getToken
- Specified by:
getTokenin interfaceorg.refcodes.mixin.TokenAccessor
-
hashCode
public int hashCode() -
equals
-
toString
-
fromHttpAuthorization
Initializes thisAuthTypeCredentialsinstance from theHeaderField.AUTHORIZATIONHeader-Fields's value.- Specified by:
fromHttpAuthorizationin interfaceAuthTypeCredentials<BearerAuthCredentials,TokenCredentials>- Parameters:
aHttpAuthorization- TheHeaderField.AUTHORIZATIONheader field's value
-
toHttpAuthorization
Creates aHeaderField.AUTHORIZATIONHTTP Header-Field value from theAuthTypeCredentialsinstance.- Specified by:
toHttpAuthorizationin interfaceAuthTypeCredentials<BearerAuthCredentials,TokenCredentials>- Returns:
- The according HTTP Header-Field's value.
-