001/* 002 * Copyright 2018 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.batch.sample.validation.domain; 018 019import javax.validation.constraints.NotEmpty; 020 021/** 022 * @author Mahmoud Ben Hassine 023 */ 024public class Person { 025 026 private int id; 027 028 @NotEmpty 029 private String name; 030 031 public Person() { 032 } 033 034 public Person(int id, String name) { 035 this.id = id; 036 this.name = name; 037 } 038 039 public int getId() { 040 return id; 041 } 042 043 public void setId(int id) { 044 this.id = id; 045 } 046 047 public String getName() { 048 return name; 049 } 050 051 public void setName(String name) { 052 this.name = name; 053 } 054 055 @Override 056 public String toString() { 057 return "Person{" + 058 "id=" + id + 059 ", name='" + name + '\'' + 060 '}'; 061 } 062}