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

com.dimajix.shaded.everit.schema.event.ConditionalSchemaValidationEvent Maven / Gradle / Ivy

There is a newer version: 1.2.0-synapse3.3-spark3.3-hadoop3.3
Show newest version
package com.dimajix.shaded.everit.schema.event;

import java.util.Objects;

import com.dimajix.shaded.everit.schema.ConditionalSchema;

public abstract class ConditionalSchemaValidationEvent extends ValidationEvent {

    public enum Keyword {
        IF {
            @Override public String toString() {
                return "if";
            }
        },
        THEN {
            @Override public String toString() {
                return "then";
            }
        },
        ELSE {
            @Override public String toString() {
                return "else";
            }
        };
    }

    final ConditionalSchemaMatchEvent.Keyword keyword;

    public ConditionalSchemaValidationEvent(ConditionalSchema schema, Object instance, Keyword keyword) {
        super(schema, instance);
        this.keyword = keyword;
    }

    public Keyword getKeyword() {
        return keyword;
    }

    @Override public boolean equals(Object o) {
        if (this == o)
            return true;
        if (!(o instanceof ConditionalSchemaValidationEvent))
            return false;
        if (!super.equals(o))
            return false;
        ConditionalSchemaValidationEvent that = (ConditionalSchemaValidationEvent) o;
        return keyword == that.keyword;
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy