gt: 		int errorCount = listOfErrors.size();
context: //#############################################################################
  //#                                                                           #
  //#  Copyright (C) <2015>  <IMS MAXIMS>                                       #
  //#                                                                           #
  //#  This program is free software: you can redistribute it and/or modify     #
  //#  it under the terms of the GNU Affero General Public License as           #
  //#  published by the Free Software Foundation, either version 3 of the       #
  //#  License, or (at your option) any later version.                          # 
  //#                                                                           #
  //#  This program 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 Affero General Public License for more details.                      #
  //#                                                                           #
  //#  You should have received a copy of the GNU Affero General Public License #
  //#  along with this program.  If not, see <http://www.gnu.org/licenses/>.    #
  //#                                                                           #
  //#  IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of    #
  //#  this program.  Users of this software do so entirely at their own risk.  #
  //#  IMS MAXIMS only ensures the Clinical Safety of unaltered run-time        #
  //#  software that it builds, deploys and maintains.                          #
  //#                                                                           #
  //#############################################################################
  //#EOH
  // This code was generated by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
  // Copyright (C) 1995-2015 IMS MAXIMS. All rights reserved.
  // WARNING: DO NOT MODIFY the content of this file
  
  package ims.scheduling.vo;
  
  /**
   * Linked to Scheduling.DirectoryOfServiceSessionSlot business object (ID: 1090100003).
   */
  public class DirectoryOfServiceSessionSlotVo extends ims.scheduling.vo.DirectoryOfServiceSessionSlotRefVo implements ims.vo.ImsCloneable, Comparable
  {
  	private static final long serialVersionUID = 1L;
  
  	public DirectoryOfServiceSessionSlotVo()
  	{
  	}
  	public DirectoryOfServiceSessionSlotVo(Integer id, int version)
  	{
  		super(id, version);
  	}
  	public DirectoryOfServiceSessionSlotVo(ims.scheduling.vo.beans.DirectoryOfServiceSessionSlotVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.directoryofservice = bean.getDirectoryOfService() == null ? null : bean.getDirectoryOfService().buildVo();
  		this.slot = bean.getSlot() == null ? null : new ims.scheduling.vo.Session_SlotRefVo(new Integer(bean.getSlot().getId()), bean.getSlot().getVersion());
  		this.usrn = bean.getUSRN();
  		this.ubrn = bean.getUBRN();
  		this.ispublished = bean.getIsPublished();
  	}
  	public void populate(ims.vo.ValueObjectBeanMap map, ims.scheduling.vo.beans.DirectoryOfServiceSessionSlotVoBean bean)
  	{
  		this.id = bean.getId();
  		this.version = bean.getVersion();
  		this.directoryofservice = bean.getDirectoryOfService() == null ? null : bean.getDirectoryOfService().buildVo(map);
  		this.slot = bean.getSlot() == null ? null : new ims.scheduling.vo.Session_SlotRefVo(new Integer(bean.getSlot().getId()), bean.getSlot().getVersion());
  		this.usrn = bean.getUSRN();
  		this.ubrn = bean.getUBRN();
  		this.ispublished = bean.getIsPublished();
  	}
  	public ims.vo.ValueObjectBean getBean()
  	{
  		return this.getBean(new ims.vo.ValueObjectBeanMap());
  	}
  	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
  	{
  		ims.scheduling.vo.beans.DirectoryOfServiceSessionSlotVoBean bean = null;
  		if(map != null)
  			bean = (ims.scheduling.vo.beans.DirectoryOfServiceSessionSlotVoBean)map.getValueObjectBean(this);
  		if (bean == null)
  		{
  			bean = new ims.scheduling.vo.beans.DirectoryOfServiceSessionSlotVoBean();
  			map.addValueObjectBean(this, bean);
  			bean.populate(map, this);
  		}
  		return bean;
  	}
  	public Object getFieldValueByFieldName(String fieldName)
  	{
  		if(fieldName == null)
  			throw new ims.framework.exceptions.CodingRuntimeException("Invalid field name");
  		fieldName = fieldName.toUpperCase();
  		if(fieldName.equals("DIRECTORYOFSERVICE"))
  			return getDirectoryOfService();
  		if(fieldName.equals("SLOT"))
  			return getSlot();
  		if(fieldName.equals("USRN"))
  			return getUSRN();
  		if(fieldName.equals("UBRN"))
  			return getUBRN();
  		if(fieldName.equals("ISPUBLISHED"))
  			return getIsPublished();
  		return super.getFieldValueByFieldName(fieldName);
  	}
  	public boolean getDirectoryOfServiceIsNotNull()
  	{
  		return this.directoryofservice != null;
  	}
  	public ims.scheduling.vo.DirectoryOfServiceLiteVo getDirectoryOfService()
  	{
  		return this.directoryofservice;
  	}
  	public void setDirectoryOfService(ims.scheduling.vo.DirectoryOfServiceLiteVo value)
  	{
  		this.isValidated = false;
  		this.directoryofservice = value;
  	}
  	public boolean getSlotIsNotNull()
  	{
  		return this.slot != null;
  	}
  	public ims.scheduling.vo.Session_SlotRefVo getSlot()
  	{
  		return this.slot;
  	}
  	public void setSlot(ims.scheduling.vo.Session_SlotRefVo value)
  	{
  		this.isValidated = false;
  		this.slot = value;
  	}
  	public boolean getUSRNIsNotNull()
  	{
  		return this.usrn != null;
  	}
  	public String getUSRN()
  	{
  		return this.usrn;
  	}
  	public static int getUSRNMaxLength()
  	{
  		return 100;
  	}
  	public void setUSRN(String value)
  	{
  		this.isValidated = false;
  		this.usrn = value;
  	}
  	public boolean getUBRNIsNotNull()
  	{
  		return this.ubrn != null;
  	}
  	public String getUBRN()
  	{
  		return this.ubrn;
  	}
  	public static int getUBRNMaxLength()
  	{
  		return 100;
  	}
  	public void setUBRN(String value)
  	{
  		this.isValidated = false;
  		this.ubrn = value;
  	}
  	public boolean getIsPublishedIsNotNull()
  	{
  		return this.ispublished != null;
  	}
  	public Boolean getIsPublished()
  	{
  		return this.ispublished;
  	}
  	public void setIsPublished(Boolean value)
  	{
  		this.isValidated = false;
  		this.ispublished = value;
  	}
  	public boolean isValidated()
  	{
  		if(this.isBusy)
  			return true;
  		this.isBusy = true;
  	
  		if(!this.isValidated)
  		{
  			this.isBusy = false;
  			return false;
  		}
  		if(this.directoryofservice != null)
  		{
  			if(!this.directoryofservice.isValidated())
  			{
  				this.isBusy = false;
  				return false;
  			}
  		}
  		this.isBusy = false;
  		return true;
  	}
  	public String[] validate()
  	{
  		return validate(null);
  	}
  	public String[] validate(String[] existingErrors)
  	{
  		if(this.isBusy)
  			return null;
  		this.isBusy = true;
  	
  		java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
  		if(existingErrors != null)
  		{
  			for(int x = 0; x < existingErrors.length; x++)
  			{
  				listOfErrors.add(existingErrors[x]);
  			}
  		}
  		if(this.directoryofservice != null)
  		{
  			String[] listOfOtherErrors = this.directoryofservice.validate();
  			if(listOfOtherErrors != null)
  			{
  				for(int x = 0; x < listOfOtherErrors.length; x++)
  				{
  					listOfErrors.add(listOfOtherErrors[x]);
  				}
  			}
  		}
  		if(this.usrn != null)
  			if(this.usrn.length() > 100)
  				listOfErrors.add("The length of the field [usrn] in the value object [ims.scheduling.vo.DirectoryOfServiceSessionSlotVo] is too big. It should be less or equal to 100");
  		if(this.ubrn != null)
  			if(this.ubrn.length() > 100)
  				listOfErrors.add("The length of the field [ubrn] in the value object [ims.scheduling.vo.DirectoryOfServiceSessionSlotVo] is too big. It should be less or equal to 100");
  