2 * ===============================LICENSE_START======================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============================LICENSE_END===========================================
21 package org.openecomp.dcae.apod.analytics.model.domain.policy.tca;
24 import lombok.EqualsAndHashCode;
26 import java.util.ArrayList;
27 import java.util.List;
30 * TCA Metrics that need to applied to each functional Role
32 * @author Rajiv Singla . Creation Date: 11/5/2016.
35 @EqualsAndHashCode(callSuper = true)
36 public class MetricsPerFunctionalRole extends BaseTCAPolicyModel{
39 private static final long serialVersionUID = 1L;
42 * Functional Role to which TCA Policy needs to applied.
44 * @param functionalRole New value for Functional Role to which TCA Policy needs to applied
45 * @return Functional Role to which TCA Policy needs to applied
47 private String functionalRole;
52 * @param policyScope New value for Policy Scope
53 * @return Policy Scope
55 private String policyScope;
60 * @param policyName New value for Policy Name
63 private String policyName;
68 * @param policyVersion New value for Policy Version
69 * @return Policy Version
71 private String policyVersion;
76 * @param thresholds New value for Policy Thresholds
77 * @return Policy Thresholds
79 private List<Threshold> thresholds;
83 * Creates a copy of given {@link MetricsPerFunctionalRole}
85 * @param metricsPerFunctionalRole metrics Per functional role that need to copied
87 * @return copy of new metrics per function role with values copied from given metrics per functional role
89 public static MetricsPerFunctionalRole copy(final MetricsPerFunctionalRole metricsPerFunctionalRole) {
90 final MetricsPerFunctionalRole newMetricsPerFunctionalRole = new MetricsPerFunctionalRole();
91 newMetricsPerFunctionalRole.setFunctionalRole(metricsPerFunctionalRole.getFunctionalRole());
92 newMetricsPerFunctionalRole.setPolicyScope(metricsPerFunctionalRole.getPolicyScope());
93 newMetricsPerFunctionalRole.setPolicyName(metricsPerFunctionalRole.getPolicyName());
94 newMetricsPerFunctionalRole.setPolicyVersion(metricsPerFunctionalRole.getPolicyVersion());
95 if (metricsPerFunctionalRole.getThresholds() != null) {
96 newMetricsPerFunctionalRole.setThresholds(new ArrayList<>(metricsPerFunctionalRole.getThresholds()));
98 return newMetricsPerFunctionalRole;