Skip to content

Commit

Permalink
Merge pull request #14 from reeyur/feature/add-toString
Browse files Browse the repository at this point in the history
Added toString() method to the Events, EventDetail.
  • Loading branch information
yury-awesome authored Oct 18, 2019
2 parents bc62b01 + 655fa78 commit e35c9d0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.meituan.lyrebird.sdk</groupId>
<artifactId>lyrebird-java-client</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>

<name>lyrebird-java-client</name>
<url>https://github.com/Meituan-Dianping/lyrebird-java-client</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ public long getTimestamp() {

public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
}

@Override
public String toString() {
return String.format("%n[eventId] %s,[channel] %s, [timestamp] %s%n[content] %s%n", eventID, channel, timestamp, content);
}
}
17 changes: 12 additions & 5 deletions src/main/java/com/meituan/lyrebird/client/api/Events.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Arrays;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Events extends BaseResponse {
private EventDetail[] events;
private EventDetail[] eventDetails;
private int page;
@JsonProperty("page_count")
private int pageCount;
@JsonProperty("page_size")
private int pageSize;

public EventDetail[] getEvents() {
return events;
return eventDetails;
}

public void setEvents(EventDetail[] events) {
this.events = events;
public void setEvents(EventDetail[] eventDetails) {
this.eventDetails = eventDetails;
}

public int getPage() {
Expand All @@ -42,5 +44,10 @@ public int getPageSize() {

public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
}

@Override
public String toString() {
return String.format("%n[page] %s,[page count] %s, [page size] %s%n%s%n", page, pageCount, pageSize, Arrays.toString(eventDetails));
}
}

0 comments on commit e35c9d0

Please sign in to comment.