Integrate aai-schema-ingest library into aai-core
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / serialization / queryformats / Format.java
index be57fb9..abd261e 100644 (file)
  */
 package org.onap.aai.serialization.queryformats;
 
+import org.onap.aai.exceptions.AAIException;
+
 public enum Format {
        graphson,
        pathed, 
+    pathed_resourceversion,
        id, 
        resource,
        simple,
        resource_and_url,
        console,
        raw,
-       count
+       count;
+
+       public static Format getFormat(String format) throws AAIException {
+               try {
+                       return Format.valueOf(format);
+               } catch (IllegalArgumentException e) {
+                       throw new AAIException("AAI_6120", "Unsupported format query parameter " + format + " in request.");
+               }
+       }
 }