📄 checkpasswordpermission.java
字号:
/* * CheckPasswordPermission.java */package com.wrox.password;import java.security.*;/** * The CheckPasswordPermission class. It implements a simple permission * without target (name) or actions: you either have CheckPasswordPermission * or you don't. */public class CheckPasswordPermission extends Permission { /** * Creates a new CheckPasswordPermission object. */ public CheckPasswordPermission() { super("<CheckPasswordPermission>"); } /** * Creates a new CheckPasswordPermission object. This constructor * exists for use by the <code>Policy</code> object to instantiate * new Permission objects. * @param name ignored * @param actions ignored. */ public CheckPasswordPermission(String name, String actions) { this(); } /** * Test for equality. Since every CheckPasswordPermission is equal * to any other, this simply tests if <code>obj</code> is a * CheckPasswordPermission. * @param obj The object to test equality for * @return <code>true</code> if obj is a CheckPasswordPermission */ public boolean equals(Object obj) { return obj instanceof CheckPasswordPermission; } /** * This permission does not support any actions. * @return The empty string. */ public String getActions() { return ""; } /** * Tests if a Permission is implied. Since CheckPasswordPermissions * imply only each other, this is identical to equals(Object). * @see #equals(Object) */ public boolean implies(Permission p) { return equals(p); } /** * The hash code for this object. Since all CheckPasswordPermission * objects are equal, this returns the class' hashCode. * @return The hash code for this object. */ public int hashCode() { return CheckPasswordPermission.class.hashCode(); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -