
org.everit.json.schema.BooleanSchema Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.everit.json.schema Show documentation
Show all versions of org.everit.json.schema Show documentation
This is a fork of the implementation of the JSON Schema Core Draft v4 specification built with the org.json API which also supports internationalization
The newest version!
package org.everit.json.schema;
import org.everit.json.schema.internal.JSONPrinter;
/**
* Boolean schema validator.
*/
public class BooleanSchema extends Schema {
/**
* Builder class for {@link BooleanSchema}.
*/
public static class Builder extends Schema.Builder {
@Override
public BooleanSchema build() {
return new BooleanSchema(this);
}
}
public static final BooleanSchema INSTANCE = new BooleanSchema(builder());
public static Builder builder() {
return new Builder();
}
public BooleanSchema(final Builder builder) {
super(builder);
}
@Override
void describePropertiesTo(final JSONPrinter writer) {
writer.key("type");
writer.value("boolean");
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o instanceof BooleanSchema) {
BooleanSchema that = (BooleanSchema) o;
return that.canEqual(this) && super.equals(that);
} else {
return false;
}
}
@Override void accept(Visitor visitor) {
visitor.visitBooleanSchema(this);
}
@Override
protected boolean canEqual(final Object other) {
return other instanceof BooleanSchema;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy