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

fr.ird.observe.validation.ValidatorDto Maven / Gradle / Ivy

There is a newer version: 4.34
Show newest version
package fr.ird.observe.validation;

/*-
 * #%L
 * ObServe Toolkit :: Common Validation
 * %%
 * Copyright (C) 2017 - 2019 IRD, Ultreia.io
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * .
 * #L%
 */

import fr.ird.observe.dto.IdDto;
import org.nuiton.validator.NuitonValidatorScope;

import java.util.Objects;
import java.util.Set;

/**
 * @author Tony Chemit - [email protected]
 */
public class ValidatorDto {

    private final Class type;
    private final NuitonValidatorScope scope;
    private final String context;
    private final Set fields;

    public ValidatorDto(Class type, NuitonValidatorScope scope, String context, Set fields) {
        this.type = type;
        this.scope = scope;
        this.context = context;
        this.fields = fields;
    }

    public Class getType() {
        return type;
    }

    public NuitonValidatorScope getScope() {
        return scope;
    }

    public String getContext() {
        return context;
    }

    public Set getFields() {
        return fields;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ValidatorDto that = (ValidatorDto) o;
        return Objects.equals(type, that.type) &&
                Objects.equals(scope, that.scope) &&
                Objects.equals(context, that.context);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, scope, context);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy