Skip to content

Commit

Permalink
prepare for JAVA 21
Browse files Browse the repository at this point in the history
  • Loading branch information
paxel committed Sep 26, 2023
1 parent eca84d7 commit e29b2d0
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
java-version: '21'
distribution: 'oracle'
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
4 changes: 2 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
distribution: 'oracle'
java-package: 'jdk'
java-version: '11'
java-version: '21'
check-latest: true
server-id: 'ossrh' # must match the serverId configured for the nexus-staging-maven-plugin
server-username: OSSRH_USERNAME # Env var that holds your OSSRH user name
Expand Down
13 changes: 4 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<modelVersion>4.0.0</modelVersion>

<groupId>io.github.paxel</groupId>
<artifactId>lintstone-java11</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>lintstone</artifactId>
<version>2.0.0-SNAPSHOT</version>

<name>LintStone - Actor System</name>

Expand Down Expand Up @@ -45,13 +45,8 @@
<dependencies>
<dependency>
<groupId>io.github.paxel</groupId>
<artifactId>group-executor-java11</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
<artifactId>group-executor</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/paxel/lintstone/api/ActorSettingsBuilder.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package paxel.lintstone.api;

import lombok.Getter;
import paxel.bulkexecutor.ErrorHandler;
import paxel.lintstone.impl.ActorSettingsImpl;

@Getter
public class ActorSettingsBuilder {
private int batch = 1;
private ErrorHandler errorHandler = x -> true;
Expand All @@ -23,4 +21,12 @@ public ActorSettingsBuilder setBatch(int batch) {
public ActorSettings build() {
return new ActorSettingsImpl(batch, errorHandler);
}

public int getBatch() {
return this.batch;
}

public ErrorHandler getErrorHandler() {
return this.errorHandler;
}
}
62 changes: 54 additions & 8 deletions src/main/java/paxel/lintstone/impl/FailedMessage.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,66 @@
package paxel.lintstone.impl;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import paxel.lintstone.api.LintStoneFailedMessage;

@ToString
@Getter
@AllArgsConstructor
@EqualsAndHashCode
public class FailedMessage implements LintStoneFailedMessage {

private final Object message;
private final Throwable cause;
private final String actorName;


public FailedMessage(Object message, Throwable cause, String actorName) {
this.message = message;
this.cause = cause;
this.actorName = actorName;
}

public Object getMessage() {
return this.message;
}

public Throwable getCause() {
return this.cause;
}

public String getActorName() {
return this.actorName;
}

public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof FailedMessage)) return false;
final FailedMessage other = (FailedMessage) o;
if (!other.canEqual((Object) this)) return false;
final Object this$message = this.getMessage();
final Object other$message = other.getMessage();
if (this$message == null ? other$message != null : !this$message.equals(other$message)) return false;
final Object this$cause = this.getCause();
final Object other$cause = other.getCause();
if (this$cause == null ? other$cause != null : !this$cause.equals(other$cause)) return false;
final Object this$actorName = this.getActorName();
final Object other$actorName = other.getActorName();
if (this$actorName == null ? other$actorName != null : !this$actorName.equals(other$actorName)) return false;
return true;
}

protected boolean canEqual(final Object other) {
return other instanceof FailedMessage;
}

public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $message = this.getMessage();
result = result * PRIME + ($message == null ? 43 : $message.hashCode());
final Object $cause = this.getCause();
result = result * PRIME + ($cause == null ? 43 : $cause.hashCode());
final Object $actorName = this.getActorName();
result = result * PRIME + ($actorName == null ? 43 : $actorName.hashCode());
return result;
}

public String toString() {
return "FailedMessage(message=" + this.getMessage() + ", cause=" + this.getCause() + ", actorName=" + this.getActorName() + ")";
}
}

0 comments on commit e29b2d0

Please sign in to comment.