All Downloads are FREE. Search and download functionalities are using the official Maven repository.

marcel.lang.NoSuchPropertyException Maven / Gradle / Ivy

package marcel.lang;

import lombok.Getter;

public class NoSuchPropertyException extends RuntimeException {

  /// nullable, e.g. for binding
  @Getter
  private final Class type;
  @Getter
  private final String propertyName;

  public NoSuchPropertyException(Class type, String propertyName) {
    super(generateMessage(type, propertyName));
    this.type = type;
    this.propertyName = propertyName;
  }


  private static String generateMessage(Class type, String propertyName) {
    return type == null ? "No such property '" + propertyName + "'"
        : "No such property '" + propertyName + "' for class " + type;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy