diff options
Diffstat (limited to 'common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterGroupImpl.java')
-rw-r--r-- | common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterGroupImpl.java | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterGroupImpl.java b/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterGroupImpl.java index f0f34ac1..8a987bdd 100644 --- a/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterGroupImpl.java +++ b/common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterGroupImpl.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,9 @@ package org.onap.policy.common.parameters; +import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.NoArgsConstructor; import lombok.Setter; import org.onap.policy.common.parameters.annotations.NotBlank; import org.onap.policy.common.parameters.annotations.NotNull; @@ -32,30 +34,16 @@ import org.onap.policy.common.parameters.annotations.NotNull; @NotBlank @Getter @Setter +@NoArgsConstructor +@AllArgsConstructor public class ParameterGroupImpl implements ParameterGroup { /** - * Group name. Note: this MUST not be "private" or it will not be validated. + * Group name. */ - protected String name; - - /** - * Constructs the object, with a {@code null} name. - */ - public ParameterGroupImpl() { - this.name = null; - } - - /** - * Constructs the object. - * - * @param name the group's name - */ - public ParameterGroupImpl(String name) { - this.name = name; - } + private String name; @Override - public GroupValidationResult validate() { - return new GroupValidationResult(this); + public BeanValidationResult validate() { + return new BeanValidator().validateTop(getClass().getSimpleName(), this); } } |