ar.com.kfgodel.primitons.api.exceptions.UnmappableException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of primitons Show documentation
Show all versions of primitons Show documentation
Java project that offers numerous primitive conversions as functions
The newest version!
package ar.com.kfgodel.primitons.api.exceptions;
/**
* This type represents the error in which a value is not convertable to the destination type
* Date: 29/07/17 - 18:40
*/
public class UnmappableException extends PrimitonException {
private final Object value;
private final Class> expectedType;
public UnmappableException(Object value, Class> expectedType, Throwable cause) {
super("Value["+value+"] is not convertible to type ["+expectedType+"]: " + cause.getMessage(), cause);
this.value = value;
this.expectedType = expectedType;
}
public UnmappableException(Object value, Class> expectedType) {
this("Value["+value+"] is not convertible to type ["+expectedType+"]", value, expectedType);
}
public UnmappableException(String message, Object value, Class> expectedType) {
super(message);
this.value = value;
this.expectedType = expectedType;
}
public Object getValue() {
return value;
}
public Class> getExpectedType() {
return expectedType;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy