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

com.enonic.xp.content.DataValidationError Maven / Gradle / Ivy

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

import java.util.List;
import java.util.Objects;

import com.enonic.xp.data.PropertyPath;

public final class DataValidationError
    extends ValidationError
{
    private final PropertyPath propertyPath;

    DataValidationError( final PropertyPath propertyPath, final ValidationErrorCode errorCode, final String message, final String i18n,
                         final List args )
    {
        super( errorCode, message, i18n, args );
        this.propertyPath = Objects.requireNonNull( propertyPath );
    }

    public PropertyPath getPropertyPath()
    {
        return propertyPath;
    }

    @Override
    public boolean equals( final Object o )
    {
        if ( this == o )
        {
            return true;
        }
        if ( o == null || getClass() != o.getClass() )
        {
            return false;
        }
        if ( !super.equals( o ) )
        {
            return false;
        }
        final DataValidationError that = (DataValidationError) o;
        return propertyPath.equals( that.propertyPath );
    }

    @Override
    public int hashCode()
    {
        return Objects.hash( super.hashCode(), propertyPath );
    }
}