passwordentry.java

来自「<Apress.The.Definitive.Guide.to.SWT.a」· Java 代码 · 共 114 行

JAVA
114
字号
package examples.ch9.password.data;

/**
 * This class contains the data for a single password entry
 */
public class PasswordEntry {
  private String category;
  private String name;
  private String userId;
  private String password;

  /**
   * Constructs a PasswordEntry
   */
  public PasswordEntry() {
    this(null, null, null, null);
  }

  /**
   * Constructs a PasswordEntry
   */
  public PasswordEntry(String newCategory, String newName, String newUserId,
      String newPassword) {
    setCategory(newCategory);
    setName(newName);
    setUserId(newUserId);
    setPassword(newPassword);
  }

  /**
   * Returns the category.
   * 
   * @return String
   */
  public String getCategory() {
    return category;
  }

  /**
   * Sets the category
   * 
   * @param category The category to set.
   */
  public void setCategory(String category) {
    this.category = category;
  }

  /**
   * Returns the name.
   * 
   * @return String
   */
  public String getName() {
    return name;
  }

  /**
   * Sets the name
   * 
   * @param name The name to set.
   */
  public void setName(String name) {
    this.name = name;
  }

  /**
   * Returns the password.
   * 
   * @return String
   */
  public String getPassword() {
    return password;
  }

  /**
   * Sets the password
   * 
   * @param password The password to set.
   */
  public void setPassword(String password) {
    this.password = password;
  }

  /**
   * Returns the userId.
   * 
   * @return String
   */
  public String getUserId() {
    return userId;
  }

  /**
   * Sets the userId
   * 
   * @param userId The userId to set.
   */
  public void setUserId(String userId) {
    this.userId = userId;
  }

  /**
   * Clones an entry
   * 
   * @param entry
   */
  public void clone(PasswordEntry entry) {
    setCategory(entry.getCategory());
    setName(entry.getName());
    setUserId(entry.getUserId());
    setPassword(entry.getPassword());
  }
}

⌨️ 快捷键说明

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