import lombok.NoArgsConstructor;
import lombok.Setter;
import org.onap.cps.ncmp.api.impl.operations.RequiredDmiService;
+import org.onap.cps.ncmp.api.inventory.CmHandleState;
import org.onap.cps.ncmp.api.inventory.CompositeState;
+import org.onap.cps.ncmp.api.inventory.CompositeStateBuilder;
import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
import org.onap.cps.utils.CpsValidator;
@JsonProperty("public-properties")
private List<Property> publicProperties;
+ private static final CompositeStateBuilder compositeStateBuilder = new CompositeStateBuilder();
+
/**
* Create a yangModelCmHandle.
*
public static YangModelCmHandle toYangModelCmHandle(final String dmiServiceName,
final String dmiDataServiceName,
final String dmiModelServiceName,
+ final CmHandleState cmHandleState,
final NcmpServiceCmHandle ncmpServiceCmHandle) {
CpsValidator.validateNameCharacters(ncmpServiceCmHandle.getCmHandleId());
final YangModelCmHandle yangModelCmHandle = new YangModelCmHandle();
yangModelCmHandle.setDmiProperties(asYangModelCmHandleProperties(ncmpServiceCmHandle.getDmiProperties()));
yangModelCmHandle.setPublicProperties(asYangModelCmHandleProperties(
ncmpServiceCmHandle.getPublicProperties()));
- yangModelCmHandle.setCompositeState(ncmpServiceCmHandle.getCompositeState());
+ compositeStateBuilder.withCmHandleState(cmHandleState);
+ yangModelCmHandle.setCompositeState(compositeStateBuilder.build());
return yangModelCmHandle;
}