com.networknt.schema.output.OutputFlag Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of json-schema-validator Show documentation
Show all versions of json-schema-validator Show documentation
A json schema validator that supports draft v4, v6, v7, v2019-09 and v2020-12
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