org.elasticsearch.client.ml.StopDataFrameAnalyticsResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-rest-high-level-client Show documentation
Show all versions of elasticsearch-rest-high-level-client Show documentation
Elasticsearch subproject :client:rest-high-level
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
package org.elasticsearch.client.ml;
import org.elasticsearch.xcontent.ConstructingObjectParser;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xcontent.ToXContentObject;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentParser;
import java.io.IOException;
import java.util.Objects;
/**
* Response indicating if the Machine Learning Data Frame Analytics is now stopped or not
*/
public class StopDataFrameAnalyticsResponse implements ToXContentObject {
private static final ParseField STOPPED = new ParseField("stopped");
public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>(
"stop_data_frame_analytics_response",
true,
args -> new StopDataFrameAnalyticsResponse((Boolean) args[0])
);
static {
PARSER.declareBoolean(ConstructingObjectParser.constructorArg(), STOPPED);
}
public static StopDataFrameAnalyticsResponse fromXContent(XContentParser parser) throws IOException {
return PARSER.parse(parser, null);
}
private final boolean stopped;
public StopDataFrameAnalyticsResponse(boolean stopped) {
this.stopped = stopped;
}
/**
* Has the Data Frame Analytics stopped or not
*
* @return boolean value indicating the Data Frame Analytics stopped status
*/
public boolean isStopped() {
return stopped;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
StopDataFrameAnalyticsResponse other = (StopDataFrameAnalyticsResponse) o;
return stopped == other.stopped;
}
@Override
public int hashCode() {
return Objects.hash(stopped);
}
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return builder.startObject().field(STOPPED.getPreferredName(), stopped).endObject();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy