
com.yodlee.api.model.annotations.AllowedContainerValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yodlee-api-model-beta Show documentation
Show all versions of yodlee-api-model-beta Show documentation
Yodlee API Model Beta is the stage 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.annotations;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import com.yodlee.api.model.enums.Container;
public class AllowedContainerValidator implements ConstraintValidator {
protected List containers;
@Override
public void initialize(AllowedContainer containers) {
this.containers = Arrays.asList(containers.value());
}
@Override
public boolean isValid(Container container, ConstraintValidatorContext constraintValidatorContext) {
if (Objects.isNull(container)) {
return true;
}
return containers.contains(container);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy