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 everit-json-schema Show documentation
Show all versions of everit-json-schema Show documentation
Implementation of the JSON Schema Core Draft v4 specification built with the org.json API
package org.everit.json.schema;
import java.io.StringWriter;
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
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 - 2024 Weber Informatics LLC | Privacy Policy