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