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

com.networknt.schema.output.OutputFlag Maven / Gradle / Ivy

There is a newer version: 1.5.3
Show newest version
package com.networknt.schema.output;

import java.util.Objects;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.networknt.schema.serialization.JsonMapperFactory;

/**
 * The Flag output results.
 */
public class OutputFlag {
    private final boolean valid;

    public OutputFlag(boolean valid) {
        this.valid = valid;
    }

    public boolean isValid() {
        return this.valid;
    }

    @Override
    public int hashCode() {
        return Objects.hash(valid);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        OutputFlag other = (OutputFlag) obj;
        return valid == other.valid;
    }

    @Override
    public String toString() {
        try {
            return JsonMapperFactory.getInstance().writerWithDefaultPrettyPrinter().writeValueAsString(this);
        } catch (JsonProcessingException e) {
            return "OutputFlag [valid=" + valid + "]";
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy