diff options
author | 2022-03-04 00:31:07 +0530 | |
---|---|---|
committer | 2022-03-10 21:54:41 +0530 | |
commit | 3d02e9210625b75419089a3f5612f386c3b997ea (patch) | |
tree | c51e4f460588ddd4a06d77563eefee1b91877ff7 /cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java | |
parent | 06b6584a741b565922b32bb7e861ae4d16854673 (diff) |
Removed ExtendedModuleReference Object
-Introduced ModuleReference with 2 prop name and revision
-Removed default constructor of ModuleReference
Issue-ID: CPS-592
Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
Change-Id: I27a8a521f133c0773ef0aa0b9700ac42f6bc613b
Diffstat (limited to 'cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java')
-rw-r--r-- | cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java b/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java index 5cbfd6222..fd534971a 100644 --- a/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java +++ b/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java @@ -1,12 +1,14 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2020 Pantheon.tech + * Modifications Copyright (C) 2022 Nordix Foundation. * ================================================================================ * 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. @@ -35,7 +37,7 @@ import java.util.stream.Collectors; import lombok.NoArgsConstructor; import org.onap.cps.spi.exceptions.CpsException; import org.onap.cps.spi.exceptions.ModelValidationException; -import org.onap.cps.spi.model.ExtendedModuleReference; +import org.onap.cps.spi.model.ModuleReference; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; @@ -88,15 +90,15 @@ public final class YangTextSchemaSourceSetBuilder { } @Override - public List<ExtendedModuleReference> getModuleReferences() { + public List<ModuleReference> getModuleReferences() { return schemaContext.getModules().stream() .map(YangTextSchemaSourceSetImpl::toModuleReference) .collect(Collectors.toList()); } - private static ExtendedModuleReference toModuleReference(final Module module) { - return ExtendedModuleReference.builder() - .name(module.getName()) + private static ModuleReference toModuleReference(final Module module) { + return ModuleReference.builder() + .moduleName(module.getName()) .namespace(module.getQNameModule().getNamespace().toString()) .revision(module.getRevision().map(Revision::toString).orElse(null)) .build(); |