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

com.yodlee.api.model.validator.Problem Maven / Gradle / Ivy

There is a newer version: 1.0.29.beta1
Show newest version
/**
 * Copyright (c) 2019 Yodlee, Inc. All Rights Reserved.
 *
 * Licensed under the MIT License. See LICENSE file in the project root for license information.
 */
package com.yodlee.api.model.validator;

public class Problem {

	private final String errorCode;

	private final String message;

	private final String propertyPath;

	public Problem(String message, String propertyPath) {
		super();
		if (message != null) {
			String[] messageParts = message.split("-", 2);
			if (messageParts.length > 1) {
				this.errorCode = messageParts[0].trim();
				this.message = messageParts[1].trim();
			} else {
				this.errorCode = "";
				this.message = message.trim();
			}
		} else {
			this.errorCode = "";
			this.message = "";
		}
		this.propertyPath = propertyPath;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public String getMessage() {
		return message;
	}

	public String getPropertyPath() {
		return propertyPath;
	}

	@Override
	public String toString() {
		return "Problem [errorCode=" + errorCode + ", constraintViolation=" + message + ", propertyPath=" + propertyPath
				+ "]";
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy