Rework MethodSerializer (+ fallout) 72/46472/2
authorStephen Kitt <skitt@redhat.com>
Thu, 22 Sep 2016 14:23:41 +0000 (16:23 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Wed, 12 Oct 2016 11:24:48 +0000 (11:24 +0000)
commit8cc33e526b0f9ad956dcc96e57cff02679d643b3
treec99ae9567abe1a02a818f31305557ada1f1ce4ce
parent2cf4749c41aa32c6b77064fc1ae0e231adc4a5f4
Rework MethodSerializer (+ fallout)

The main aim of this patch is to avoid instanceof-determined behaviour
(between MethodDeclaration and MethodDefinition):
* move getThrowsExceptions() and getBody() to Method;
* make getVisibility() and getBody() Optional;
* method declarations can specify thrown exceptions (which are
  separated by commas, not spaces).

In addition, use Java 8 lambdas where appropriate in MethodSerializer
and a few places elsewhere, and use Modifier instead of String for
modifiers.

Some clean-up:
* drop inferrable type parameters;
* use new ArrayList<>() instead of Lists.newArrayList();
* use Collections.singletonList() where appropriate.

Change-Id: I9ec10bf64d366056afacce3fd4038ba92d3c4e6e
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/RuntimeRegistratorFtlTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Field.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/FieldSerializer.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/Method.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDeclaration.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodDefinition.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/MethodSerializer.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleField.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/model/ModuleFieldSerializer.java

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.