001/* 002 * Copyright 2016 The AppAuth for Android Authors. All Rights Reserved. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 005 * in compliance 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 010 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 011 * express or implied. See the License for the specific language governing permissions and 012 * limitations under the License. 013 */ 014 015package net.openid.appauth.browser; 016 017import androidx.annotation.NonNull; 018 019/** 020 * Matches only the specified browser. 021 */ 022public class ExactBrowserMatcher implements BrowserMatcher { 023 024 private BrowserDescriptor mBrowser; 025 026 /** 027 * Creates a browser matcher that will only match the specified browser. 028 */ 029 public ExactBrowserMatcher(BrowserDescriptor browser) { 030 mBrowser = browser; 031 } 032 033 @Override 034 public boolean matches(@NonNull BrowserDescriptor descriptor) { 035 return mBrowser.equals(descriptor); 036 } 037}