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

pl.jalokim.propertiestojson.util.exception.CannotOverrideFieldException Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
package pl.jalokim.propertiestojson.util.exception;

import com.google.common.annotations.VisibleForTesting;
import pl.jalokim.propertiestojson.object.AbstractJsonType;

public class CannotOverrideFieldException extends RuntimeException {

    private static final String CANNOT_OVERRIDE_VALUE = "Cannot override value at path: '%s', current value is: '%s', problematic property key: '%s'";

    public CannotOverrideFieldException(String currentPath, AbstractJsonType currentValue, String propertyKey) {
        this(currentPath, currentValue.toString(), propertyKey);
    }

    @VisibleForTesting
    public CannotOverrideFieldException(String currentPath, String currentValue, String propertyKey) {
        super(String.format(CANNOT_OVERRIDE_VALUE, currentPath, currentValue, propertyKey));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy