refactoring: Issue #2377: The repository code has been refactored to use the recor… (#2505)

* Issue #2377: The repository code has been refactored to use the record class

* Issue #2377: Refactored according to the rules defined for the repo code

* Issue #2377: Refactored according to the rules defined for the repo code

* Issue #2377: Refactored according to the rules defined for the repo code
This commit is contained in:
Mughees Qasim authored and GitHub committed 2023-05-06 12:08:12 +03:00
1 parent c0e1603f90
commit 3ae6b07590
26 files changed
+244 -293

No files matched your search

@@ -47,7 +47,7 @@ public class Consumer {
public void consume() throws InterruptedException {
var item = queue.take();
LOGGER.info("Consumer [{}] consume item [{}] produced by [{}]", name,
item.getId(), item.getProducer());
item.id(), item.producer());
}
}
@@ -27,25 +27,5 @@ package com.iluwatar.producer.consumer;
/**
* Class take part of an {@link Producer}-{@link Consumer} exchange.
*/
public class Item {
private final String producer;
private final int id;
public Item(String producer, int id) {
this.id = id;
this.producer = producer;
}
public int getId() {
return id;
}
public String getProducer() {
return producer;
}
public record Item(String producer, int id) {
}