View Javadoc
1   package org.kuali.common.util.validate.hibernate;
2   
3   import java.util.List;
4   
5   import javax.validation.constraints.Min;
6   import javax.validation.constraints.Size;
7   
8   import org.kuali.common.util.validate.NoBlanks;
9   import org.kuali.common.util.validate.NoNullFields;
10  
11  import com.google.common.collect.ImmutableList;
12  
13  @ValidPassengerCount
14  @NoNullFields
15  @NoBlanks
16  public class Car {
17  
18  	private final String manufacturer;
19  
20  	@Size(min = 2, max = 14)
21  	@CheckCase(value = CaseMode.UPPER, message = "{CheckCase.Car.licensePlate}")
22  	private String licensePlate;
23  
24  	@Min(2)
25  	private final int seatCount;
26  
27  	private final List<String> passengers;
28  
29  	public Car(String manufacturer, String licensePlate, int seatCount) {
30  		this(manufacturer, licensePlate, seatCount, ImmutableList.<String> of());
31  	}
32  
33  	public Car(String manufacturer, String licensePlate, int seatCount, List<String> passengers) {
34  		this.manufacturer = manufacturer;
35  		this.licensePlate = licensePlate;
36  		this.seatCount = seatCount;
37  		this.passengers = ImmutableList.copyOf(passengers);
38  	}
39  
40  	public String getLicensePlate() {
41  		return licensePlate;
42  	}
43  
44  	public void setLicensePlate(String licensePlate) {
45  		this.licensePlate = licensePlate;
46  	}
47  
48  	public String getManufacturer() {
49  		return manufacturer;
50  	}
51  
52  	public int getSeatCount() {
53  		return seatCount;
54  	}
55  
56  	public List<String> getPassengers() {
57  		return passengers;
58  	}
59  
60  }