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

📄 shop.java

📁 噶额外噶外骨骼感广泛高热感 就 啊啊
💻 JAVA
字号:
/*
 * @author                        : Neelesh
 * @Version                       : 1.0
 *
 * Development Environment        : Oracle9i JDeveloper
 * Name of the File               : Shop.java
 * Creation/Modification History  :
 *
 * Neelesh    03-Oct-2002      Created
 *
 */
package oracle.otnsamples.vsm.services.data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * The class is a value object for Shop, and has getters and setters for
 * username,id, shopname,description,rating,registrationdate and category id .
 *
 * @author Neelesh
 * @version 1.0
 */
public class Shop implements java.io.Serializable {

  private Date regDate; // date of shop registration
  private List shopDetails;
  private String categoryId; // id of shop category
  private String id; // shop's unique id
  private String status; // shop status 
  private String userName; // user name of shop owner

  //P-pending,R-Rejected, A-Approved,D-discontinued
  //private Customer owner;
  //  private Category category;
  /**
   * constructor
   */
  public Shop(
              String userName, String catID, Date regDate, String id,
              String status, List details) {
    this.userName      = userName;
    this.categoryId    = catID;
    this.regDate       = regDate;
    this.id            = id;
    this.status        = status;
    this.shopDetails   = details;
  }
  /**
   * Default constructor
   */
  public Shop() {
  }

  /**
   * Gets the category of the shop
   *
   * @return <b>String</b> category id
   */
  public String getCategoryId() {

    return categoryId;
  }
  /**
   * Gets the date of shop registration
   *
   * @return <b>Date</b> date of registration
   */
  public Date getRegDate() {

    return regDate;
  }
  /**
   * Gets the status of the shop
   *
   * @return <b>String</b> status of the shop P-pending,R-Rejected,
   *         A-Approved,D-discontinued
   */
  public String getStatus() {

    return status;
  }
  /**
   * Sets the owner's userName
   *
   * @param <b>newUserName</b> username of shopowner
   */
  public void setUserName(String newUserName) {
    userName = newUserName;
  }
  /**
   * Gets the owner's userName
   *
   * @return <b>String</b> username of shopowner
   */
  public String getUserName() {

    return userName;
  }
  /**
   * Sets the category of the shop
   *
   * @param <b>newCategoryId</b> new category id
   */
  public void setCategoryId(String newCategoryId) {
    categoryId = newCategoryId;
  }
  /**
   * Gets the id of the shop
   */
  public String getId() {

    return id;
  }
  /**
   * Sets the date of shop registration
   *
   * @param <b>newRegDate</b> date of registration
   */
  public void setRegDate(Date newRegDate) {
    regDate = newRegDate;
  }
  /**
   * Sets the id of the shop
   *
   * @return <b>newId</b> id
   */
  public void setId(String newId) {
    id = newId;
  }
  /**
   * Sets the status of the shop
   *
   * @param <b>newStatus</b> new status of the shop P-pending,R-Rejected,
   *        A-Approved,D-Discontinued
   */
  public void setStatus(String newStatus) {
    status = newStatus;
  }
  /**
   * Returns a list of shop details in different languages
   *
   * @return <b>List</b> list of ShopDetail objects
   */
  public List getShopDetails() {

    return shopDetails;
  }
  /**
   * Sets a list of shop details in different languages
   *
   * @param <b>details</b> list of ShopDetail objects
   */
  public void setShopDetails(List details) {
    shopDetails = details;
  }
  /**
   * Gets a shop detail at the provided index in the list of details
   *
   * @param <b>i</b> index
   *
   * @return <b>ShopDetail</b> ShopDetail object, null if its not there
   */
  public ShopDetail getShopDetail(int i) {

    if(shopDetails == null) {

      return null;
    }

    return (ShopDetail) shopDetails.get(i);
  }
  /**
   * Removes a shop detail at the provided index, from the list of details
   *
   * @param <b>i</b> index
   */
  public void removeShopDetail(int i) {

    if(shopDetails == null) {

      return;
    }

    shopDetails.remove(i);
  }
  /**
   * Adds a shop detail to the list of details
   *
   * @param <b>detail</b> ShopDetail object
   */
  public void addShopDetail(ShopDetail detail) {

    if(shopDetails == null) {
      shopDetails = new ArrayList();
    }

    shopDetails.add(detail);
  }
  /**
   * Gets the  shop detail for a given language from the list of details
   *
   * @param <b>langID</b> language id
   *
   * @return <b>ShopDetail</b> ShopDetail object, null if its not present
   */
  public ShopDetail getShopDetail(String langID) {

    if(shopDetails == null) {

      return null;
    }

    for(int i = 0; i < shopDetails.size(); i++) {

      if(langID.equals(((ShopDetail) shopDetails.get(i)).getLangId())) {

        return (ShopDetail) shopDetails.get(i);
      }
    }

    return null;
  }
}

⌨️ 快捷键说明

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