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

com.enonic.xp.convert.ConvertException Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.convert;

import com.enonic.xp.annotation.PublicApi;

@PublicApi
public final class ConvertException
    extends RuntimeException
{
    public ConvertException( final String message )
    {
        super( message );
    }

    public ConvertException( final String message, final Throwable cause )
    {
        super( message, cause );
    }

    public static ConvertException noSuchConverter( final Class source, final Class target )
    {
        return new ConvertException( String.format( "No such converter for %s -> %s", source.getName(), target.getName() ) );
    }

    public static ConvertException convertFailure( final Class source, final Class target, final Throwable cause )
    {
        return new ConvertException( String.format( "Failed to convert %s -> %s", source.getName(), target.getName() ), cause );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy