-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: mock sfera communication and add example JP and SP #323
Conversation
|
||
var tid = TrainIdentification.fromString(elements[length - 2], elements[length - 3]); | ||
|
||
return new RequestContext(tid, new ClientId(UUID.fromString(elements[length - 1])), incomingMessageId, Optional.empty()); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
import java.util.UUID; | ||
import lombok.NonNull; | ||
|
||
public record ClientId(@NonNull UUID value) implements Comparable<ClientId> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- value: String
import java.util.UUID; | ||
import lombok.NonNull; | ||
|
||
public record RequestContext(@NonNull TrainIdentification tid, @NonNull ClientId clientId, @NonNull Optional<UUID> incomingMessageId, @NonNull Optional<String> customPrefix) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me 👍 I didn't test it locally but if you wish for it, maybe we can take a look at the setup together.
public static TrainIdentification fromString(String tid, String companyCode) { | ||
var matcher = TID_PATTERN.matcher(tid); | ||
if (matcher.matches()) { | ||
var operationalNumber = matcher.group(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: you could use final var generally in your code. Just a nitpick, no need to change it now.
No description provided.