/*
* Copyright (c) 2013 Cisco Systems, Inc. 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.opendaylight.protocol.pcep.spi;

import java.util.Arrays;
import java.util.List;

import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcep.error.object.ErrorObjectBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcerr.message.pcerr.message.Errors;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcerr.message.pcerr.message.ErrorsBuilder;
import org.opendaylight.yangtools.yang.binding.DataContainer;

public class UnknownObject implements Object {

	private final Errors error;

	private final PCEPErrors e;

	public UnknownObject(final PCEPErrors error) {
		final PCEPErrorMapping mapping = PCEPErrorMapping.getInstance();
		this.e = error;
		this.error = new ErrorsBuilder().setErrorObject(
				new ErrorObjectBuilder().setType(mapping.getFromErrorsEnum(error).type).setValue(mapping.getFromErrorsEnum(error).value).build()).build();
	}

	public List<Errors> getErrors() {
		return Arrays.asList(this.error);
	}

	public PCEPErrors getError() {
		return this.e;
	}

	@Override
	public Class<? extends DataContainer> getImplementedInterface() {
		return Object.class;
	}

	@Override
	public Boolean isIgnore() {
		return false;
	}

	@Override
	public Boolean isProcessingRule() {
		return false;
	}
}
@@ -1,11 +1,12 @@
 /*%0A
+ 
 * Copyri
@@ -71,18 +71,20 @@
 served.%0A
+ 
 *%0A
+ 
 * This p
@@ -150,16 +150,17 @@
 der the%0A
+ 
 * terms 
@@ -231,16 +231,17 @@
 bution,%0A
+ 
 * and is
@@ -296,16 +296,17 @@
 10.html%0A
+ 
 */%0Apacka
@@ -954,22 +954,235 @@
 ainer;%0A%0A
-public
+import com.google.common.base.Preconditions;%0A%0A/**%0A * Placeholder object. This object should be injected by in positions where an%0A * object is either completely unknown or has failed semantic validation.%0A */%0Apublic final
  class U
@@ -1214,16 +1214,52 @@
 bject %7B%0A
+%09private final Object invalidObject;
 %0A%09privat
@@ -1280,17 +1280,16 @@
  error;%0A
-%0A
 %09private
@@ -1358,16 +1358,164 @@
 rror) %7B%0A
+%09%09this(error, null);%0A%09%7D%0A%0A%09public UnknownObject(final PCEPErrors error, final Object invalidObject) %7B%0A%09%09this.e = Preconditions.checkNotNull(error);%0A%0A
 %09%09final 
@@ -1577,26 +1577,8 @@
 ();%0A
-%09%09this.e = error;%0A
 %09%09th
@@ -1767,16 +1767,54 @@
 uild();%0A
+%09%09this.invalidObject = invalidObject;%0A
 %09%7D%0A%0A%09pub
@@ -1933,24 +1933,93 @@
 this.e;%0A%09%7D%0A%0A
+%09public Object getInvalidObject() %7B%0A%09%09return this.invalidObject;%0A%09%7D%0A%0A
 %09@Override%0A%09

Add invalid object parameter for use with semantic checks