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   private static final long serialVersionUID = 1L;
032
033   /**
034    * Static creator.
035    *
036    * @return A new {@link ResourceDescriptions} object.
037    */
038   public static ResourceDescriptions create() {
039      return new ResourceDescriptions();
040   }
041
042   /**
043    * Adds a new {@link ResourceDescription} to this list.
044    *
045    * @param name The name of the child resource.
046    * @param description The description of the child resource.
047    * @return This object.
048    */
049   public ResourceDescriptions append(String name, String description) {
050      super.add(new ResourceDescription(name, description));
051      return this;
052   }
053
054   /**
055    * Adds a new {@link ResourceDescription} to this list when the uri is different from the name.
056    *
057    * @param name The name of the child resource.
058    * @param uri The URI of the child resource.
059    * @param description The description of the child resource.
060    * @return This object.
061    */
062   public ResourceDescriptions append(String name, String uri, String description) {
063      super.add(new ResourceDescription(name, uri, description));
064      return this;
065   }
066}