001/*
002 * Copyright 2012-2018 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.boot.actuate.web.mappings.servlet;
018
019import java.util.Collection;
020
021import javax.servlet.FilterRegistration;
022
023/**
024 * A {@link RegistrationMappingDescription} derived from a {@link FilterRegistration}.
025 *
026 * @author Andy Wilkinson
027 * @since 2.0.0
028 */
029public class FilterRegistrationMappingDescription
030                extends RegistrationMappingDescription<FilterRegistration> {
031
032        /**
033         * Creates a new {@code FilterRegistrationMappingDescription} derived from the given
034         * {@code filterRegistration}.
035         * @param filterRegistration the filter registration
036         */
037        public FilterRegistrationMappingDescription(FilterRegistration filterRegistration) {
038                super(filterRegistration);
039        }
040
041        /**
042         * Returns the servlet name mappings for the registered filter.
043         * @return the mappings
044         */
045        public Collection<String> getServletNameMappings() {
046                return this.getRegistration().getServletNameMappings();
047        }
048
049        /**
050         * Returns the URL pattern mappings for the registered filter.
051         * @return the mappings
052         */
053        public Collection<String> getUrlPatternMappings() {
054                return this.getRegistration().getUrlPatternMappings();
055        }
056
057}