Update the license for 2017-2018 license
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / serialization / queryformats / FormatFactory.java
index b19e0c3..416ff9f 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,8 +16,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * ============LICENSE_END=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 package org.onap.aai.serialization.queryformats;
 
@@ -31,9 +29,6 @@ import org.onap.aai.serialization.queryformats.exceptions.QueryParamInjectionExc
 import org.onap.aai.serialization.queryformats.utils.QueryParamInjector;
 import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
 
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.MultivaluedMap;
-
 public class FormatFactory {
 
        private final Loader loader;
@@ -53,39 +48,42 @@ public class FormatFactory {
        
        public Formatter get(Format format, MultivaluedMap<String, String> params) throws AAIException {
                
-               Formatter formattter = null;
+               Formatter formatter = null;
 
                switch (format) {
                        case graphson :
-                               formattter = new Formatter(inject(new GraphSON(), params));
+                               formatter = new Formatter(inject(new GraphSON(), params));
                                break;
                        case pathed :
-                               formattter = new Formatter(inject(new PathedURL(loader, urlBuilder), params));
+                               formatter = new Formatter(inject(new PathedURL(loader, urlBuilder), params));
                                break;
                        case id :
-                               formattter = new Formatter(inject(new IdURL(loader, urlBuilder), params));
+                               formatter = new Formatter(inject(new IdURL(loader, urlBuilder), params));
                                break;
                        case resource :
-                               formattter = new Formatter(inject(new Resource.Builder(loader, serializer, urlBuilder), params).build());
+                               formatter = new Formatter(inject(new Resource.Builder(loader, serializer, urlBuilder), params).build());
                                break;
                        case resource_and_url :
-                               formattter = new Formatter(inject(new Resource.Builder(loader, serializer, urlBuilder).includeUrl(), params).build());
+                               formatter = new Formatter(inject(new Resource.Builder(loader, serializer, urlBuilder).includeUrl(), params).build());
                                break;
                        case raw :
-                               formattter = new Formatter(inject(new RawFormat.Builder(loader, serializer, urlBuilder), params).build());
+                               formatter = new Formatter(inject(new RawFormat.Builder(loader, serializer, urlBuilder), params).build());
                                break;
                        case simple :
-                               formattter = new Formatter(inject(new RawFormat.Builder(loader, serializer, urlBuilder).depth(0).modelDriven(), params).build());
+                               formatter = new Formatter(inject(new RawFormat.Builder(loader, serializer, urlBuilder).depth(0).modelDriven(), params).build());
                                break;
                        case console :
-                               formattter = new Formatter(inject(new Console(), params));
+                               formatter = new Formatter(inject(new Console(), params));
+                               break;
+                       case count :
+                               formatter = new Formatter(inject(new Count(), params));
                                break;
                        default :
                                break;
 
                }
                
-               return formattter;
+               return formatter;
        }
        
        private <T> T inject (T obj, MultivaluedMap<String, String> params) throws QueryParamInjectionException {