/* SPDX-License-Identifier: Apache-2.0 */

package <$$package$$>;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.odpi.openmetadata.accessservices.subjectarea.properties.classifications.Classification;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.MapPropertyValue;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.PrimitivePropertyValue;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties;
import org.odpi.openmetadata.accessservices.subjectarea.ffdc.exceptions.InvalidParameterException;

import java.io.Serializable;
import java.util.*;

import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;


import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.annotation.JsonProperty;

import org.odpi.openmetadata.accessservices.subjectarea.properties.enums.*;

/**
 * <$$description$$>
 */

@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown=true)
public class <$$uname$$> extends Classification {
    private static final Logger log = LoggerFactory.getLogger( <$$uname$$>.class);
    private static final String className =  <$$uname$$>.class.getName();
    private Map<String, Object> extraAttributes;


 public static final String[] PROPERTY_NAMES_SET_VALUES = new String[] {
    <$$$
        "<$$PropertyName$$>",
    $$$>

    // Terminate the list
        null
    };
    public static final String[] ATTRIBUTE_NAMES_SET_VALUES = new String[] {
     <$Attr$$
        "<$$AttrName$$>",
     $Attr$$>

     // Terminate the list
        null
    };
    public static final String[] ENUM_NAMES_SET_VALUES = new String[] {
     <$Enum$$
         "<$$EnumName$$>",
     $Enum$$>

         // Terminate the list
          null
    };
    public static final String[] MAP_NAMES_SET_VALUES = new String[] {
     <$Map$$
         "<$$MapName$$>",
     $Map$$>

         // Terminate the list
         null
    };
    // note the below definitions needs to be fully qualified
    public static final java.util.Set<String> PROPERTY_NAMES_SET = new HashSet(new HashSet<>(Arrays.asList(PROPERTY_NAMES_SET_VALUES)));
    public static final java.util.Set<String> ATTRIBUTE_NAMES_SET = new HashSet(new HashSet<>(Arrays.asList(ATTRIBUTE_NAMES_SET_VALUES)));
    public static final java.util.Set<String> ENUM_NAMES_SET = new HashSet(new HashSet<>(Arrays.asList(ENUM_NAMES_SET_VALUES)));
    public static final java.util.Set<String> MAP_NAMES_SET = new HashSet(new HashSet<>(Arrays.asList(MAP_NAMES_SET_VALUES)));
    /**
     * Default constructor
     */
    public <$$uname$$>() {
            super.classificationName="<$$uname$$>";
    }
    @Override
    public InstanceProperties obtainInstanceProperties() {
        final String methodName = "obtainInstanceProperties";
        if (log.isDebugEnabled()) {
               log.debug("==> Method: " + methodName);
        }
        InstanceProperties instanceProperties = new InstanceProperties();
        EnumPropertyValue enumPropertyValue=null;
        <$Enum$$
        enumPropertyValue = new EnumPropertyValue();
        // <$$description$$>
        if (<$$EnumName$$> !=null) {
            enumPropertyValue.setOrdinal(<$$EnumName$$>.ordinal());
            enumPropertyValue.setSymbolicName(<$$EnumName$$>.name());
            instanceProperties.setProperty("<$$EnumName$$>",enumPropertyValue);
        }
        $Enum$$>
        MapPropertyValue mapPropertyValue=null;
        <$Map$$
        // <$$description$$>
        mapPropertyValue = new MapPropertyValue();
        //mapPropertyValue.setMapValues(this.<$$PropertyName$$>);
        $Map$$>
        PrimitivePropertyValue primitivePropertyValue=null;
        <$Attr$$
        primitivePropertyValue = new PrimitivePropertyValue();
        primitivePropertyValue.setPrimitiveValue(<$$AttrName$$>);
        instanceProperties.setProperty("<$$AttrName$$>",primitivePropertyValue);
        $Attr$$>
        if (log.isDebugEnabled()) {
               log.debug("<== Method: " + methodName);
        }
        return instanceProperties;
    }

   <$$$
       private <$$PropertyType$$> <$$PropertyName$$>;
       /**
        * {@literal <$$AttrDescription$$> }
        * @return {@code <$$PropertyTypeJavadoc$$> }
        */
       public <$$PropertyType$$> get<$$uPropertyName$$>() {
           return this.<$$PropertyName$$>;
       }
       public void set<$$uPropertyName$$>(<$$PropertyType$$> <$$PropertyName$$>)  {
           this.<$$PropertyName$$> = <$$PropertyName$$>;
       }


   $$$>

    /**
      * Get the extra attributes - ones that are in addition to the standard types.
      * @return extra attributes
      */
    public Map<String, Object> getExtraAttributes() {
          return extraAttributes;
    }
    public void setExtraAttributes(Map<String, Object> extraAttributes) {
          this.extraAttributes = extraAttributes;
    }
}
