public T makeObject()

in objectModel/Java/objectmodel/src/main/java/com/microsoft/commondatamodel/objectmodel/cdm/CdmCorpusDefinition.java [426:570]


  public <T extends CdmObject> T makeObject(final CdmObjectType ofType, final String nameOrRef,
                                            final boolean simpleNameRef) {
    CdmObject newObj = null;
    switch (ofType) {
      case ArgumentDef:
        newObj = new CdmArgumentDefinition(this.ctx, nameOrRef);
        break;
      case AttributeContextDef:
        newObj = new CdmAttributeContext(this.ctx, nameOrRef);
        break;
      case AttributeContextRef:
        newObj = new CdmAttributeContextReference(this.ctx, nameOrRef);
        break;
      case AttributeGroupDef:
        newObj = new CdmAttributeGroupDefinition(this.ctx, nameOrRef);
        break;
      case AttributeGroupRef:
        newObj = new CdmAttributeGroupReference(this.ctx, nameOrRef, simpleNameRef);
        break;
      case AttributeRef:
        newObj = new CdmAttributeReference(this.ctx, nameOrRef, simpleNameRef);
        break;
      case AttributeResolutionGuidanceDef:
        newObj = new CdmAttributeResolutionGuidance(this.ctx);
        break;
      case ConstantEntityDef:
        newObj = new CdmConstantEntityDefinition(this.ctx, nameOrRef);
        break;
      case DataPartitionDef:
        newObj = new CdmDataPartitionDefinition(this.ctx, nameOrRef);
        break;
      case DataPartitionPatternDef:
        newObj = new CdmDataPartitionPatternDefinition(this.ctx, nameOrRef);
        break;
      case DataTypeDef:
        newObj = new CdmDataTypeDefinition(this.ctx, nameOrRef, null);
        break;
      case DataTypeRef:
        newObj = new CdmDataTypeReference(this.ctx, nameOrRef, simpleNameRef);
        break;
      case DocumentDef:
        newObj = new CdmDocumentDefinition(this.ctx, nameOrRef);
        break;
      case EntityAttributeDef:
        newObj = new CdmEntityAttributeDefinition(this.ctx, nameOrRef);
        break;
      case EntityDef:
        newObj = new CdmEntityDefinition(this.ctx, nameOrRef, null);
        break;
      case EntityRef:
        newObj = new CdmEntityReference(this.ctx, nameOrRef, simpleNameRef);
        break;
      case FolderDef:
        newObj = new CdmFolderDefinition(this.ctx, nameOrRef);
        break;
      case ManifestDef:
        newObj = new CdmManifestDefinition(this.ctx, nameOrRef);

        // Log and ingest a message when a new manifest is created
        Logger.debug(this.getCtx(), TAG, "makeObject<CdmManifestDefinition>", 
          newObj.getAtCorpusPath(), "New Manifest created.", true);

        break;
      case ManifestDeclarationDef:
        newObj = new CdmManifestDeclarationDefinition(this.ctx, nameOrRef);
        break;
      case Import:
        newObj = new CdmImport(this.ctx, nameOrRef, null);
        break;
      case LocalEntityDeclarationDef:
        newObj = new CdmLocalEntityDeclarationDefinition(this.ctx, nameOrRef);
        break;
      case ParameterDef:
        newObj = new CdmParameterDefinition(this.ctx, nameOrRef);
        break;
      case PurposeDef:
        newObj = new CdmPurposeDefinition(this.ctx, nameOrRef, null);
        break;
      case PurposeRef:
        newObj = new CdmPurposeReference(this.ctx, nameOrRef, simpleNameRef);
        break;
      case ReferencedEntityDeclarationDef:
        newObj = new CdmReferencedEntityDeclarationDefinition(this.ctx, nameOrRef);
        break;
      case TraitDef:
        newObj = new CdmTraitDefinition(this.ctx, nameOrRef, null);
        break;
      case TraitRef:
        newObj = new CdmTraitReference(this.ctx, nameOrRef, simpleNameRef, false);
        break;
      case TraitGroupDef:
        newObj = new CdmTraitGroupDefinition(this.ctx, nameOrRef);
        break;
      case TraitGroupRef:
        newObj = new CdmTraitGroupReference(this.ctx, nameOrRef, simpleNameRef);
        break;
      case TypeAttributeDef:
        newObj = new CdmTypeAttributeDefinition(this.ctx, nameOrRef);
        break;
      case E2ERelationshipDef:
        newObj = new CdmE2ERelationship(this.ctx, nameOrRef);
        break;
      case ProjectionDef:
        newObj = new CdmProjection(this.ctx);
        break;
      case OperationAddCountAttributeDef:
        newObj = new CdmOperationAddCountAttribute(this.ctx);
        break;
      case OperationAddSupportingAttributeDef:
        newObj = new CdmOperationAddSupportingAttribute(this.ctx);
        break;
      case OperationAddTypeAttributeDef:
        newObj = new CdmOperationAddTypeAttribute(this.ctx);
        break;
      case OperationExcludeAttributesDef:
        newObj = new CdmOperationExcludeAttributes(this.ctx);
        break;
      case OperationArrayExpansionDef:
        newObj = new CdmOperationArrayExpansion(this.ctx);
        break;
      case OperationCombineAttributesDef:
        newObj = new CdmOperationCombineAttributes(this.ctx);
        break;
      case OperationRenameAttributesDef:
        newObj = new CdmOperationRenameAttributes(this.ctx);
        break;
      case OperationReplaceAsForeignKeyDef:
        newObj = new CdmOperationReplaceAsForeignKey(this.ctx);
        break;
      case OperationIncludeAttributesDef:
        newObj = new CdmOperationIncludeAttributes(this.ctx);
        break;
      case OperationAddAttributeGroupDef:
        newObj = new CdmOperationAddAttributeGroup(this.ctx);
        break;
      case OperationAlterTraitsDef:
        newObj = new CdmOperationAlterTraits(this.ctx);
        break;
      case OperationAddArtifactAttributeDef:
        newObj = new CdmOperationAddArtifactAttribute(this.ctx);
        break;
    }

    return (T) newObj;
  }