com.envimate.mapmate.CustomPrimitiveSerializationMethodCallException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mapmate Show documentation
Show all versions of mapmate Show documentation
MapMate is a modern mapping framework in the scope of mapping data in
Json, XML, or YAML format into DTOs composed and vice versa.
/*
* Copyright (C) 2017 [Richard Hauswald, Nune Isabekyan] (envimate GmbH - https://envimate.com/)
*/
package com.envimate.mapmate;
import java.lang.invoke.MethodHandle;
public final class CustomPrimitiveSerializationMethodCallException extends RuntimeException {
private CustomPrimitiveSerializationMethodCallException(final String msg, final Throwable throwable) {
super(msg, throwable);
}
public static CustomPrimitiveSerializationMethodCallException fromThrowable(
final String description,
final Throwable throwable,
final Class> type,
final MethodHandle methodHandle,
final Object instance) {
final String msg = String.format("%s " +
"type: %s. " +
"method: %s. " +
"instance: %s.",
description,
type,
methodHandle,
instance);
return new CustomPrimitiveSerializationMethodCallException(msg, throwable);
}
}