1. /*
  2. * @(#)Principal.java 1.19 00/02/02
  3. *
  4. * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.security;
  11. /**
  12. * This interface represents the abstract notion of a principal, which
  13. * can be used to represent any entity, such as an individual, a
  14. * corporation, and a login id.
  15. *
  16. * @see java.security.cert.X509Certificate
  17. *
  18. * @version 1.19, 00/02/02
  19. * @author Li Gong
  20. */
  21. public interface Principal {
  22. /**
  23. * Compares this principal to the specified object. Returns true
  24. * if the object passed in matches the principal represented by
  25. * the implementation of this interface.
  26. *
  27. * @param another principal to compare with.
  28. *
  29. * @return true if the principal passed in is the same as that
  30. * encapsulated by this principal, and false otherwise.
  31. */
  32. public boolean equals(Object another);
  33. /**
  34. * Returns a string representation of this principal.
  35. *
  36. * @return a string representation of this principal.
  37. */
  38. public String toString();
  39. /**
  40. * Returns a hashcode for this principal.
  41. *
  42. * @return a hashcode for this principal.
  43. */
  44. public int hashCode();
  45. /**
  46. * Returns the name of this principal.
  47. *
  48. * @return the name of this principal.
  49. */
  50. public String getName();
  51. }