*/
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.");
+ }
+ }
}