< prev index next >

src/java.base/share/classes/java/security/Principal.java

Print this page




  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.security;
  27 
  28 import javax.security.auth.Subject;
  29 
  30 /**
  31  * This interface represents the abstract notion of a principal, which
  32  * can be used to represent any entity, such as an individual, a
  33  * corporation, and a login id.
  34  *
  35  * @see java.security.cert.X509Certificate
  36  *
  37  * @author Li Gong

  38  */
  39 public interface Principal {
  40 
  41     /**
  42      * Compares this principal to the specified object.  Returns true
  43      * if the object passed in matches the principal represented by
  44      * the implementation of this interface.
  45      *
  46      * @param another principal to compare with.
  47      *
  48      * @return true if the principal passed in is the same as that
  49      * encapsulated by this principal, and false otherwise.
  50      */
  51     public boolean equals(Object another);
  52 
  53     /**
  54      * Returns a string representation of this principal.
  55      *
  56      * @return a string representation of this principal.
  57      */




  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.security;
  27 
  28 import javax.security.auth.Subject;
  29 
  30 /**
  31  * This interface represents the abstract notion of a principal, which
  32  * can be used to represent any entity, such as an individual, a
  33  * corporation, and a login id.
  34  *
  35  * @see java.security.cert.X509Certificate
  36  *
  37  * @author Li Gong
  38  * @since 1.1
  39  */
  40 public interface Principal {
  41 
  42     /**
  43      * Compares this principal to the specified object.  Returns true
  44      * if the object passed in matches the principal represented by
  45      * the implementation of this interface.
  46      *
  47      * @param another principal to compare with.
  48      *
  49      * @return true if the principal passed in is the same as that
  50      * encapsulated by this principal, and false otherwise.
  51      */
  52     public boolean equals(Object another);
  53 
  54     /**
  55      * Returns a string representation of this principal.
  56      *
  57      * @return a string representation of this principal.
  58      */


< prev index next >