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.helper;
014
015import java.util.*;
016
017/**
018 * A list of {@link ResourceDescription} objects.
019 */
020public class ResourceDescriptions extends ArrayList<ResourceDescription> {
021   private static final long serialVersionUID = 1L;
022
023   /**
024    * Adds a new {@link ResourceDescription} to this list.
025    *
026    * @param name The name of the child resource.
027    * @param description The description of the child resource.
028    * @return This object (for method chaining).
029    */
030   public ResourceDescriptions append(String name, String description) {
031      super.add(new ResourceDescription(name, description));
032      return this;
033   }
034   /**
035    * Adds a new {@link ResourceDescription} to this list when the uri is different from the name.
036    *
037    * @param name The name of the child resource.
038    * @param uri The URI of the child resource.
039    * @param description The description of the child resource.
040    * @return This object (for method chaining).
041    */
042   public ResourceDescriptions append(String name, String uri, String description) {
043      super.add(new ResourceDescription(name, uri, description));
044      return this;
045   }
046}