jersey.repackaged.com.google.common.collect.Lists



API Populatity

2 Client projects

Project: jersey

Project jersey/jersey in file ...assfish.jersey.server.internal.routing.Router.java (2015-02-04)
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright (c) 2011-2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011-2015 Oracle and/or its affiliates. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common Development
@@ -43,8 +43,6 @@ import java.util.Collections;
 
 import org.glassfish.jersey.server.internal.process.RequestProcessingContext;
 
-import jersey.repackaged.com.google.common.collect.Lists;
-
 /**
  * Hierarchical request router that can be used to create dynamic routing tree
  * structures.  Each routing tree can be executed using a dedicated
@@ -52,7 +50,7 @@ import jersey.repackaged.com.google.common.collect.Lists;
  *
  * @author Marek Potociar (marek.potociar at oracle.com)
  */
-public interface Router {
+interface Router {
     /**
      * Hierarchical request routing continuation.
      * <p>
@@ -72,7 +70,7 @@ public interface Router {
          * @return terminal continuation with no {@link #next() next level routers}
          *         in the routing hierarchy and the supplied routed request.
          */
-        public static Continuation of(final RequestProcessingContext result) {
+        static Continuation of(final RequestProcessingContext result) {
             return new Continuation(result, null);
         }
 
@@ -86,7 +84,7 @@ public interface Router {
          *         {@link #next() next} in the routing chain and the supplied routed
          *         request.
          */
-        public static Continuation of(final RequestProcessingContext result, Iterable<Router> next) {
+        static Continuation of(final RequestProcessingContext result, Iterable<Router> next) {
             return new Continuation(result, next);
         }
 
@@ -100,8 +98,8 @@ public interface Router {
          *         {@link #next() next} in the routing chain and the supplied routed
          *         request.
          */
-        public static Continuation of(final RequestProcessingContext request, final Router next) {
-            return new Continuation(request, Lists.newArrayList(next));
+        static Continuation of(final RequestProcessingContext request, final Router next) {
+            return new Continuation(request, Collections.singletonList(next));
         }
 
         private Continuation(final RequestProcessingContext request, final Iterable<Router> next) {
@@ -114,57 +112,20 @@ public interface Router {
          *
          * @return routed request context.
          */
-        public RequestProcessingContext requestContext() {
+        RequestProcessingContext requestContext() {
             return requestProcessingContext;
         }
 
         /**
          * Get the next level routers to be invoked or {@code an empty} if no next
-         * level routers are {@link #hasNext() present}.
+         * level routers are present.
          *
          * @return the next level routers to be invoked or an empty collection if not
          *         present.
          */
-        public Iterable<Router> next() {
+        Iterable<Router> next() {
             return next;
         }
-
-        /**
-         * Check if there are any next level routers present in the continuation.
-         * <p>
-         * The absence of any next level routers in the continuation indicates that the
-         * request routing reached a leaf stage.
-         * </p>
-         *
-         * @return {@code true} if there are any next level routers present in the continuation,
-         *         {@code false} otherwise.
-         */
-        public boolean hasNext() {
-            return next.iterator().hasNext();
-        }
-    }
-
-    /**
-     * A {@link Router} builder.
-     */
-    public static interface Builder {
-
-        /**
-         * Add new child node into the {@link Router hierarchical request router}
-         * being built.
-         *
-         * @param child new child node to be added.
-         * @return updated builder instance.
-         */
-        public Builder child(Router child);
-
-        /**
-         * Build a {@link Router hierarchical router} for the transformation of
-         * a given data type.
-         *
-         * @return hierarchical stage.
-         */
-        public Router build();
     }
 
     /**
Project opentripplanner/OpenTripPlanner in file ...ntripplanner.standalone.CommandLineParameters.java (2014-11-07)
@@ -10,6 +10,8 @@ import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import jersey.repackaged.com.google.common.collect.Lists;
+
 import org.opentripplanner.routing.impl.GraphServiceImpl;
 
 import com.beust.jcommander.IParameterValidator;
@@ -31,7 +33,7 @@ import com.beust.jcommander.ParameterException;
  * 
  * @author abyrd
  */
-public class CommandLineParameters {
+public class CommandLineParameters implements Cloneable {
 
     private static final int DEFAULT_PORT = 8080;
     private static final int DEFAULT_SECURE_PORT = 8081;
@@ -66,7 +68,7 @@ public class CommandLineParameters {
     
     @Parameter(names = { "-m", "--inMemory"},
     description = "pass the graph to the server in-memory after building it, without saving to disk")
-    boolean inMemory;
+    public boolean inMemory;
  
     @Parameter(names = { "--preFlight"},
     description = "pass the graph to the server in-memory after building it, and saving to disk")
@@ -187,6 +189,27 @@ public class CommandLineParameters {
         }
     }
 
+    public CommandLineParameters clone () {
+        CommandLineParameters ret;
+        try {
+            ret = (CommandLineParameters) super.clone();
+        } catch (CloneNotSupportedException e) {
+            return null;
+        }
+        
+        if (this.build != null) {
+            ret.build = Lists.newArrayList();
+            ret.build.addAll(this.build);
+        }
+        
+        if (this.routerIds != null) {
+            ret.routerIds = Lists.newArrayList();
+            ret.routerIds.addAll(this.routerIds);
+        }
+        
+        return ret;
+    }
+    
     public static class ReadableFile implements IParameterValidator {
         @Override
         public void validate(String name, String value) throws ParameterException {
Project jersey/jersey in file ...ey.server.internal.routing.MethodAcceptorPair.java (2015-02-04)
@@ -1,89 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License").  You
- * may not use this file except in compliance with the License.  You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt.  See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license."  If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above.  However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package org.glassfish.jersey.server.internal.routing;
-
-import java.util.List;
-
-import org.glassfish.jersey.server.model.ResourceMethod;
-
-import jersey.repackaged.com.google.common.collect.Lists;
-
-/**
- * A pair of resource method model and a corresponding resource method routers.
- *
- * @author Marek Potociar (marek.potociar at oracle.com)
- */
-final class MethodAcceptorPair {
-
-    /**
-     * Resource method model.
-     */
-    final ResourceMethod model;
-
-    /**
-     * Resource method routers.
-     */
-    final List<Router> router;
-
-    /**
-     * Create a new instance.
-     *
-     * @param model  Resource method handler.
-     * @param router List of routers that are needed to execute the {@code model}. These routers should contain
-     *               final {@link org.glassfish.jersey.process.internal.Inflecting inflecting router} as the last router
-     *               in the list.
-     */
-    MethodAcceptorPair(final ResourceMethod model, final List<Router> router) {
-        this.model = model;
-        this.router = router;
-    }
-
-    /**
-     * Create a new instance.
-     *
-     * @param model   Resource method handler.
-     * @param routers Routers that are needed to execute the {@code model}. These routers should contain
-     *                final {@link org.glassfish.jersey.process.internal.Inflecting inflecting router} as the last router.
-     */
-    MethodAcceptorPair(final ResourceMethod model, final Router... routers) {
-        this.model = model;
-        this.router = Lists.newArrayList(routers);
-    }
-}