Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger (www.helger.com) philip[at]helger[dot]com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package com.helger.appbasics.auth.identify;
public final class AuthIdentificationResult implements ISuccessIndicator
  private final IAuthToken m_aAuthToken;

  
Constructor for a failure.

Parameters:
aCredentialValidationResult The validation result. May not be null and must be a failure!
  public AuthIdentificationResult (@Nonnull final CredentialValidationResult aCredentialValidationResult)
  {
    ValueEnforcer.notNull (aCredentialValidationResult"CredentialValidationResult");
    if (aCredentialValidationResult.isSuccess ())
      throw new IllegalStateException ("Don't call this method for successfuly credential validation!");
     = aCredentialValidationResult;
     = null;
  }

  
Constructor for success.

Parameters:
aAuthToken The auth token. May not be null.
  public AuthIdentificationResult (@Nonnull final IAuthToken aAuthToken)
  {
    ValueEnforcer.notNull (aAuthToken"AuthToken");
     = aAuthToken;
  }
  public boolean isSuccess ()
  {
    return  == null;
  }
  public boolean isFailure ()
  {
    return  != null;
  }

  

Returns:
The credential validation error message or null in case of successful identification
  {
  }

  

Returns:
The auth token in case of successful identification or null in case of an error.
  public IAuthToken getAuthToken ()
  {
    return ;
  }
  public String toString ()
  {
    return new ToStringGenerator (this).append ("credentialValidationResult")
                                       .append ("authToken")
                                       .toString ();
  }
New to GrepCode? Check out our FAQ X