From 8aa18bd1e5473fed555a3269060bc7694df5b1c6 Mon Sep 17 00:00:00 2001 From: Martin Vitez Date: Thu, 13 Mar 2014 13:00:30 +0100 Subject: [PATCH] Fix for Bug 511 (yang) Removed \r characters from all projects under yang directory. Change-Id: I46a47d523449bc159ea508143d9a06726f8259ff Signed-off-by: Martin Vitez --- .../yangtools/yang/binding/Augmentable.java | 68 +++--- .../yangtools/yang/binding/Augmentation.java | 52 ++--- .../yangtools/yang/binding/BaseIdentity.java | 46 ++-- .../yangtools/yang/binding/DataContainer.java | 58 ++--- .../yangtools/yang/binding/DataObject.java | 40 ++-- .../yangtools/yang/binding/DataRoot.java | 32 +-- .../yangtools/yang/binding/Identifiable.java | 52 ++--- .../yangtools/yang/binding/Identifier.java | 44 ++-- .../yangtools/yang/binding/Notification.java | 34 +-- .../yang/binding/NotificationListener.java | 56 ++--- .../yang/binding/RpcImplementation.java | 44 ++-- .../yangtools/yang/binding/RpcInput.java | 24 +- .../yangtools/yang/binding/RpcService.java | 32 +-- .../binding/annotations/RoutingContext.java | 40 ++-- .../yangtools/yang/binding/package-info.java | 14 +- .../binding/test/InstanceIdentifierTest.java | 218 +++++++++--------- .../yang/binding/test/mock/FooChild.java | 14 +- .../yang/binding/test/mock/GroupingFoo.java | 10 +- .../binding/test/mock/InstantiatedFoo.java | 16 +- .../yang/binding/test/mock/Node.java | 24 +- .../yang/binding/test/mock/NodeChild.java | 24 +- .../yang/binding/test/mock/NodeChildKey.java | 80 +++---- .../yang/binding/test/mock/NodeKey.java | 80 +++---- .../yang/binding/test/mock/Nodes.java | 22 +- 24 files changed, 562 insertions(+), 562 deletions(-) diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentable.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentable.java index 340bd5b46d..c562a77d4f 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentable.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentable.java @@ -1,34 +1,34 @@ -/* - * 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.yangtools.yang.binding; - -/** - * Augmentable (extensible) object which could carry additional data defined by - * third-party extension, without introducing conflict between various - * extension. - * - * This interface uses extended version of ExtensibleInterface pattern which - * also adds marker interface for augmentations (extensions) - - * {@link Augmentable} - * - * @author Tony Tkacik - * @param - * Base class which should implements this interface and is target - * for augmentation. - */ -public interface Augmentable { - - /** - * Returns instance of augmentation. - * - * @param augmentationType - * Type of augmentation to be returned. - * @return instance of augmentation. - */ - > E getAugmentation(Class augmentationType); -} +/* + * 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.yangtools.yang.binding; + +/** + * Augmentable (extensible) object which could carry additional data defined by + * third-party extension, without introducing conflict between various + * extension. + * + * This interface uses extended version of ExtensibleInterface pattern which + * also adds marker interface for augmentations (extensions) - + * {@link Augmentable} + * + * @author Tony Tkacik + * @param + * Base class which should implements this interface and is target + * for augmentation. + */ +public interface Augmentable { + + /** + * Returns instance of augmentation. + * + * @param augmentationType + * Type of augmentation to be returned. + * @return instance of augmentation. + */ + > E getAugmentation(Class augmentationType); +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentation.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentation.java index a89f030cdb..cb6f1a1e75 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentation.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Augmentation.java @@ -1,26 +1,26 @@ -/* - * 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.yangtools.yang.binding; - -/** - * Augmentation (extension) of other interface. - * - * This interface uniquely bounds Augmentation to generated - * interface. - * - * All interfaces generated from YANG Augmentation statement - * must implement this interface with parameter P - * which uniquely points to it's target class. - * - * - * - * @param Class to which this implementation is extension. - */ -public interface Augmentation { - -} +/* + * 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.yangtools.yang.binding; + +/** + * Augmentation (extension) of other interface. + * + * This interface uniquely bounds Augmentation to generated + * interface. + * + * All interfaces generated from YANG Augmentation statement + * must implement this interface with parameter P + * which uniquely points to it's target class. + * + * + * + * @param Class to which this implementation is extension. + */ +public interface Augmentation { + +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/BaseIdentity.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/BaseIdentity.java index 0c4a7beaf1..9f55b64d52 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/BaseIdentity.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/BaseIdentity.java @@ -1,23 +1,23 @@ -/* - * 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.yangtools.yang.binding; - -/** - * Base Identity - * - */ -public abstract class BaseIdentity { - - public final static BaseIdentity INSTANCE = new BaseIdentity() { - }; - - protected BaseIdentity() { - - } - -} +/* + * 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.yangtools.yang.binding; + +/** + * Base Identity + * + */ +public abstract class BaseIdentity { + + public final static BaseIdentity INSTANCE = new BaseIdentity() { + }; + + protected BaseIdentity() { + + } + +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataContainer.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataContainer.java index 67b20dd1f2..0e1937d2bc 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataContainer.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataContainer.java @@ -1,29 +1,29 @@ -/* - * 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.yangtools.yang.binding; - -/** - * Data Container - object contains structured data - * - * Marker interface which must be implmeneted by all interfaces - * generated for YANG: - *
    - *
  • Rpc Input - *
  • Output - *
  • Notification - *
  • Container - *
  • List - *
  • Case - *
- * - * - */ -public interface DataContainer { - - public Class getImplementedInterface(); -} +/* + * 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.yangtools.yang.binding; + +/** + * Data Container - object contains structured data + * + * Marker interface which must be implmeneted by all interfaces + * generated for YANG: + *
    + *
  • Rpc Input + *
  • Output + *
  • Notification + *
  • Container + *
  • List + *
  • Case + *
+ * + * + */ +public interface DataContainer { + + public Class getImplementedInterface(); +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataObject.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataObject.java index 62f1030947..b0ca831500 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataObject.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataObject.java @@ -1,20 +1,20 @@ -/* - * 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.yangtools.yang.binding; - -/** - * Data container is an interface which has structured contents. - * - * - * @author Tony Tkacik - * - */ -public interface DataObject extends DataContainer { - - -} +/* + * 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.yangtools.yang.binding; + +/** + * Data container is an interface which has structured contents. + * + * + * @author Tony Tkacik + * + */ +public interface DataObject extends DataContainer { + + +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataRoot.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataRoot.java index 5882b5159e..66fdfdeb90 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataRoot.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/DataRoot.java @@ -1,16 +1,16 @@ -/* - * 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.yangtools.yang.binding; - -/** - * Data Root of YANG module - * - */ -public interface DataRoot { - -} +/* + * 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.yangtools.yang.binding; + +/** + * Data Root of YANG module + * + */ +public interface DataRoot { + +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Identifiable.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Identifiable.java index b5b8e85858..6f45c8cdd5 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Identifiable.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Identifiable.java @@ -1,26 +1,26 @@ -/* - * 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.yangtools.yang.binding; - - -/** - * Identifiable object, which could be identified by it's key - * - * @author ttkacik - * - * @param Identifier class for this object - */ -public interface Identifiable>> { - - /** - * Returns an unique key for the object - * - * @return Key for the object - */ - T getKey(); -} +/* + * 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.yangtools.yang.binding; + + +/** + * Identifiable object, which could be identified by it's key + * + * @author ttkacik + * + * @param Identifier class for this object + */ +public interface Identifiable>> { + + /** + * Returns an unique key for the object + * + * @return Key for the object + */ + T getKey(); +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Identifier.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Identifier.java index 6a2893d9c9..a99b451b6e 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Identifier.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Identifier.java @@ -1,22 +1,22 @@ -/* - * 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.yangtools.yang.binding; - -/** - * - * Object is unique identifier for another object - * - * - * - * @param - * Class of object for which this object is identifier - * @author ttkacik - */ -public interface Identifier> extends org.opendaylight.yangtools.concepts.Identifier { - -} +/* + * 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.yangtools.yang.binding; + +/** + * + * Object is unique identifier for another object + * + * + * + * @param + * Class of object for which this object is identifier + * @author ttkacik + */ +public interface Identifier> extends org.opendaylight.yangtools.concepts.Identifier { + +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Notification.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Notification.java index 677f5869b8..fca5230fbd 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Notification.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Notification.java @@ -1,18 +1,18 @@ -/* - * 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.yangtools.yang.binding; - -/** - * Marker interface for YANG-defined notifications - * - * - */ -public interface Notification extends DataContainer { - -} +/* + * 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.yangtools.yang.binding; + +/** + * Marker interface for YANG-defined notifications + * + * + */ +public interface Notification extends DataContainer { + +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/NotificationListener.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/NotificationListener.java index e01a1ad53b..3a8a786a7f 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/NotificationListener.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/NotificationListener.java @@ -1,28 +1,28 @@ -/* - * 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.yangtools.yang.binding; - -import java.util.EventListener; - -/** - * Marker interface for generated notification listener interfaces - * - *

- * The subclasses of this interface have callbacks for events, which are derived - * from {@link Notification} class in form void - * on{NotificationType}(NotificationType notification). - * - *

- * E.g. if we have notification SessionUp the callback will have signature: - * void onSessionUp(SessionUp notification) - * - * - */ -public interface NotificationListener extends EventListener { - -} +/* + * 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.yangtools.yang.binding; + +import java.util.EventListener; + +/** + * Marker interface for generated notification listener interfaces + * + *

+ * The subclasses of this interface have callbacks for events, which are derived + * from {@link Notification} class in form void + * on{NotificationType}(NotificationType notification). + * + *

+ * E.g. if we have notification SessionUp the callback will have signature: + * void onSessionUp(SessionUp notification) + * + * + */ +public interface NotificationListener extends EventListener { + +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcImplementation.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcImplementation.java index 889049d9e8..4761fddd52 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcImplementation.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcImplementation.java @@ -1,22 +1,22 @@ -/* - * 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.yangtools.yang.binding; - -import java.util.Set; -import java.util.concurrent.Future; - -import org.opendaylight.yangtools.yang.common.RpcResult; - -public interface RpcImplementation { - - // Fixme: Change to RpcInput - Set> getSupportedInputs(); - - // Fixme: Change to RpcInput - Future> invoke(Class type, T input); -} +/* + * 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.yangtools.yang.binding; + +import java.util.Set; +import java.util.concurrent.Future; + +import org.opendaylight.yangtools.yang.common.RpcResult; + +public interface RpcImplementation { + + // Fixme: Change to RpcInput + Set> getSupportedInputs(); + + // Fixme: Change to RpcInput + Future> invoke(Class type, T input); +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcInput.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcInput.java index 546e1baf1e..11b95bdea5 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcInput.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcInput.java @@ -1,12 +1,12 @@ -/* - * 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.yangtools.yang.binding; - -public interface RpcInput extends DataContainer { - -} +/* + * 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.yangtools.yang.binding; + +public interface RpcInput extends DataContainer { + +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcService.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcService.java index 6e6a46d0ee..3757f5e024 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcService.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/RpcService.java @@ -1,16 +1,16 @@ -/* - * 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.yangtools.yang.binding; - -/** - * Marker interface for tagging generated YANG Modules - * - */ -public interface RpcService { - -} +/* + * 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.yangtools.yang.binding; + +/** + * Marker interface for tagging generated YANG Modules + * + */ +public interface RpcService { + +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/RoutingContext.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/RoutingContext.java index 0ee9bf352b..169d9ef825 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/RoutingContext.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/annotations/RoutingContext.java @@ -5,23 +5,23 @@ * 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.yangtools.yang.binding.annotations; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.opendaylight.yangtools.yang.binding.BaseIdentity; - - -@Inherited -@Documented -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface RoutingContext { - - Class value(); -} +package org.opendaylight.yangtools.yang.binding.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.opendaylight.yangtools.yang.binding.BaseIdentity; + + +@Inherited +@Documented +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface RoutingContext { + + Class value(); +} diff --git a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/package-info.java b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/package-info.java index ace08d625e..eee24a978e 100644 --- a/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/package-info.java +++ b/yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/package-info.java @@ -1,8 +1,8 @@ -/* - * 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 - */ +/* + * 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.yangtools.yang.binding; \ No newline at end of file diff --git a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/InstanceIdentifierTest.java b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/InstanceIdentifierTest.java index 544ab5d44d..074624b1e5 100644 --- a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/InstanceIdentifierTest.java +++ b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/InstanceIdentifierTest.java @@ -5,112 +5,112 @@ * 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.yangtools.yang.binding.test; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.opendaylight.yangtools.yang.binding.test.mock.FooChild; -import org.opendaylight.yangtools.yang.binding.test.mock.InstantiatedFoo; -import org.opendaylight.yangtools.yang.binding.test.mock.Node; -import org.opendaylight.yangtools.yang.binding.test.mock.NodeChild; -import org.opendaylight.yangtools.yang.binding.test.mock.NodeChildKey; -import org.opendaylight.yangtools.yang.binding.test.mock.NodeKey; -import org.opendaylight.yangtools.yang.binding.test.mock.Nodes; - -public class InstanceIdentifierTest { - - @Test - public void constructWithPredicates() { - - InstanceIdentifier nodes = InstanceIdentifier.builder(Nodes.class).toInstance(); - - assertNotNull(nodes); - assertEquals(Nodes.class, nodes.getTargetType()); - - - InstanceIdentifier node = InstanceIdentifier.builder(nodes).node(Node.class).toInstance(); - - assertNotNull(node); - assertEquals(Node.class, node.getTargetType()); - - assertTrue(nodes.contains(node)); - } - - @Test - public void fluentConstruction() { - - InstanceIdentifier nodes = InstanceIdentifier.builder(Nodes.class).toInstance(); - InstanceIdentifier node = InstanceIdentifier.builder(Nodes.class).child(Node.class,new NodeKey(10)).toInstance(); - - assertNotNull(node); - assertEquals(Node.class, node.getTargetType()); - - assertTrue(nodes.contains(node)); - } - - - @Test - public void negativeContains() { - InstanceIdentifier fooChild = InstanceIdentifier.builder(Nodes.class).child(InstantiatedFoo.class).child(FooChild.class).build(); - - InstanceIdentifier nodeTen = InstanceIdentifier.builder(Nodes.class) // - .child(Node.class,new NodeKey(10)).toInstance(); - InstanceIdentifier nodeOne = InstanceIdentifier.builder(Nodes.class) // - .child(Node.class,new NodeKey(1)).toInstance(); - InstanceIdentifier nodes = InstanceIdentifier.builder(Nodes.class).toInstance(); - - assertFalse(fooChild.contains(nodeTen)); - assertFalse(nodeTen.contains(nodes)); - - assertFalse(nodeOne.contains(nodes)); - assertTrue(nodes.contains(nodeOne)); - } - - @Test - public void containsWildcarded() { - InstanceIdentifier nodes = InstanceIdentifier.builder(Nodes.class).toInstance(); - InstanceIdentifier wildcarded = InstanceIdentifier.builder(Nodes.class).child(Node.class).build(); - InstanceIdentifier wildcardedChildren = InstanceIdentifier.builder(Nodes.class) // - .child(Node.class) // - .child(NodeChild.class).build(); - - assertTrue(wildcarded.isWildcarded()); - assertTrue(wildcardedChildren.isWildcarded()); - - - InstanceIdentifier nodeTen = InstanceIdentifier.builder(Nodes.class) // - .child(Node.class,new NodeKey(10)).toInstance(); - InstanceIdentifier nodeOne = InstanceIdentifier.builder(Nodes.class) // - .child(Node.class,new NodeKey(1)).toInstance(); - - assertFalse(nodeTen.isWildcarded()); - assertFalse(nodeOne.isWildcarded()); - assertTrue(nodes.containsWildcarded(nodeOne)); - assertTrue(wildcarded.containsWildcarded(nodeOne)); - assertTrue(wildcarded.containsWildcarded(nodeTen)); - - - InstanceIdentifier nodeTenChildWildcarded = InstanceIdentifier.builder(Nodes.class) // - .child(Node.class,new NodeKey(10)).child(NodeChild.class).toInstance(); - - assertTrue(nodeTenChildWildcarded.isWildcarded()); - - InstanceIdentifier nodeTenChild = InstanceIdentifier.builder(Nodes.class) // - .child(Node.class,new NodeKey(10)).child(NodeChild.class, new NodeChildKey(10)).toInstance(); - InstanceIdentifier nodeOneChild = InstanceIdentifier.builder(Nodes.class) // - .child(Node.class,new NodeKey(1)).child(NodeChild.class, new NodeChildKey(1)).toInstance(); - - - assertFalse(nodeTenChildWildcarded.containsWildcarded(nodeOneChild)); - assertTrue(nodeTenChildWildcarded.containsWildcarded(nodeTenChild)); - - } - - - void childOfTest() { - InstanceIdentifier.builder(Nodes.class).child(InstantiatedFoo.class).child(FooChild.class); - } - -} +package org.opendaylight.yangtools.yang.binding.test; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.test.mock.FooChild; +import org.opendaylight.yangtools.yang.binding.test.mock.InstantiatedFoo; +import org.opendaylight.yangtools.yang.binding.test.mock.Node; +import org.opendaylight.yangtools.yang.binding.test.mock.NodeChild; +import org.opendaylight.yangtools.yang.binding.test.mock.NodeChildKey; +import org.opendaylight.yangtools.yang.binding.test.mock.NodeKey; +import org.opendaylight.yangtools.yang.binding.test.mock.Nodes; + +public class InstanceIdentifierTest { + + @Test + public void constructWithPredicates() { + + InstanceIdentifier nodes = InstanceIdentifier.builder(Nodes.class).toInstance(); + + assertNotNull(nodes); + assertEquals(Nodes.class, nodes.getTargetType()); + + + InstanceIdentifier node = InstanceIdentifier.builder(nodes).node(Node.class).toInstance(); + + assertNotNull(node); + assertEquals(Node.class, node.getTargetType()); + + assertTrue(nodes.contains(node)); + } + + @Test + public void fluentConstruction() { + + InstanceIdentifier nodes = InstanceIdentifier.builder(Nodes.class).toInstance(); + InstanceIdentifier node = InstanceIdentifier.builder(Nodes.class).child(Node.class,new NodeKey(10)).toInstance(); + + assertNotNull(node); + assertEquals(Node.class, node.getTargetType()); + + assertTrue(nodes.contains(node)); + } + + + @Test + public void negativeContains() { + InstanceIdentifier fooChild = InstanceIdentifier.builder(Nodes.class).child(InstantiatedFoo.class).child(FooChild.class).build(); + + InstanceIdentifier nodeTen = InstanceIdentifier.builder(Nodes.class) // + .child(Node.class,new NodeKey(10)).toInstance(); + InstanceIdentifier nodeOne = InstanceIdentifier.builder(Nodes.class) // + .child(Node.class,new NodeKey(1)).toInstance(); + InstanceIdentifier nodes = InstanceIdentifier.builder(Nodes.class).toInstance(); + + assertFalse(fooChild.contains(nodeTen)); + assertFalse(nodeTen.contains(nodes)); + + assertFalse(nodeOne.contains(nodes)); + assertTrue(nodes.contains(nodeOne)); + } + + @Test + public void containsWildcarded() { + InstanceIdentifier nodes = InstanceIdentifier.builder(Nodes.class).toInstance(); + InstanceIdentifier wildcarded = InstanceIdentifier.builder(Nodes.class).child(Node.class).build(); + InstanceIdentifier wildcardedChildren = InstanceIdentifier.builder(Nodes.class) // + .child(Node.class) // + .child(NodeChild.class).build(); + + assertTrue(wildcarded.isWildcarded()); + assertTrue(wildcardedChildren.isWildcarded()); + + + InstanceIdentifier nodeTen = InstanceIdentifier.builder(Nodes.class) // + .child(Node.class,new NodeKey(10)).toInstance(); + InstanceIdentifier nodeOne = InstanceIdentifier.builder(Nodes.class) // + .child(Node.class,new NodeKey(1)).toInstance(); + + assertFalse(nodeTen.isWildcarded()); + assertFalse(nodeOne.isWildcarded()); + assertTrue(nodes.containsWildcarded(nodeOne)); + assertTrue(wildcarded.containsWildcarded(nodeOne)); + assertTrue(wildcarded.containsWildcarded(nodeTen)); + + + InstanceIdentifier nodeTenChildWildcarded = InstanceIdentifier.builder(Nodes.class) // + .child(Node.class,new NodeKey(10)).child(NodeChild.class).toInstance(); + + assertTrue(nodeTenChildWildcarded.isWildcarded()); + + InstanceIdentifier nodeTenChild = InstanceIdentifier.builder(Nodes.class) // + .child(Node.class,new NodeKey(10)).child(NodeChild.class, new NodeChildKey(10)).toInstance(); + InstanceIdentifier nodeOneChild = InstanceIdentifier.builder(Nodes.class) // + .child(Node.class,new NodeKey(1)).child(NodeChild.class, new NodeChildKey(1)).toInstance(); + + + assertFalse(nodeTenChildWildcarded.containsWildcarded(nodeOneChild)); + assertTrue(nodeTenChildWildcarded.containsWildcarded(nodeTenChild)); + + } + + + void childOfTest() { + InstanceIdentifier.builder(Nodes.class).child(InstantiatedFoo.class).child(FooChild.class); + } + +} diff --git a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/FooChild.java b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/FooChild.java index 22f6a05e83..bdcbd0afc7 100644 --- a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/FooChild.java +++ b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/FooChild.java @@ -5,10 +5,10 @@ * 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.yangtools.yang.binding.test.mock; - -import org.opendaylight.yangtools.yang.binding.ChildOf; - -public interface FooChild extends ChildOf { - -} +package org.opendaylight.yangtools.yang.binding.test.mock; + +import org.opendaylight.yangtools.yang.binding.ChildOf; + +public interface FooChild extends ChildOf { + +} diff --git a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/GroupingFoo.java b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/GroupingFoo.java index 27f560dbfe..f86844644d 100644 --- a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/GroupingFoo.java +++ b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/GroupingFoo.java @@ -5,8 +5,8 @@ * 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.yangtools.yang.binding.test.mock; - -public interface GroupingFoo { - -} +package org.opendaylight.yangtools.yang.binding.test.mock; + +public interface GroupingFoo { + +} diff --git a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/InstantiatedFoo.java b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/InstantiatedFoo.java index 615a96c595..2e6348e00f 100644 --- a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/InstantiatedFoo.java +++ b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/InstantiatedFoo.java @@ -5,11 +5,11 @@ * 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.yangtools.yang.binding.test.mock; - -import org.opendaylight.yangtools.yang.binding.ChildOf; -import org.opendaylight.yangtools.yang.binding.DataObject; - -public interface InstantiatedFoo extends DataObject, GroupingFoo, ChildOf { - -} +package org.opendaylight.yangtools.yang.binding.test.mock; + +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.DataObject; + +public interface InstantiatedFoo extends DataObject, GroupingFoo, ChildOf { + +} diff --git a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Node.java b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Node.java index e2197ad1e1..71b78f694e 100644 --- a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Node.java +++ b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Node.java @@ -5,15 +5,15 @@ * 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.yangtools.yang.binding.test.mock; - -import org.opendaylight.yangtools.yang.binding.ChildOf; -import org.opendaylight.yangtools.yang.binding.DataObject; -import org.opendaylight.yangtools.yang.binding.Identifiable; - -public interface Node extends // - DataObject, // - Identifiable, // - ChildOf { - -} +package org.opendaylight.yangtools.yang.binding.test.mock; + +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.Identifiable; + +public interface Node extends // + DataObject, // + Identifiable, // + ChildOf { + +} diff --git a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChild.java b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChild.java index 4fd5d090b7..3b0217673f 100644 --- a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChild.java +++ b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChild.java @@ -5,15 +5,15 @@ * 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.yangtools.yang.binding.test.mock; - -import org.opendaylight.yangtools.yang.binding.ChildOf; -import org.opendaylight.yangtools.yang.binding.DataObject; -import org.opendaylight.yangtools.yang.binding.Identifiable; - -public interface NodeChild extends // - DataObject, // - Identifiable, // - ChildOf { - -} +package org.opendaylight.yangtools.yang.binding.test.mock; + +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.Identifiable; + +public interface NodeChild extends // + DataObject, // + Identifiable, // + ChildOf { + +} diff --git a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChildKey.java b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChildKey.java index d401304b6b..f78427840c 100644 --- a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChildKey.java +++ b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeChildKey.java @@ -5,43 +5,43 @@ * 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.yangtools.yang.binding.test.mock; - -import org.opendaylight.yangtools.yang.binding.Identifier; - -public class NodeChildKey implements // - Identifier { - - private final int id; - - public NodeChildKey(int id) { - super(); - this.id = id; - } - - public int getId() { - return id; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + id; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - NodeChildKey other = (NodeChildKey) obj; - if (id != other.id) - return false; - return true; - } -} +package org.opendaylight.yangtools.yang.binding.test.mock; + +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NodeChildKey implements // + Identifier { + + private final int id; + + public NodeChildKey(int id) { + super(); + this.id = id; + } + + public int getId() { + return id; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + id; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + NodeChildKey other = (NodeChildKey) obj; + if (id != other.id) + return false; + return true; + } +} diff --git a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeKey.java b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeKey.java index bdfc59e278..295b6e5765 100644 --- a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeKey.java +++ b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/NodeKey.java @@ -5,43 +5,43 @@ * 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.yangtools.yang.binding.test.mock; - -import org.opendaylight.yangtools.yang.binding.Identifier; - -public class NodeKey implements // - Identifier { - - private final int id; - - public NodeKey(int id) { - super(); - this.id = id; - } - - public int getId() { - return id; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + id; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - NodeKey other = (NodeKey) obj; - if (id != other.id) - return false; - return true; - } -} +package org.opendaylight.yangtools.yang.binding.test.mock; + +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NodeKey implements // + Identifier { + + private final int id; + + public NodeKey(int id) { + super(); + this.id = id; + } + + public int getId() { + return id; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + id; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + NodeKey other = (NodeKey) obj; + if (id != other.id) + return false; + return true; + } +} diff --git a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Nodes.java b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Nodes.java index cafcbcb434..1bf7e18cd6 100644 --- a/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Nodes.java +++ b/yang/yang-binding/src/test/java/org/opendaylight/yangtools/yang/binding/test/mock/Nodes.java @@ -5,14 +5,14 @@ * 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.yangtools.yang.binding.test.mock; - -import org.opendaylight.yangtools.yang.binding.ChildOf; -import org.opendaylight.yangtools.yang.binding.DataObject; -import org.opendaylight.yangtools.yang.binding.DataRoot; - -public interface Nodes extends // - ChildOf, // - DataObject { - -} +package org.opendaylight.yangtools.yang.binding.test.mock; + +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.DataRoot; + +public interface Nodes extends // + ChildOf, // + DataObject { + +} -- 2.36.6