/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2023 Nordix Foundation
+ * Copyright (C) 2021-2024 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.base.Strings;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@JsonProperty("alternate-id")
private String alternateId;
+ @JsonProperty("data-producer-identifier")
+ private String dataProducerIdentifier;
+
@JsonProperty("additional-properties")
private List<Property> dmiProperties;
copy.dmiProperties = original.getDmiProperties() == null ? null : new ArrayList<>(original.getDmiProperties());
copy.publicProperties =
original.getPublicProperties() == null ? null : new ArrayList<>(original.getPublicProperties());
+ copy.moduleSetTag = original.getModuleSetTag();
copy.alternateId = original.getAlternateId();
+ copy.dataProducerIdentifier = original.getDataProducerIdentifier();
return copy;
}
* @param dmiDataServiceName dmi data service name
* @param dmiModelServiceName dmi model service name
* @param ncmpServiceCmHandle the cm handle
+ * @param moduleSetTag moduleSetTag
+ * @param alternateId alternateId
+ * @param dataProducerIdentifier dataProducerIdentifier
* @return instance of yangModelCmHandle
*/
public static YangModelCmHandle toYangModelCmHandle(final String dmiServiceName,
final String dmiModelServiceName,
final NcmpServiceCmHandle ncmpServiceCmHandle,
final String moduleSetTag,
- final String alternateId) {
+ final String alternateId,
+ final String dataProducerIdentifier) {
final YangModelCmHandle yangModelCmHandle = new YangModelCmHandle();
yangModelCmHandle.setId(ncmpServiceCmHandle.getCmHandleId());
yangModelCmHandle.setDmiServiceName(dmiServiceName);
yangModelCmHandle.setDmiDataServiceName(dmiDataServiceName);
yangModelCmHandle.setDmiModelServiceName(dmiModelServiceName);
yangModelCmHandle.setModuleSetTag(moduleSetTag == null ? StringUtils.EMPTY : moduleSetTag);
- yangModelCmHandle.setAlternateId(alternateId);
+ yangModelCmHandle.setAlternateId(alternateId == null ? StringUtils.EMPTY : alternateId);
+ yangModelCmHandle.setDataProducerIdentifier(
+ dataProducerIdentifier == null ? StringUtils.EMPTY : dataProducerIdentifier);
yangModelCmHandle.setDmiProperties(asYangModelCmHandleProperties(ncmpServiceCmHandle.getDmiProperties()));
yangModelCmHandle.setPublicProperties(asYangModelCmHandleProperties(
ncmpServiceCmHandle.getPublicProperties()));
* @return dmi service name
*/
public String resolveDmiServiceName(final RequiredDmiService requiredService) {
- if (isNullEmptyOrBlank(dmiServiceName)) {
+ if (StringUtils.isBlank(dmiServiceName)) {
if (RequiredDmiService.DATA.equals(requiredService)) {
return dmiDataServiceName;
}
return yangModelCmHandleProperties;
}
- private static boolean isNullEmptyOrBlank(final String serviceName) {
- return Strings.isNullOrEmpty(serviceName) || serviceName.isBlank();
- }
-
@AllArgsConstructor
@Data
public static class Property {