summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java')
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ServiceTemplateReaderService.java1
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ToscaConverter.java11
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/Constants.java6
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java5
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java22
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/SubstitutionMappingsConverterErrorBuilder.java23
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/factory/ToscaConverterFactory.java11
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/PnfdTransformationEngine.java2
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/exception/QueryOperationNotSupportedException.java2
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionDefinition.java4
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionQuery.java5
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionStrategyType.java21
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/PnfTransformationToken.java3
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/Transformation.java13
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationBlock.java10
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationDescription.java2
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationProperty.java2
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationPropertyType.java6
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/parser/PnfdBlockParser.java1
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/AbstractPnfdConversionStrategy.java2
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/PnfdConversionStrategy.java1
21 files changed, 53 insertions, 100 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ServiceTemplateReaderService.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ServiceTemplateReaderService.java
index afde5052d3..50656dcb89 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ServiceTemplateReaderService.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ServiceTemplateReaderService.java
@@ -17,7 +17,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter;
import java.util.List;
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ToscaConverter.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ToscaConverter.java
index d2e227d2f0..c9d3aa6224 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ToscaConverter.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/ToscaConverter.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,16 +17,13 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter;
+import java.io.IOException;
import org.openecomp.core.utilities.file.FileContentHandler;
import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
-import java.io.IOException;
-
public interface ToscaConverter {
- ToscaServiceModel convert(FileContentHandler fileContentHandler)
- throws IOException;
+ ToscaServiceModel convert(FileContentHandler fileContentHandler) throws IOException;
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/Constants.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/Constants.java
index a8d29b9c6a..415bfe4180 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/Constants.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/Constants.java
@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.openecomp.core.converter.datatypes;
public final class Constants {
+
public static final String MAIN_ST_NAME = "MainServiceTemplate.yaml";
public static final String GLOBAL_ST_NAME = "GlobalSubstitutionTypesServiceTemplate.yaml";
public static final String DEFINITIONS_DIR = "Definitions/";
@@ -32,13 +32,11 @@ public final class Constants {
public static final String CAPABILITIES = "capabilities";
public static final String REQUIREMENTS = "requirements";
public static final String POLICIES = "policies";
-
public static final String OPENECOMP_HEAT_INDEX = "openecomp_heat_index";
public static final String ONAP_INDEX = "onap_index";
public static final String GLOBAL_SUBSTITUTION = "GlobalSubstitutionTypes";
// prevent utility class instantiation
- private Constants () {
+ private Constants() {
}
-
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java
index 38b3e823f7..281ff3a7d7 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.datatypes;
public enum CsarFileTypes {
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java
index b1b5098fed..314ecad73c 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/CreateToscaObjectErrorBuilder.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,22 +17,18 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.errors;
import org.openecomp.sdc.common.errors.BaseErrorBuilder;
import org.openecomp.sdc.common.errors.ErrorCategory;
public class CreateToscaObjectErrorBuilder extends BaseErrorBuilder {
- private static final String CANT_CREATE_OBJECT_FROM_CLASS =
- "Can't create %s from %s.";
- private static final String IMPORT_TOSCA = "IMPORT_TOSCA";
- public CreateToscaObjectErrorBuilder(String className,
- String objectId) {
- getErrorCodeBuilder()
- .withId(IMPORT_TOSCA)
- .withCategory(ErrorCategory.APPLICATION)
- .withMessage(String.format(CANT_CREATE_OBJECT_FROM_CLASS, className, objectId));
- }
+ private static final String CANT_CREATE_OBJECT_FROM_CLASS = "Can't create %s from %s.";
+ private static final String IMPORT_TOSCA = "IMPORT_TOSCA";
+
+ public CreateToscaObjectErrorBuilder(String className, String objectId) {
+ getErrorCodeBuilder().withId(IMPORT_TOSCA).withCategory(ErrorCategory.APPLICATION)
+ .withMessage(String.format(CANT_CREATE_OBJECT_FROM_CLASS, className, objectId));
+ }
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/SubstitutionMappingsConverterErrorBuilder.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/SubstitutionMappingsConverterErrorBuilder.java
index 8e09b27d11..03027bcd24 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/SubstitutionMappingsConverterErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/errors/SubstitutionMappingsConverterErrorBuilder.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,24 +17,19 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.errors;
import org.openecomp.sdc.common.errors.BaseErrorBuilder;
import org.openecomp.sdc.common.errors.ErrorCategory;
public class SubstitutionMappingsConverterErrorBuilder extends BaseErrorBuilder {
- private static final String SUB_MAPPINGS_CAPABILITY_REQUIREMENT_ENTRY_VALUE_ILLEGAL = "%s value" +
- " in substitution mappings is invalid, expected it to be %s";
- private static final String IMPORT_TOSCA = "IMPORT_TOSCA";
-
- public SubstitutionMappingsConverterErrorBuilder(String section,
- String expectedType) {
- getErrorCodeBuilder()
- .withId(IMPORT_TOSCA)
- .withCategory(ErrorCategory.APPLICATION)
- .withMessage(String.format(SUB_MAPPINGS_CAPABILITY_REQUIREMENT_ENTRY_VALUE_ILLEGAL, section, expectedType));
+ private static final String SUB_MAPPINGS_CAPABILITY_REQUIREMENT_ENTRY_VALUE_ILLEGAL =
+ "%s value" + " in substitution mappings is invalid, expected it to be %s";
+ private static final String IMPORT_TOSCA = "IMPORT_TOSCA";
- }
+ public SubstitutionMappingsConverterErrorBuilder(String section, String expectedType) {
+ getErrorCodeBuilder().withId(IMPORT_TOSCA).withCategory(ErrorCategory.APPLICATION)
+ .withMessage(String.format(SUB_MAPPINGS_CAPABILITY_REQUIREMENT_ENTRY_VALUE_ILLEGAL, section, expectedType));
+ }
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/factory/ToscaConverterFactory.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/factory/ToscaConverterFactory.java
index 147d9e4376..3ca9863d67 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/factory/ToscaConverterFactory.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/factory/ToscaConverterFactory.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,7 +17,6 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.factory;
import org.openecomp.core.converter.ToscaConverter;
@@ -26,7 +25,7 @@ import org.openecomp.core.factory.api.AbstractFactory;
public abstract class ToscaConverterFactory extends AbstractComponentFactory<ToscaConverter> {
- public static ToscaConverterFactory getInstance(){
- return AbstractFactory.getInstance(ToscaConverterFactory.class);
- }
+ public static ToscaConverterFactory getInstance() {
+ return AbstractFactory.getInstance(ToscaConverterFactory.class);
+ }
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/PnfdTransformationEngine.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/PnfdTransformationEngine.java
index 12949f2dcc..fa1487f444 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/PnfdTransformationEngine.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/PnfdTransformationEngine.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd;
/**
@@ -26,5 +25,4 @@ package org.openecomp.core.converter.pnfd;
public interface PnfdTransformationEngine {
void transform();
-
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/exception/QueryOperationNotSupportedException.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/exception/QueryOperationNotSupportedException.java
index a3f4b83812..e070c449ad 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/exception/QueryOperationNotSupportedException.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/exception/QueryOperationNotSupportedException.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.exception;
public class QueryOperationNotSupportedException extends RuntimeException {
@@ -24,5 +23,4 @@ public class QueryOperationNotSupportedException extends RuntimeException {
public QueryOperationNotSupportedException(final String s) {
super(s);
}
-
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionDefinition.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionDefinition.java
index fa06ab800e..7ef99f2562 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionDefinition.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionDefinition.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.model;
import lombok.AllArgsConstructor;
@@ -32,8 +31,7 @@ public class ConversionDefinition {
private PnfdConversionStrategy pnfdConversionStrategy;
private String toGetInput;
- public ConversionDefinition(ConversionQuery conversionQuery, String toAttributeName,
- PnfdConversionStrategy pnfdConversionStrategy) {
+ public ConversionDefinition(ConversionQuery conversionQuery, String toAttributeName, PnfdConversionStrategy pnfdConversionStrategy) {
this.conversionQuery = conversionQuery;
this.toAttributeName = toAttributeName;
this.pnfdConversionStrategy = pnfdConversionStrategy;
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionQuery.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionQuery.java
index fc1ef75f05..ced653d8d8 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionQuery.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionQuery.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.model;
import java.util.Map;
@@ -25,8 +24,8 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
/**
- * Stores a YAML query. The query is a YAML Object that should have the same structure or part of the original YAML that
- * is desired to find in a TOSCA Yaml block.
+ * Stores a YAML query. The query is a YAML Object that should have the same structure or part of the original YAML that is desired to find in a TOSCA
+ * Yaml block.
*/
@Getter
@EqualsAndHashCode
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionStrategyType.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionStrategyType.java
index b5c1f7c411..b58834b1fa 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionStrategyType.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/ConversionStrategyType.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.model;
import java.util.Optional;
@@ -25,25 +24,18 @@ import java.util.Optional;
* Represents a type of a conversion strategy
*/
public enum ConversionStrategyType {
- COPY("copy"),
- REPLACE("replace"),
- REPLACE_IN_LIST("replaceInList");
-
+ COPY("copy"), REPLACE("replace"), REPLACE_IN_LIST("replaceInList");
private final String type;
ConversionStrategyType(final String type) {
this.type = type;
}
- public String getType() {
- return type;
- }
-
/**
* Parse a String to the related {@link ConversionStrategyType}.
- * @param type the {@link ConversionStrategyType} type
- * @return
- * The {@link ConversionStrategyType} representing the given type.
+ *
+ * @param type the {@link ConversionStrategyType} type
+ * @return The {@link ConversionStrategyType} representing the given type.
*/
public static Optional<ConversionStrategyType> parse(final String type) {
for (final ConversionStrategyType conversionStrategyType : values()) {
@@ -51,7 +43,10 @@ public enum ConversionStrategyType {
return Optional.of(conversionStrategyType);
}
}
-
return Optional.empty();
}
+
+ public String getType() {
+ return type;
+ }
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/PnfTransformationToken.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/PnfTransformationToken.java
index 886614799f..4a0433aeef 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/PnfTransformationToken.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/PnfTransformationToken.java
@@ -16,13 +16,13 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.model;
/**
* Represents a token from the transformation descriptor
*/
public enum PnfTransformationToken {
+ // @formatter:off
CONVERSIONS("conversions"),
FROM("from"),
LIST("list"),
@@ -38,6 +38,7 @@ public enum PnfTransformationToken {
TO_GET_INPUT("to-get-input"),
PROPERTIES("properties"),
NODE_TYPE("node_types");
+ // @formatter:on
private final String name;
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/Transformation.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/Transformation.java
index ff3e19bd1b..313ac2c158 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/Transformation.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/Transformation.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.model;
import java.util.List;
@@ -38,7 +37,6 @@ import org.openecomp.sdc.logging.api.LoggerFactory;
public class Transformation {
private static final Logger LOGGER = LoggerFactory.getLogger(Transformation.class);
-
private String name;
private String description;
private TransformationBlock block;
@@ -69,12 +67,10 @@ public class Transformation {
final Transformation that = (Transformation) o;
//if there is no query, compares by block and name.
if (conversionQuery == null && that.conversionQuery == null) {
- return block == that.block &&
- Objects.equals(name, that.name);
+ return block == that.block && Objects.equals(name, that.name);
}
//transformations with the same block and query will override themselves.
- return block == that.block &&
- Objects.equals(conversionQuery, that.conversionQuery);
+ return block == that.block && Objects.equals(conversionQuery, that.conversionQuery);
}
@Override
@@ -86,10 +82,8 @@ public class Transformation {
if (CollectionUtils.isEmpty(propertySet)) {
return Optional.empty();
}
-
final Optional<TransformationProperty> transformationProperty = propertySet.stream()
- .filter(transformationProperty1 -> transformationProperty1.getType() == type)
- .findFirst();
+ .filter(transformationProperty1 -> transformationProperty1.getType() == type).findFirst();
if (transformationProperty.isPresent()) {
try {
T value = clazz.cast(transformationProperty.get().getValue());
@@ -99,7 +93,6 @@ public class Transformation {
return Optional.empty();
}
}
-
return Optional.empty();
}
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationBlock.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationBlock.java
index f8a5aee407..d29a8ca91f 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationBlock.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationBlock.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.model;
import java.util.Optional;
@@ -29,19 +28,21 @@ import lombok.Getter;
@AllArgsConstructor
@Getter
public enum TransformationBlock {
+ // @formatter:off
INPUT("input"),
GET_INPUT_FUNCTION("getInputFunction"),
NODE_TEMPLATE("nodeTemplate"),
CUSTOM_NODE_TYPE("customNodeType"),
NODE_TYPE("nodeType");
+ // @formatter:of
private final String name;
/**
* Parse a String to the related {@link TransformationBlock}.
- * @param name the {@link TransformationBlock} name
- * @return
- * The {@link TransformationBlock} representing the given name.
+ *
+ * @param name the {@link TransformationBlock} name
+ * @return The {@link TransformationBlock} representing the given name.
*/
public static Optional<TransformationBlock> parse(final String name) {
for (final TransformationBlock transformationBlock : values()) {
@@ -49,7 +50,6 @@ public enum TransformationBlock {
return Optional.of(transformationBlock);
}
}
-
return Optional.empty();
}
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationDescription.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationDescription.java
index f21a719f8d..6aebc36d11 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationDescription.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationDescription.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.model;
import java.util.Set;
@@ -28,5 +27,4 @@ import lombok.Getter;
public class TransformationDescription {
private final Set<Transformation> transformationSet;
-
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationProperty.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationProperty.java
index c42917d95d..7616ec0f14 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationProperty.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationProperty.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.model;
import lombok.AllArgsConstructor;
@@ -34,7 +33,6 @@ import lombok.Getter;
public class TransformationProperty<T> {
private TransformationPropertyType type;
-
@EqualsAndHashCode.Exclude
private T value;
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationPropertyType.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationPropertyType.java
index eed251944f..4cf33085ca 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationPropertyType.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/model/TransformationPropertyType.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.model;
import java.util.Arrays;
@@ -31,12 +30,9 @@ import lombok.Getter;
@AllArgsConstructor
public enum TransformationPropertyType {
NODE_NAME_PREFIX("nodeNamePrefix");
-
private final String type;
public static Optional<TransformationPropertyType> parse(final String type) {
- return Arrays.stream(values())
- .filter(transformationPropertyType -> transformationPropertyType.getType().equals(type))
- .findFirst();
+ return Arrays.stream(values()).filter(transformationPropertyType -> transformationPropertyType.getType().equals(type)).findFirst();
}
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/parser/PnfdBlockParser.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/parser/PnfdBlockParser.java
index dd66f502ea..417a640abf 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/parser/PnfdBlockParser.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/parser/PnfdBlockParser.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.parser;
import java.util.Map;
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/AbstractPnfdConversionStrategy.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/AbstractPnfdConversionStrategy.java
index ffd2e6fb34..31a87ea9e2 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/AbstractPnfdConversionStrategy.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/AbstractPnfdConversionStrategy.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.strategy;
import java.util.Map;
@@ -35,5 +34,4 @@ public abstract class AbstractPnfdConversionStrategy<T, U> implements PnfdConver
public ConversionStrategyType getStrategyType() {
return strategyType;
}
-
}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/PnfdConversionStrategy.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/PnfdConversionStrategy.java
index 724f20550f..0e2888e887 100644
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/PnfdConversionStrategy.java
+++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/pnfd/strategy/PnfdConversionStrategy.java
@@ -16,7 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.core.converter.pnfd.strategy;
import java.util.Optional;