/**
 * Copyright (c) 2010-2014, openHAB.org and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.openhab.binding.zwave.internal.config;

import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamImplicit;

/**
 * Implements the top level class for the product file
 * @author Chris Jackson
 * @since 1.4.0
 *
 */
public class ZWaveDbProductFile {
	public String Model;
	public Integer Endpoints;
	@XStreamImplicit
	public List<ZWaveDbLabel> Label;

	public ZWaveDbCommandClassList CommandClasses;

	public ZWaveDbConfiguration Configuration;
	public ZWaveDbAssociation Associations;

	List<ZWaveDbConfigurationParameter> getConfiguration() {
		return Configuration.Parameter;
	}
	
	List<ZWaveDbAssociationGroup> getAssociations() {
		return Associations.Group;
	}

	class ZWaveDbCommandClassList {
		@XStreamImplicit
		public List<ZWaveDbCommandClass> Class;		
	}
	
	class ZWaveDbConfiguration {
		@XStreamImplicit
		public List<ZWaveDbConfigurationParameter> Parameter;		
	}

	class ZWaveDbAssociation {
		@XStreamImplicit
		List<ZWaveDbAssociationGroup> Group;
	}
}
	

@@ -354,16 +354,46 @@
 onfig;%0A%0A
+import java.util.Collections;%0A
 import j
@@ -908,22 +908,156 @@
 n() %7B%0A%09%09
-return
+final List%3CZWaveDbConfigurationParameter%3E params;%0A%09%09if (Configuration == null) %7B%0A%09%09%09params = Collections.emptyList();%0A%09%09%7D else %7B%0A%09%09%09params =
  Configu
@@ -1074,16 +1074,37 @@
 ameter;%0A
+%09%09%7D%0A%09%09return params;%0A
 %09%7D%0A%09%0A%09Li
@@ -1157,33 +1157,181 @@
 %7B%0A%09%09
-return Associations.Group
+final List%3CZWaveDbAssociationGroup%3E groups;%0A%09%09if (Associations == null) %7B%0A%09%09%09groups = Collections.emptyList();%0A%09%09%7D else %7B%0A%09%09%09groups = Associations.Group;%0A%09%09%7D%0A%09%09return groups
 ;%0A%09%7D

Add null checks to ZWaveDbProductFile