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

📄 preferencesinfo.java

📁 Oracle的J2EE Sample
💻 JAVA
字号:
/*
 * @author : Umesh Kulkarni
 * @version 1.0
 *
 * Development Environment : Oracle9i JDeveloper
 *
 * Name of the File : PreferencesInfo.java
 *
 * Creation / Modification History
 *    Umesh           26-Apr-2002        Created
 *
 */
package oracle.otnsamples.ibfbs.usermanagement.ejb;

import java.io.Serializable;

/**
 * This Class encapsulates Preferences Information for a particular User 
 * Account. Whenever Session Facade Bean namely UserManagementSessionFacadeBean, 
 * needs to get the Preferences Info for a particular User Account, the Session 
 * Facade Bean gets this information as PreferencesInfo value object. Thus this 
 * class acts as Value object while getting/setting preferences information 
 * between Session Facade Bean and User Account Entity Bean.
 * @version 1.0
 * @since   1.0
 */
public class PreferencesInfo implements Serializable {

  private String preferenceType; // Preference Type
  private String symbol;         // Stock Symbol

  /**
   * Empty Constructor of this Class.
   * @since   1.0
   */
  public PreferencesInfo() {}

  /**
   * Constructor with appropriate parameters. Sets the value of instance
   * variables with appropriate values.
   *
   * @param symbol   Value of the symbol field
   * @param preferenceType  Value of Preference Type. This value can be
   *                          'N' for News
   *                          'S' for Stock Rates
   *                          'B' for both News and Stock Rates
   * @since   1.0
   */
  public PreferencesInfo(String symbol, String preferenceType) {
    this.preferenceType = preferenceType;
    this.symbol         = symbol;
  }

  /**
   * Method to retrieve the value of Preference Type instance variable
   *
   * @return  The Desired Preference Type Value
   * @since   1.0
   */
  public String getPreferenceType() {
    return preferenceType;
  }

  /**
   * Assign the new Preference Type value to preferenceType instance variable.
   *
   * @param preferenceType New preferenceType Value
   * @since   1.0
   */
  public void setPreferenceType(String preferenceType) {
    this.preferenceType = preferenceType;
  }

  /**
   * Method to retrieve the value of Symbol instance variable
   *
   * @return  The Desired Symbol Value
   * @since   1.0
   */
  public String getSymbol() {
    return symbol;
  }

  /**
   * Assign the new Symbol value to symbol instance variable.
   *
   * @param symbol New symbol Value
   * @since   1.0
   */
  public void setSymbol(String symbol) {
    this.symbol = symbol;
  }

  /**
   * Method to get String representation of this class. Overrides the method
   * toString() in java.lang.Object
   *
   * @return String representation of this class.
   * @since   1.0
   */
  public String toString() {
    StringBuffer sb = new StringBuffer();

    sb.append("Preference Type : ")
      .append(this.getPreferenceType())
      .append(" Symbol : ")
      .append(this.getSymbol());

    return sb.toString();
  }
}

⌨️ 快捷键说明

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