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.beans;
018
019import java.util.*;
020
021/**
022 * A list of {@link ResourceDescription} objects.
023 *
024 * <h5 class='section'>See Also:</h5><ul>
025 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/UtilityBeans">Utility Beans</a>
026 * </ul>
027 *
028 * @serial exclude
029 */
030public class ResourceDescriptions extends ArrayList<ResourceDescription> {
031
032   //-----------------------------------------------------------------------------------------------------------------
033   // Static
034   //-----------------------------------------------------------------------------------------------------------------
035
036   private static final long serialVersionUID = 1L;
037
038   /**
039    * Static creator.
040    *
041    * @return A new {@link ResourceDescriptions} object.
042    */
043   public static ResourceDescriptions create() {
044      return new ResourceDescriptions();
045   }
046
047   //-----------------------------------------------------------------------------------------------------------------
048   // Instance
049   //-----------------------------------------------------------------------------------------------------------------
050
051   /**
052    * Adds a new {@link ResourceDescription} to this list.
053    *
054    * @param name The name of the child resource.
055    * @param description The description of the child resource.
056    * @return This object.
057    */
058   public ResourceDescriptions append(String name, String description) {
059      super.add(new ResourceDescription(name, description));
060      return this;
061   }
062   /**
063    * Adds a new {@link ResourceDescription} to this list when the uri is different from the name.
064    *
065    * @param name The name of the child resource.
066    * @param uri The URI of the child resource.
067    * @param description The description of the child resource.
068    * @return This object.
069    */
070   public ResourceDescriptions append(String name, String uri, String description) {
071      super.add(new ResourceDescription(name, uri, description));
072      return this;
073   }
074}