class OMRSArchiveBuilder {

    public void addClassificationDef(ClassificationDef   classificationDef)
    {
        final String methodName = "addClassificationDef";

        if (classificationDef != null)
        {
            log.debug("Adding ClassificationDef: " + classificationDef.toString());
            
            this.checkForBlanksInTypeName(classificationDef.getName());

            ClassificationDef duplicateElement = classificationDefMap.put(classificationDef.getName(), classificationDef);

            if (duplicateElement != null)
            {
                throw new OMRSLogicErrorException(OMRSErrorCode.DUPLICATE_TYPE_IN_ARCHIVE.getMessageDefinition(classificationDef.getName(),
                                                                                                               TypeDefCategory.CLASSIFICATION_DEF.getName(),
                                                                                                               duplicateElement.toString(),
                                                                                                               classificationDef.toString()),
                                                  this.getClass().getName(),
                                                  methodName);
            }

            Object  duplicateGUID = guidMap.put(classificationDef.getGUID(), classificationDef);

            if (duplicateGUID != null)
            {
                throw new OMRSLogicErrorException(OMRSErrorCode.DUPLICATE_GUID_IN_ARCHIVE.getMessageDefinition(classificationDef.getGUID(),
                                                                                                               duplicateGUID.toString(),
                                                                                                               classificationDef.toString()),
                                                  this.getClass().getName(),
                                                  methodName);
            }

            Object  duplicateName = nameMap.put(classificationDef.getName(), classificationDef);

            if (duplicateName != null)
            {
                throw new OMRSLogicErrorException(OMRSErrorCode.DUPLICATE_TYPENAME_IN_ARCHIVE.getMessageDefinition(classificationDef.getName(),
                                                                                                                   duplicateName.toString(),
                                                                                                                   classificationDef.toString()),
                                                  this.getClass().getName(),
                                                  methodName);
            }
            if (classificationDef.getPropertiesDefinition() != null)
            {
                Set<String> attributeSet = new HashSet<>();

                for (TypeDefAttribute typeDefAttr :classificationDef.getPropertiesDefinition())
                {
                    String duplicateAttributeName = typeDefAttr.getAttributeName();
                    
                    if (attributeSet.contains(duplicateAttributeName))
                    {
                        /*
                         * relationship duplicate attribute name
                         */
                        throw new OMRSLogicErrorException(OMRSErrorCode.DUPLICATE_CLASSIFICATION_ATTR_IN_ARCHIVE.getMessageDefinition(duplicateAttributeName,
                                                                                                                                      classificationDef.getName()),
                                                          this.getClass().getName(),
                                                          methodName);
                    }
                    attributeSet.add(duplicateAttributeName);
                }
            }

            classificationDefList.add(classificationDef);
        }
    }

    public  OMRSArchiveBuilder(String                     archiveGUID,
                              String                     archiveName,
                              String                     archiveDescription,
                              OpenMetadataArchiveType    archiveType,
                              String                     originatorName,
                              Date                       creationDate,
                              List<OpenMetadataArchive>  dependsOnArchives);
    public  OMRSArchiveBuilder(String                     archiveGUID,
                              String                     archiveName,
                              String                     archiveDescription,
                              OpenMetadataArchiveType    archiveType,
                              String                     originatorName,
                              String                     originatorLicense,
                              Date                       creationDate,
                              List<OpenMetadataArchive>  dependsOnArchives);
    public  OMRSArchiveBuilder(String                     archiveGUID,
                              String                     archiveName,
                              String                     archiveDescription,
                              OpenMetadataArchiveType    archiveType,
                              String                     archiveVersion,
                              String                     originatorName,
                              String                     originatorLicense,
                              Date                       creationDate,
                              List<OpenMetadataArchive>  dependsOnArchives);

}