/**
 * Copyright 2009 - 2015 J&#246;rgen Lundgren
 * 
 * This file is part of org.macroing.actor.
 * 
 * org.macroing.actor is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * org.macroing.actor is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with org.macroing.actor. If not, see <http://www.gnu.org/licenses/>.
 */
package org.macroing.actor;

import java.util.Objects;

public final class SimpleScript extends Script {
	private SimpleScript(final Builder<?> builder) {
		super(builder);
	}
	
	public static final class SimpleBuilder extends Builder<SimpleScript> {
		private SimpleBuilder(final Builder<SimpleScript> parent) {
			super(parent);
		}
		
		private SimpleBuilder(final Builder<SimpleScript> parent, final String label) {
			super(parent, label);
		}
		
		@Override
		protected SimpleBuilder doEnter(final Builder<SimpleScript> parent, final String label) {
			return new SimpleBuilder(parent, label);
		}
		
		@Override
		public SimpleScript build() {
			SimpleScript simpleScript = new SimpleScript(this);
			simpleScript.initialize();
			
			return simpleScript;
		}
		
		public static SimpleBuilder newInstance() {
			return new SimpleBuilder(null);
		}
		
		public static SimpleBuilder newInstance(final String label) {
			return new SimpleBuilder(null, Objects.requireNonNull(label, "label == null"));
		}
	}
}