Skip to content

Commit

Permalink
remove commons-lang3 dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
adyliu committed Sep 28, 2018
1 parent 3c377f5 commit 4eaa9fb
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 25 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
</dependency>
<!-- <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>logging-interceptor</artifactId> <version>3.10.0</version>
</dependency> -->
<dependency>
<!-- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
</dependency>
</dependency> -->

<dependency>
<groupId>org.projectlombok</groupId>
Expand Down
20 changes: 11 additions & 9 deletions src/main/java/io/jafka/jeos/exception/EosApiError.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
package io.jafka.jeos.exception;


import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;


public class EosApiError {

private String message;
Expand Down Expand Up @@ -37,12 +32,19 @@ public void setError(EosError error) {
this.error = error;
}



@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
.append("message", message)
.append("code", code)
.toString();
StringBuilder builder = new StringBuilder();
builder.append("EosApiError [message=");
builder.append(message);
builder.append(", code=");
builder.append(code);
builder.append(", error=");
builder.append(error);
builder.append("]");
return builder.toString();
}

public String getDetailedMessage() {
Expand Down
20 changes: 13 additions & 7 deletions src/main/java/io/jafka/jeos/exception/EosError.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.jafka.jeos.exception;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Arrays;

public class EosError {

Expand Down Expand Up @@ -51,10 +50,17 @@ public void setDetails(EosErrorDetails[] details) {

@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
.append("code", code)
.append("name", name)
.append("what", what)
.toString();
StringBuilder builder = new StringBuilder();
builder.append("EosError [code=");
builder.append(code);
builder.append(", name=");
builder.append(name);
builder.append(", what=");
builder.append(what);
builder.append(", details=");
builder.append(Arrays.toString(details));
builder.append("]");
return builder.toString();
}

}
19 changes: 12 additions & 7 deletions src/main/java/io/jafka/jeos/exception/EosErrorDetails.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.jafka.jeos.exception;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

public class EosErrorDetails {

Expand Down Expand Up @@ -53,10 +51,17 @@ public void setMethod(String method) {

@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
.append("message", message)
.append("file", file)
.append("lineNumber", lineNumber.toString())
.toString();
StringBuilder builder = new StringBuilder();
builder.append("EosErrorDetails [message=");
builder.append(message);
builder.append(", file=");
builder.append(file);
builder.append(", lineNumber=");
builder.append(lineNumber);
builder.append(", method=");
builder.append(method);
builder.append("]");
return builder.toString();
}

}

0 comments on commit 4eaa9fb

Please sign in to comment.