001// Generated by delombok at Fri Mar 03 18:26:02 UTC 2023 002/* 003 * Licensed to the author under one or more 004 * contributor license agreements. See the NOTICE file distributed with 005 * this work for additional information regarding copyright ownership. 006 * The ASF licenses this file to You under the Apache License, Version 2.0 007 * (the "License"); you may not use this file except in compliance with 008 * the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package de.cuioss.test.generator.internal.net.java.quickcheck; 019// owolff: not a problem for test-code 020/** 021 * Indicates that a characteristic specification was not true for a given 022 * instance. 023 */ 024@SuppressWarnings("java:S1948") 025public class CharacteristicException extends RuntimeException { 026 private static final long serialVersionUID = 1L; 027 private final Object instance; 028 private final Characteristic<?> charateristic; 029 030 /** 031 * @param message 032 * error message 033 * @param cause 034 * causing exception thrown by characteristic 035 * @param charateristic 036 * characteristic violated 037 */ 038 public CharacteristicException(String message, Throwable cause, Characteristic<?> charateristic) { 039 this(message, cause, charateristic, null); 040 } 041 042 /** 043 * @param message 044 * error message 045 * @param cause 046 * causing exception thrown by characteristic 047 * @param instance 048 * violating the specified characteristic 049 * @param charateristic 050 * characteristic violated 051 */ 052 public CharacteristicException(String message, Throwable cause, Characteristic<?> charateristic, Object instance) { 053 super(message, cause); 054 this.instance = instance; 055 this.charateristic = charateristic; 056 } 057 058 /** 059 * Instance causing the characteristic violation. 060 * 061 * @return the violating instance 062 */ 063 public Object getInstance() { 064 return this.instance; 065 } 066 067 @java.lang.SuppressWarnings("all") 068 @lombok.Generated 069 public Characteristic<?> getCharateristic() { 070 return this.charateristic; 071 } 072}