package DesignPatterns.Erzeugungsmuster_CreationalPatterns.BuilderPatter;

public class Student {

	private String name;
	private String vorname;
	
	public Student() {
		
	}
	
	private Student(BuildStu b) {
		this.name = b.name;
		this.vorname = b.vorname;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getVorname() {
		return vorname;
	}

	public void setVorname(String vorname) {
		this.vorname = vorname;
	}

	

	public static class BuildStu{
		private String name;
		private String vorname;
		
		public BuildStu setname(String name) {
			
			this.name = name;
			return this;
		}
		
		public BuildStu setvorname(String vorname) {
			
			this.vorname = vorname;
			return this;
		}
		
		public Student builder() {
			
			return new Student(this);
		}
		
	}
	
	public class Test{
		int i =2 ;
	}
	
  	public static void main(String[] args) {
  		int i = 2;
  		Student s = new Student.BuildStu()
  				.setname("obai")
  				.setvorname("omar")
  				.builder();
  		
  		Student.Test test = new Student().new Test();
  	}
}
