com.ecwid.consul.v1.Response Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of consul-api Show documentation
Show all versions of consul-api Show documentation
Java client for Consul HTTP API (http://consul.io)
The newest version!
package com.ecwid.consul.v1;
import com.ecwid.consul.transport.HttpResponse;
/**
* @author Vasily Vasilkov ([email protected])
*/
public final class Response {
private final T value;
private final Long consulIndex;
private final Boolean consulKnownLeader;
private final Long consulLastContact;
public Response(T value, Long consulIndex, Boolean consulKnownLeader, Long consulLastContact) {
this.value = value;
this.consulIndex = consulIndex;
this.consulKnownLeader = consulKnownLeader;
this.consulLastContact = consulLastContact;
}
public Response(T value, HttpResponse httpResponse) {
this(value, httpResponse.getConsulIndex(), httpResponse.isConsulKnownLeader(), httpResponse.getConsulLastContact());
}
public T getValue() {
return value;
}
public Long getConsulIndex() {
return consulIndex;
}
public Boolean isConsulKnownLeader() {
return consulKnownLeader;
}
public Long getConsulLastContact() {
return consulLastContact;
}
@Override
public String toString() {
return "Response{" +
"value=" + value +
", consulIndex=" + consulIndex +
", consulKnownLeader=" + consulKnownLeader +
", consulLastContact=" + consulLastContact +
'}';
}
}