From ec85c396181e2dca639b23abd46d6789308aafa0 Mon Sep 17 00:00:00 2001 From: vempo Date: Wed, 3 Oct 2018 15:27:34 +0300 Subject: Fixed constructors in Lombok-annotated classes Used Lombok annotations instead of implementations for constructors where possible. Fixed copyright headers and formatting. Change-Id: I9d6cd2936cf165f08f31e11e253743b8670560a5 Issue-ID: SDC-1815 Signed-off-by: vempo --- .../sdc/workflow/api/types/VersionStateDto.java | 5 ++-- .../types/dto/ArtifactDeliveriesRequestDto.java | 30 ++++++++++------------ .../workflow/persistence/types/ArtifactEntity.java | 7 ++--- .../persistence/types/UniqueValueEntity.java | 7 ++--- .../sdc/workflow/services/types/PagingRequest.java | 16 ++++++++++++ .../sdc/workflow/services/types/RequestSpec.java | 23 +++++++++++++---- .../org/onap/sdc/workflow/services/types/Sort.java | 23 +++++++++++++---- .../workflow/services/types/SortingRequest.java | 16 ++++++++++++ 8 files changed, 87 insertions(+), 40 deletions(-) (limited to 'workflow-designer-be/src/main/java/org') diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/VersionStateDto.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/VersionStateDto.java index 147ca50b..8e6dd09f 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/VersionStateDto.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/VersionStateDto.java @@ -18,17 +18,16 @@ package org.onap.sdc.workflow.api.types; import java.util.List; import lombok.Data; +import lombok.NoArgsConstructor; import org.onap.sdc.workflow.services.types.WorkflowVersionState; @Data +@NoArgsConstructor public class VersionStateDto { private WorkflowVersionState name; private List nextStates; - public VersionStateDto() { - } - public VersionStateDto(WorkflowVersionState state) { name = state; nextStates = state.getNextStates(); diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/dto/ArtifactDeliveriesRequestDto.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/dto/ArtifactDeliveriesRequestDto.java index 2ec272fc..5ec54ffb 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/dto/ArtifactDeliveriesRequestDto.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/dto/ArtifactDeliveriesRequestDto.java @@ -16,30 +16,26 @@ package org.onap.sdc.workflow.api.types.dto; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; /** - * This class is a simple data object for the Artifact-Deliveries API - * It will be used to build a HTTP request to be sent to SDC external API - * - * method - * the HTTP method (PUT, POST etc) that will be executed. - * - * endpoint - * the server to which the request will be sent. - * correct format is : + * This class is a simple data object for the Artifact-Deliveries API. + * It will be used to build a HTTP request to be sent to SDC external API. */ @Data +@AllArgsConstructor +@NoArgsConstructor public class ArtifactDeliveriesRequestDto { + /** + * The HTTP method (PUT, POST etc) that will be executed. + */ private String method; - private String endpoint; - public ArtifactDeliveriesRequestDto(){ - } - - public ArtifactDeliveriesRequestDto(String method, String endpoint) { - this.method = method; - this.endpoint = endpoint; - } + /** + * The server to which the request will be sent. Correct format is <IP>:<PORT>. + */ + private String endpoint; } diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ArtifactEntity.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ArtifactEntity.java index 287acb45..62819754 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ArtifactEntity.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/ArtifactEntity.java @@ -17,16 +17,13 @@ package org.onap.sdc.workflow.persistence.types; import java.io.InputStream; +import lombok.AllArgsConstructor; import lombok.Data; @Data +@AllArgsConstructor public class ArtifactEntity { private String fileName; private InputStream artifactData; - - public ArtifactEntity(String fileName, InputStream artifactData) { - this.fileName = fileName; - this.artifactData = artifactData; - } } diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/UniqueValueEntity.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/UniqueValueEntity.java index ee7172b6..faf515b7 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/UniqueValueEntity.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/persistence/types/UniqueValueEntity.java @@ -18,12 +18,14 @@ package org.onap.sdc.workflow.persistence.types; import static org.springframework.data.cassandra.core.cql.PrimaryKeyType.PARTITIONED; +import lombok.AllArgsConstructor; import lombok.Data; import org.springframework.data.cassandra.core.mapping.PrimaryKeyColumn; import org.springframework.data.cassandra.core.mapping.Table; @Table("unique_value") @Data +@AllArgsConstructor public class UniqueValueEntity { @PrimaryKeyColumn(ordinal = 0, type = PARTITIONED) @@ -31,9 +33,4 @@ public class UniqueValueEntity { @PrimaryKeyColumn(ordinal = 1, type = PARTITIONED) private String value; - - public UniqueValueEntity(String type, String value) { - this.type = type; - this.value = value; - } } diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/PagingRequest.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/PagingRequest.java index da46cc2c..6408ee69 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/PagingRequest.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/PagingRequest.java @@ -1,3 +1,19 @@ +/* + * Copyright © 2018 European Support Limited + * + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.onap.sdc.workflow.services.types; import lombok.Getter; diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/RequestSpec.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/RequestSpec.java index cb974ee4..06ebdf1c 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/RequestSpec.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/RequestSpec.java @@ -1,15 +1,28 @@ +/* + * Copyright © 2018 European Support Limited + * + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.onap.sdc.workflow.services.types; +import lombok.AllArgsConstructor; import lombok.Data; @Data +@AllArgsConstructor public class RequestSpec { private PagingRequest paging; private SortingRequest sorting; - - public RequestSpec(PagingRequest paging, SortingRequest sorting) { - this.paging = paging; - this.sorting = sorting; - } } diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/Sort.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/Sort.java index 88151a0e..b26ef1cb 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/Sort.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/Sort.java @@ -1,17 +1,30 @@ +/* + * Copyright © 2018 European Support Limited + * + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.onap.sdc.workflow.services.types; +import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @Getter @EqualsAndHashCode +@AllArgsConstructor public class Sort { private String property; private boolean ascendingOrder; - - public Sort(String property, boolean ascendingOrder) { - this.property = property; - this.ascendingOrder = ascendingOrder; - } } diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/SortingRequest.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/SortingRequest.java index c3b7aa49..cd8b2c27 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/SortingRequest.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/services/types/SortingRequest.java @@ -1,3 +1,19 @@ +/* + * Copyright © 2018 European Support Limited + * + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.onap.sdc.workflow.services.types; import java.util.List; -- cgit 1.2.3-korg