
ru.mynewtons.starter.oauth2.exception.EntityNotFoundException Maven / Gradle / Ivy
The newest version!
package ru.mynewtons.starter.oauth2.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.NOT_FOUND)
public class EntityNotFoundException extends RuntimeException {
public EntityNotFoundException(String formatString, Class clazz, String by, String searchString) {
super(String.format(formatString, clazz.getName(), by, searchString));
}
public EntityNotFoundException(String formatString, Class clazz) {
super(String.format(formatString, clazz.getName()));
}
public EntityNotFoundException(String message) {
super(message);
}
public EntityNotFoundException(String formatString, Class clazz, String objectId) {
this(formatString, clazz, "objectId", objectId);
}
public EntityNotFoundException(String formatString, Class clazz, Number objectId) {
this(formatString, clazz, objectId.toString());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy