All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.moip.resource.Order Maven / Gradle / Ivy

There is a newer version: 4.7.6
Show newest version
package br.com.moip.resource;

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

public class Order {

    private String id;
    private Amount amount;
    private String ownId;
    private final List items;
    private Customer customer;
    private final List receivers = new ArrayList<>();

    public String getId() {
        return id;
    }

    public Amount getAmount() {
        return amount;
    }

    public String getOwnId() {
        return ownId;
    }

    public List getItems() {
        return items;
    }

    public Customer getCustomer() {
        return customer;
    }

    public List getReceivers() {
        return receivers;
    }

    public Order(){
        items = new ArrayList();
    }

    protected Order(final Order order){
        this.id = order.getId();
        this.amount = order.getAmount();
        this.ownId = order.getOwnId();
        this.customer = order.getCustomer();
        this.items = order.getItems();
    }

    @Override
    public String toString() {
        return new StringBuilder("Order{")
                .append("id='").append(id).append('\'')
                .append(", amount=").append(amount)
                .append(", ownId='").append(ownId).append('\'')
                .append(", items=").append(items)
                .append(", customer=").append(customer)
                .append(", receivers=").append(receivers)
                .append('}').toString();
    }

    public static final class Item {
        private String product;
        private Integer quantity;
        private String detail;
        private Integer price;

        public String getProduct() {
            return product;
        }

        public Integer getQuantity() {
            return quantity;
        }

        public String getDetail() {
            return detail;
        }

        public Integer getPrice() {
            return price;
        }

        @Override
        public String toString() {
            return new StringBuilder("Item{")
                    .append("product='").append(product).append('\'')
                    .append(", quantity=").append(quantity)
                    .append(", detail='").append(detail).append('\'')
                    .append(", price=").append(price)
                    .append('}').toString();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy