
com.microsoft.commondatamodel.objectmodel.persistence.cdmfolder.AttributeContextReferencePersistence Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of objectmodel Show documentation
Show all versions of objectmodel Show documentation
CDM SDK to work with semantic metadata of the Data
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
package com.microsoft.commondatamodel.objectmodel.persistence.cdmfolder;
import com.fasterxml.jackson.databind.JsonNode;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmAttributeContextReference;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmCorpusContext;
import com.microsoft.commondatamodel.objectmodel.enums.CdmObjectType;
import com.microsoft.commondatamodel.objectmodel.utilities.CopyOptions;
import com.microsoft.commondatamodel.objectmodel.utilities.ResolveOptions;
public class AttributeContextReferencePersistence {
public static CdmAttributeContextReference fromData(final CdmCorpusContext ctx, final Object obj) {
if (obj instanceof String) {
return ctx.getCorpus().makeObject(CdmObjectType.AttributeContextRef, (String) obj);
}
if (obj instanceof JsonNode && ((JsonNode) obj).isValueNode()) {
return ctx.getCorpus().makeObject(CdmObjectType.AttributeContextRef, ((JsonNode) obj).asText());
}
return null;
}
public static Object toData(
final CdmAttributeContextReference instance,
final ResolveOptions resOpt,
final CopyOptions options) {
return CdmObjectRefPersistence.toData(instance, resOpt, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy