Delomboking
This commit is contained in:
@@ -22,22 +22,23 @@ import java.nio.ByteBuffer;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class Host {
|
||||
|
||||
private String serviceName;
|
||||
private String address;
|
||||
private Integer port;
|
||||
|
||||
public Host(String serviceName, String address, Integer port) {
|
||||
this.serviceName = serviceName;
|
||||
this.address = address;
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public int getIpv4() {
|
||||
InetAddress inetAddress = null;
|
||||
try {
|
||||
@@ -49,4 +50,27 @@ public class Host {
|
||||
return ByteBuffer.wrap(inetAddress.getAddress()).getInt();
|
||||
}
|
||||
|
||||
public String getServiceName() {
|
||||
return this.serviceName;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return this.address;
|
||||
}
|
||||
|
||||
public Integer getPort() {
|
||||
return this.port;
|
||||
}
|
||||
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public void setPort(Integer port) {
|
||||
this.port = port;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,14 +18,27 @@ package org.springframework.cloud.sleuth.stream;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@ConfigurationProperties("spring.sleuth.stream")
|
||||
@Data
|
||||
public class SleuthStreamProperties {
|
||||
private boolean enabled = true;
|
||||
private String group = SleuthSink.INPUT;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
public String getGroup() {
|
||||
return this.group;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public void setGroup(String group) {
|
||||
this.group = group;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,6 @@ import org.springframework.cloud.sleuth.Span;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Data transfer object for a collection of spans from a given host.
|
||||
*
|
||||
@@ -33,11 +30,29 @@ import lombok.Data;
|
||||
*
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class Spans {
|
||||
|
||||
private Host host;
|
||||
private List<Span> spans = Collections.emptyList();
|
||||
|
||||
public Spans(Host host, List<Span> spans) {
|
||||
this.host = host;
|
||||
this.spans = spans;
|
||||
}
|
||||
|
||||
public Host getHost() {
|
||||
return this.host;
|
||||
}
|
||||
|
||||
public List<Span> getSpans() {
|
||||
return this.spans;
|
||||
}
|
||||
|
||||
public void setHost(Host host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public void setSpans(List<Span> spans) {
|
||||
this.spans = spans;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user