001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.rest.beans;
014
015import java.util.*;
016
017/**
018 * A list of {@link ResourceDescription} objects.
019 *
020 * <h5 class='section'>See Also:</h5><ul>
021 *    <li class='link'><a class="doclink" href="../../../../../index.html#jrs.UtilityBeans">Utility Beans</a>
022 * </ul>
023 *
024 * @serial exclude
025 */
026public class ResourceDescriptions extends ArrayList<ResourceDescription> {
027
028   //-----------------------------------------------------------------------------------------------------------------
029   // Static
030   //-----------------------------------------------------------------------------------------------------------------
031
032   private static final long serialVersionUID = 1L;
033
034   /**
035    * Static creator.
036    *
037    * @return A new {@link ResourceDescriptions} object.
038    */
039   public static ResourceDescriptions create() {
040      return new ResourceDescriptions();
041   }
042
043   //-----------------------------------------------------------------------------------------------------------------
044   // Instance
045   //-----------------------------------------------------------------------------------------------------------------
046
047   /**
048    * Adds a new {@link ResourceDescription} to this list.
049    *
050    * @param name The name of the child resource.
051    * @param description The description of the child resource.
052    * @return This object.
053    */
054   public ResourceDescriptions append(String name, String description) {
055      super.add(new ResourceDescription(name, description));
056      return this;
057   }
058   /**
059    * Adds a new {@link ResourceDescription} to this list when the uri is different from the name.
060    *
061    * @param name The name of the child resource.
062    * @param uri The URI of the child resource.
063    * @param description The description of the child resource.
064    * @return This object.
065    */
066   public ResourceDescriptions append(String name, String uri, String description) {
067      super.add(new ResourceDescription(name, uri, description));
068      return this;
069   }
070}