001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.rest.server.beans;
018
019import java.util.*;
020
021/**
022 * A list of {@link RouteDescription} objects.
023 *
024 * <p>
025 * Typically returned by a route-index op so the listing is content-negotiated through the configured
026 * serializers (browsable HTML table, JSON, or XML based on the {@code Accept} header), mirroring the way
027 * {@link ChildResourceDescriptions} backs the child-resource navigation page.
028 *
029 * <h5 class='section'>See Also:</h5><ul>
030 *    <li class='jc'>{@link RouteDescription}
031 *    <li class='jc'>{@link ResourceDescriptions}
032 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/UtilityBeans">Utility Beans</a>
033 * </ul>
034 *
035 * @serial exclude
036 * @since 10.0.0
037 */
038public class RouteDescriptions extends ArrayList<RouteDescription> {
039   private static final long serialVersionUID = 1L;
040
041   /**
042    * Static creator.
043    *
044    * @return A new {@link RouteDescriptions} object.
045    */
046   public static RouteDescriptions create() {
047      return new RouteDescriptions();
048   }
049
050   /**
051    * Adds a new {@link RouteDescription} to this list.
052    *
053    * @param path The mount path of the operation.
054    * @param methods The HTTP methods the operation responds to.
055    * @param summary The operation summary.
056    * @param description The operation description.
057    * @param deprecated Whether the operation is deprecated.
058    * @return This object.
059    */
060   public RouteDescriptions append(String path, List<String> methods, String summary, String description, boolean deprecated) {
061      super.add(new RouteDescription(path, methods, summary, description, deprecated));
062      return this;
063   }
064}