001package io.avaje.http.api; 002 003/** 004 * Exception for parameters that are required. 005 * <p> 006 * This is primarily intended for use when populating Kotlin form beans 007 * with non-nullable properties and failing early rather than validate 008 * the entire bean. 009 */ 010public class RequiredArgumentException extends IllegalArgumentException { 011 012 private String property; 013 014 public RequiredArgumentException(String message, String property) { 015 super(message); 016 this.property = property; 017 } 018 019 public RequiredArgumentException(Exception e) { 020 super(e); 021 } 022 023 public RequiredArgumentException(String message, Exception e) { 024 super(message, e); 025 } 026 027 /** 028 * Return the name of the property that is required. 029 */ 030 public String getProperty() { 031 return property; 032 } 033 034 /** 035 * Set the name of the required property. 036 */ 037 public void setProperty(String property) { 038 this.property = property; 039 } 040}