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

org.hibernate.beanvalidation.tck.tests.validation.graphnavigation.Order Maven / Gradle / Ivy

The newest version!
/**
 * Jakarta Bean Validation TCK
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or .
 */
package org.hibernate.beanvalidation.tck.tests.validation.graphnavigation;

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

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;

/**
 * @author Hardy Ferentschik
 */
public class Order {
	@NotNull
	Integer orderId;

	@Valid
	private List orderLines = new ArrayList();

	@Valid
	private User customer;

	@Valid
	private Address shippingAddress;

	@Valid
	private Address billingAddress;

	public Order(Integer id) {
		orderId = id;
	}

	public void addOrderLine(OrderLine orderLine) {
		orderLines.add( orderLine );
	}

	public List getOrderLines() {
		return Collections.unmodifiableList( orderLines );
	}

	public User getCustomer() {
		return customer;
	}

	public void setCustomer(User customer) {
		this.customer = customer;
	}

	public Address getShippingAddress() {
		return shippingAddress;
	}

	public void setShippingAddress(Address shippingAddress) {
		this.shippingAddress = shippingAddress;
	}

	public Address getBillingAddress() {
		return billingAddress;
	}

	public void setBillingAddress(Address billingAddress) {
		this.billingAddress = billingAddress;
	}

	@Override
	public String toString() {
		return "Order{" +
				"orderId=" + orderId +
				", orderLines=" + orderLines +
				", customer=" + customer +
				", shippingAddress=" + shippingAddress +
				", billingAddress=" + billingAddress +
				'}';
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy