1 /* 2 * Copyright (C) 2008, Florian Köberle <florianskarten@web.de> 3 * Copyright (C) 2009, Vasyl' Vavrychuk <vvavrychuk@gmail.com> and others 4 * 5 * This program and the accompanying materials are made available under the 6 * terms of the Eclipse Distribution License v. 1.0 which is available at 7 * https://www.eclipse.org/org/documents/edl-v10.php. 8 * 9 * SPDX-License-Identifier: BSD-3-Clause 10 */ 11 12 package org.eclipse.jgit.errors; 13 14 /** 15 * Thrown when a pattern passed in an argument was wrong. 16 */ 17 public class InvalidPatternException extends Exception { 18 private static final long serialVersionUID = 1L; 19 20 private final String pattern; 21 22 /** 23 * Constructor for InvalidPatternException 24 * 25 * @param message 26 * explains what was wrong with the pattern. 27 * @param pattern 28 * the invalid pattern. 29 */ 30 public InvalidPatternException(String message, String pattern) { 31 super(message); 32 this.pattern = pattern; 33 } 34 35 /** 36 * Constructor for InvalidPatternException 37 * 38 * @param message 39 * explains what was wrong with the pattern. 40 * @param pattern 41 * the invalid pattern. 42 * @param cause 43 * the cause. 44 * @since 4.10 45 */ 46 public InvalidPatternException(String message, String pattern, 47 Throwable cause) { 48 this(message, pattern); 49 initCause(cause); 50 } 51 52 /** 53 * Get the invalid pattern 54 * 55 * @return the invalid pattern. 56 */ 57 public String getPattern() { 58 return pattern; 59 } 60 61 }