Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java sdk update #615

Merged
merged 8 commits into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix sdk error
  • Loading branch information
xwm1992 committed Nov 24, 2021
commit 8c098e603ad82e78978a0fbd029b035ae68689a7
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