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

📄 internetassociatedproduct.java

📁 Sample Hibernate Shopping Cart Application
💻 JAVA
字号:
/*
 * @(#)InternetAssociatedProduct.java $LastChangedRevision$ $LastChangedDate$
 * Created on Apr 5, 2005
 *
 * Copyright (c) 2005, Daniel Watrous
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or 
 * without modification, are governed by the license found in
 * the following places:
 * license.txt included with this distribution, or
 * http://www.simplecart.org/license.html
 * 
 */
package org.simplecart.shopcart.catalog;

import org.apache.log4j.Category;

/**
 * @version		$LastChangedRevision$ $LastChangedDate$
 * @author 		Daniel Watrous
 * 
 */
public class InternetAssociatedProduct extends InternetAssociation {
	
    private ProductCategory productCategory;
    private Product product;
    private static Category cat = Category.getInstance(InternetAssociatedProduct.class.getName());
    
    /**
     * No-arg constructor for JavaBean tools
     */
	InternetAssociatedProduct() {}
    
	/**
	 * Full constructor;
	 */
	public InternetAssociatedProduct(ProductCategory productCategory, Product product) {
	    this.productCategory = productCategory;
	    this.product = product;
	}
    
    // JavaBean style accessors/mutators
    public ProductCategory getProductCategory() {
        return productCategory;
    }

    public Product getProduct() {
        return product;
    }
    
    public boolean equals(Object obj) {
        cat.debug("Enter Equals method for InternetAssociatedProduct class.");
        if (this == obj) return true;
        InternetAssociatedProduct checkObj = (InternetAssociatedProduct) obj;
        cat.debug("Product in this: " + this.getProduct().getName());
        cat.debug("Product in checkObj: " + checkObj.getProduct().getName());
        cat.debug("ProductCategory in this: " + this.getProductCategory().getName());
        cat.debug("ProductCategory in checkObj: " + checkObj.getProductCategory().getName());
        if (this.product == checkObj.getProduct() && this.productCategory == checkObj.getProductCategory()) return true;
        return false;
    }
}

⌨️ 快捷键说明

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