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;
014
015import org.apache.juneau.rest.annotation.*;
016import org.apache.juneau.rest.util.*;
017
018/**
019 * Represents a matched {@link Rest}-annotated child on an HTTP request.
020 *
021 * <h5 class='section'>See Also:</h5><ul>
022 *    <li class='link'><a class="doclink" href="../../../../index.html#jrs.AnnotatedClasses">@Rest-Annotated Classes</a>
023 * </ul>
024 */
025public class RestChildMatch {
026
027   private UrlPathMatch pathMatch;
028   private RestContext childContext;
029
030   /**
031    * Creator.
032    *
033    * @param pathMatch The path matching results.
034    * @param childContext The child context.
035    * @return A new {@link RestChildMatch} object.
036    */
037   public static RestChildMatch create(UrlPathMatch pathMatch, RestContext childContext) {
038      return new RestChildMatch(pathMatch, childContext);
039   }
040
041   /**
042    * Constructor.
043    *
044    * @param pathMatch The path matching results.
045    * @param childContext The child context.
046    */
047   protected RestChildMatch(UrlPathMatch pathMatch, RestContext childContext) {
048      this.pathMatch = pathMatch;
049      this.childContext = childContext;
050   }
051
052   /**
053    * Returns the path matching results of the REST child match.
054    *
055    * @return The path matching results of the REST child match.
056    */
057   public UrlPathMatch getPathMatch() {
058      return pathMatch;
059   }
060
061   /**
062    * Returns the child context of the REST child match.
063    *
064    * @return The child context of the REST child match.
065    */
066   public RestContext getChildContext() {
067      return childContext;
068   }
069}