JAVAWEB网上商城项目实现之POJO类设计------JAVA

该文章详细描述了几个JavaBean类,包括order类(包含地址、商品映射和状态)、product类(产品属性和状态)以及shoppingCart类(用于存储商品的哈希映射)。这些类展示了在电商或订单管理中常见的数据结构设计。
摘要由CSDN通过智能技术生成
package bean;

import java.util.HashMap;
import Enum.orderEnum;

public class order
{
    private String address;
    private HashMap<product,Integer> Cart = new HashMap<>();
    private orderEnum statue;

    public order() {}

    public order(String address, HashMap<product, Integer> cart, orderEnum statue)
    {
        this.address = address;
        Cart = cart;
        this.statue = statue;
    }

    public String getAddress()
    {
        return address;
    }

    public void setAddress(String address)
    {
        this.address = address;
    }

    public HashMap<product, Integer> getCart()
    {
        return Cart;
    }

    public void setCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }

    public orderEnum getStatue()
    {
        return statue;
    }

    public void setStatue(orderEnum statue)
    {
        this.statue = statue;
    }
}
package bean;

import java.util.HashMap;
import Enum.orderEnum;

public class order
{
    private String address;
    private HashMap<product,Integer> Cart = new HashMap<>();
    private orderEnum statue;

    public order() {}

    public order(String address, HashMap<product, Integer> cart, orderEnum statue)
    {
        this.address = address;
        Cart = cart;
        this.statue = statue;
    }

    public String getAddress()
    {
        return address;
    }

    public void setAddress(String address)
    {
        this.address = address;
    }

    public HashMap<product, Integer> getCart()
    {
        return Cart;
    }

    public void setCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }

    public orderEnum getStatue()
    {
        return statue;
    }

    public void setStatue(orderEnum statue)
    {
        this.statue = statue;
    }
}
package bean;

import java.util.HashMap;
import Enum.orderEnum;

public class order
{
    private String address;
    private HashMap<product,Integer> Cart = new HashMap<>();
    private orderEnum statue;

    public order() {}

    public order(String address, HashMap<product, Integer> cart, orderEnum statue)
    {
        this.address = address;
        Cart = cart;
        this.statue = statue;
    }

    public String getAddress()
    {
        return address;
    }

    public void setAddress(String address)
    {
        this.address = address;
    }

    public HashMap<product, Integer> getCart()
    {
        return Cart;
    }

    public void setCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }

    public orderEnum getStatue()
    {
        return statue;
    }

    public void setStatue(orderEnum statue)
    {
        this.statue = statue;
    }
}

package bean;

import java.util.HashMap;
import Enum.orderEnum;

public class order
{
    private String address;
    private HashMap<product,Integer> Cart = new HashMap<>();
    private orderEnum statue;

    public order() {}

    public order(String address, HashMap<product, Integer> cart, orderEnum statue)
    {
        this.address = address;
        Cart = cart;
        this.statue = statue;
    }

    public String getAddress()
    {
        return address;
    }

    public void setAddress(String address)
    {
        this.address = address;
    }

    public HashMap<product, Integer> getCart()
    {
        return Cart;
    }

    public void setCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }

    public orderEnum getStatue()
    {
        return statue;
    }

    public void setStatue(orderEnum statue)
    {
        this.statue = statue;
    }
}
package bean;

import Enum.ProductStatue;

public class product
{
    private String product_name;
    private String brand_name;
    private int amount;
    private double price;
    private String description;
    private String type_name;
    private ProductStatue statue;
    public product() {}
    public product(String product_name)
    {
        this.product_name = product_name;
    }
    public product(String product_name, String brand_name, int amount, double price, String description, String type_name, ProductStatue statue) {
        this.product_name = product_name;
        this.brand_name = brand_name;
        this.amount = amount;
        this.price = price;
        this.description = description;
        this.type_name = type_name;
        this.statue = statue;
    }
    public String getProduct_name() {
        return product_name;
    }
    public void setProduct_name(String product_name) {
        this.product_name = product_name;
    }
    public String getBrand_name() {
        return brand_name;
    }
    public void setBrand_name(String brand_name) {
        this.brand_name = brand_name;
    }
    public int getAmount() {
        return amount;
    }
    public void setAmount(int amount) {
        this.amount = amount;
    }
    public double getPrice() {return price;}
    public void setPrice(double price) {
        this.price = price;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getType_name() {
        return type_name;
    }
    public ProductStatue getStatue()
    {
        return statue;
    }
    public void setStatue(ProductStatue statue)
    {
        this.statue = statue;
    }
    public void setType_name(String type_name) {
        this.type_name = type_name;
    }
}

package bean;

import Enum.ProductStatue;

public class product
{
    private String product_name;
    private String brand_name;
    private int amount;
    private double price;
    private String description;
    private String type_name;
    private ProductStatue statue;
    public product() {}
    public product(String product_name)
    {
        this.product_name = product_name;
    }
    public product(String product_name, String brand_name, int amount, double price, String description, String type_name, ProductStatue statue) {
        this.product_name = product_name;
        this.brand_name = brand_name;
        this.amount = amount;
        this.price = price;
        this.description = description;
        this.type_name = type_name;
        this.statue = statue;
    }
    public String getProduct_name() {
        return product_name;
    }
    public void setProduct_name(String product_name) {
        this.product_name = product_name;
    }
    public String getBrand_name() {
        return brand_name;
    }
    public void setBrand_name(String brand_name) {
        this.brand_name = brand_name;
    }
    public int getAmount() {
        return amount;
    }
    public void setAmount(int amount) {
        this.amount = amount;
    }
    public double getPrice() {return price;}
    public void setPrice(double price) {
        this.price = price;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getType_name() {
        return type_name;
    }
    public ProductStatue getStatue()
    {
        return statue;
    }
    public void setStatue(ProductStatue statue)
    {
        this.statue = statue;
    }
    public void setType_name(String type_name) {
        this.type_name = type_name;
    }
}
package bean;

import java.util.HashMap;

public class shoppingCart
{
    private HashMap<product,Integer> Cart = new HashMap<>();
    public shoppingCart() {}

    public shoppingCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }

    public HashMap<product, Integer> getCart()
    {
        return Cart;
    }
    public void setCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }
}

package bean;

import java.util.HashMap;

public class shoppingCart
{
    private HashMap<product,Integer> Cart = new HashMap<>();
    public shoppingCart() {}

    public shoppingCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }

    public HashMap<product, Integer> getCart()
    {
        return Cart;
    }
    public void setCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }
}
package bean;

import java.util.HashMap;

public class shoppingCart
{
    private HashMap<product,Integer> Cart = new HashMap<>();
    public shoppingCart() {}

    public shoppingCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }

    public HashMap<product, Integer> getCart()
    {
        return Cart;
    }
    public void setCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }
}

package bean;

import java.util.HashMap;

public class shoppingCart
{
    private HashMap<product,Integer> Cart = new HashMap<>();
    public shoppingCart() {}

    public shoppingCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }

    public HashMap<product, Integer> getCart()
    {
        return Cart;
    }
    public void setCart(HashMap<product, Integer> cart)
    {
        Cart = cart;
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值