package io.vertx.ext.mongo;
import io.vertx.codegen.annotations.DataObject;
import io.vertx.core.json.JsonObject;
import java.util.Objects;
@DataObject
public class IndexModel {
private JsonObject key;
private IndexOptions options;
public IndexModel(final JsonObject key) {
this.key = key;
}
public IndexModel(final JsonObject key, final IndexOptions options) {
this.key = key;
this.options = options;
}
public JsonObject getKey() { return key; }
public IndexOptions getOptions() { return options; }
public JsonObject toJson() {
return key;
}
@Override
public String toString() {
return "IndexModel{"
+ "keys="+key
+ ", options="+options
+ '}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
IndexModel that = (IndexModel) o;
return Objects.equals(key, that.key) &&
Objects.equals(options, that.options);
}
@Override
public int hashCode() {
return Objects.hash(key, options);
}
}