java.lang.Object
org.refcodes.web.BasicAuthCredentialsImpl
- All Implemented Interfaces:
org.refcodes.mixin.CredentialsAccessor,org.refcodes.mixin.IdentityAccessor,org.refcodes.mixin.SecretAccessor,org.refcodes.mixin.Validatable<BasicCredentials>,AuthTypeAccessor,AuthTypeCredentials<BasicAuthCredentials,BasicCredentials>,BasicAuthCredentials,BasicCredentials
- Direct Known Subclasses:
BasicAuthCredentialsBuilderImpl
public class BasicAuthCredentialsImpl extends Object implements BasicAuthCredentials
This implementation of the
BasicAuthCredentials interface compares
the secret (getSecret()) case sensitive but the username (
getIdentity()) case insensitive with the equals(Object)
method.-
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.web.BasicAuthCredentials
BasicAuthCredentials.BasicAuthCredentialsBuilderNested classes/interfaces inherited from interface org.refcodes.mixin.CredentialsAccessor
org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<B extends org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<B>>, org.refcodes.mixin.CredentialsAccessor.CredentialsMutator, org.refcodes.mixin.CredentialsAccessor.CredentialsPropertyNested classes/interfaces inherited from interface org.refcodes.mixin.IdentityAccessor
org.refcodes.mixin.IdentityAccessor.IdentityBuilder<B extends org.refcodes.mixin.IdentityAccessor.IdentityBuilder<B>>, org.refcodes.mixin.IdentityAccessor.IdentityMutator, org.refcodes.mixin.IdentityAccessor.IdentityPropertyNested classes/interfaces inherited from interface org.refcodes.mixin.SecretAccessor
org.refcodes.mixin.SecretAccessor.SecretBuilder<B extends org.refcodes.mixin.SecretAccessor.SecretBuilder<B>>, org.refcodes.mixin.SecretAccessor.SecretMutator, org.refcodes.mixin.SecretAccessor.SecretProperty -
Field Summary
Fields inherited from interface org.refcodes.web.BasicAuthCredentials
DELIMITER_BASIC_AUTH, DELIMITER_CREDENTIALS -
Constructor Summary
Constructors Constructor Description BasicAuthCredentialsImpl()Instantiates a newBasicAuthCredentialsinstance.BasicAuthCredentialsImpl(String aIdentity, String aSecret)Instantiates a newBasicAuthCredentialsinstance. -
Method Summary
Modifier and Type Method Description booleanequals(Object obj)voidfromHttpAuthorization(String aHttpAuthorization)Initializes thisAuthTypeCredentialsinstance from theHeaderField.AUTHORIZATIONHeader-Fields's value.StringgetIdentity()StringgetSecret()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.BasicAuthCredentials
getAuthType, validate, validate, withHttpAuthorizationMethods inherited from interface org.refcodes.web.BasicCredentials
isValid, isValid
-
Constructor Details
-
BasicAuthCredentialsImpl
public BasicAuthCredentialsImpl()Instantiates a newBasicAuthCredentialsinstance. -
BasicAuthCredentialsImpl
Instantiates a newBasicAuthCredentialsinstance.- Parameters:
aIdentity- the user nameaSecret- the secret
-
-
Method Details
-
getIdentity
- Specified by:
getIdentityin interfaceorg.refcodes.mixin.IdentityAccessor
-
getSecret
- Specified by:
getSecretin interfaceorg.refcodes.mixin.SecretAccessor
-
hashCode
public int hashCode() -
equals
-
toString
-
fromHttpAuthorization
Initializes thisAuthTypeCredentialsinstance from theHeaderField.AUTHORIZATIONHeader-Fields's value.- Specified by:
fromHttpAuthorizationin interfaceAuthTypeCredentials<BasicAuthCredentials,BasicCredentials>- Parameters:
aHttpAuthorization- TheHeaderField.AUTHORIZATIONheader field's value
-
toHttpAuthorization
Creates aHeaderField.AUTHORIZATIONHTTP Header-Field value from theAuthTypeCredentialsinstance.- Specified by:
toHttpAuthorizationin interfaceAuthTypeCredentials<BasicAuthCredentials,BasicCredentials>- Returns:
- The according HTTP Header-Field's value.
-