All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ldaptive.auth.User Maven / Gradle / Ivy

There is a newer version: 2.4.1
Show newest version
/* See LICENSE for licensing and NOTICE for copyright. */
package org.ldaptive.auth;

/**
 * Encapsulates the data needed to perform authentication for a user.
 *
 * @author  Middleware Services
 */
public class User
{

  /** User identifier. */
  private final String identifier;

  /** User context. */
  private final Object context;


  /**
   * Creates a new user.
   *
   * @param  id  user identifier
   */
  public User(final String id)
  {
    this(id, null);
  }


  /**
   * Creates a new user.
   *
   * @param  id  user identifier
   * @param  ctx  user context
   */
  public User(final String id, final Object ctx)
  {
    identifier = id;
    context = ctx;
  }


  /**
   * Returns the user identifier.
   *
   * @return  user identifier
   */
  public String getIdentifier()
  {
    return identifier;
  }


  /**
   * Returns the user context.
   *
   * @return  user context
   */
  public Object getContext()
  {
    return context;
  }


  @Override
  public String toString()
  {
    return "[" +
      getClass().getName() + "@" + hashCode() + "::" +
      "identifier=" + identifier + ", " +
      "context=" + context + "]";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy