Skip to content

Commit

Permalink
Java sdk update (#610)
Browse files Browse the repository at this point in the history
* update java sdk

* fix compile error

* fix sdk error
  • Loading branch information
xwm1992 authored Nov 24, 2021
1 parent 5c02b4e commit 0012d76
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import lombok.Builder;
import lombok.Data;

import java.util.Objects;

@Data
@Builder
public class UserAgent {
Expand All @@ -40,4 +42,70 @@ public class UserAgent {
@Builder.Default
private int unack = 0;

public UserAgent() {
}

public UserAgent(String env, String subsystem, String path, int pid, String host, int port, String version,
String username, String password, String idc, String producerGroup, String consumerGroup,
String purpose, int unack) {
this.env = env;
this.subsystem = subsystem;
this.path = path;
this.pid = pid;
this.host = host;
this.port = port;
this.version = version;
this.username = username;
this.password = password;
this.idc = idc;
this.producerGroup = producerGroup;
this.consumerGroup = consumerGroup;
this.purpose = purpose;
this.unack = unack;
}

@Override
public String toString() {
return String.format(
"UserAgent{env='%s'subsystem='%s', path='%s', pid=%d, host='%s', port=%d, version='%s', idc='%s', purpose='%s', unack='%d'}",
env, subsystem, path, pid, host, port, version, idc, purpose, unack);
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

UserAgent userAgent = (UserAgent) o;

if (pid != userAgent.pid) return false;
if (port != userAgent.port) return false;
if (unack != userAgent.unack) return false;
if (!Objects.equals(subsystem, userAgent.subsystem)) return false;
if (!Objects.equals(path, userAgent.path)) return false;
if (!Objects.equals(host, userAgent.host)) return false;
if (!Objects.equals(purpose, userAgent.purpose)) return false;
if (!Objects.equals(version, userAgent.version)) return false;
if (!Objects.equals(username, userAgent.username)) return false;
if (!Objects.equals(password, userAgent.password)) return false;
if (!Objects.equals(env, userAgent.env)) return false;
return Objects.equals(idc, userAgent.idc);
}

@Override
public int hashCode() {
int result = subsystem != null ? subsystem.hashCode() : 0;
result = 31 * result + (path != null ? path.hashCode() : 0);
result = 31 * result + pid;
result = 31 * result + (host != null ? host.hashCode() : 0);
result = 31 * result + (purpose != null ? purpose.hashCode() : 0);
result = 31 * result + port;
result = 31 * result + (version != null ? version.hashCode() : 0);
result = 31 * result + (username != null ? username.hashCode() : 0);
result = 31 * result + (password != null ? password.hashCode() : 0);
result = 31 * result + (idc != null ? idc.hashCode() : 0);
result = 31 * result + (env != null ? env.hashCode() : 0);
result = 31 * result + unack;
return result;
}
}
4 changes: 4 additions & 0 deletions eventmesh-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
* limitations under the License.
*/

configurations {
implementation.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}

dependencies {
implementation project(":eventmesh-sdk-java")
implementation project(":eventmesh-common")
Expand Down

0 comments on commit 0012d76

Please sign in to comment.