⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userimpl.java

📁 动态代理实例源代码
💻 JAVA
字号:
package com.lakeviewtech;

/**
 * Implementation of the User interface.
 */
public class UserImpl implements User {

    /**
     * The username of this user.
     */
    private String username = null;

    /**
     * The password of this user.
     */
    private String password = null;

    /**
     * Gets the username of the User.
     */
    public String getUsername() {
        return username;
    }

    /**
     * Sets the username of the User.
     * @throws ValidationException indicates that validation of the proposed
     * username variable failed.  Contains information about what went wrong.
     */
    public void setUsername(String username) throws ValidationException {
        /* call the validator.  Alternatively, we could make the validator
           call directly and remove the base class.
        */
        BusinessObjectValidationService.validate(this, "setUsername", 
                                                 new Object[] {username});
        this.username = username;
    }

    /**
     * Gets the password of the User.
     */
    public String getPassword() {
        return password;
    }

    /**
     * Sets the password of the User.
     * @throws ValidationException indicates that validation of the proposed
     * password variable failed.  Contains information about what went wrong.
     */
    public void setPassword(String password) throws ValidationException {
        /* call the validator.  Alternatively, we could make the validator
           call directly and remove the base class.
        */
        BusinessObjectValidationService.validate(this, "setPassword", 
                                                 new Object[] {password});
        this.password = password;
    }

    /**
     * String representing the username and password of this User.
     */
    public String toString() {
        return "username: " + username + ", password: " + password;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -