📍Use lombok, reformat, and optimize the code (#1560)
* Use lombok, reformat, and optimize the code * Fix merge conflicts and some sonar issues Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
@@ -27,8 +27,7 @@ import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Event or message queues provide an asynchronous communications protocol, meaning that the sender
|
||||
@@ -40,10 +39,9 @@ import org.slf4j.LoggerFactory;
|
||||
* enqueues the request and returns. The request processor then processes items from the queue at a
|
||||
* later time.
|
||||
*/
|
||||
@Slf4j
|
||||
public class App {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
|
||||
|
||||
/**
|
||||
* Program entry point.
|
||||
*
|
||||
|
||||
@@ -29,16 +29,15 @@ import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.sound.sampled.LineUnavailableException;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* This class implements the Event Queue pattern.
|
||||
*
|
||||
* @author mkuprivecz
|
||||
*/
|
||||
@Slf4j
|
||||
public class Audio {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Audio.class);
|
||||
private static final Audio INSTANCE = new Audio();
|
||||
|
||||
private static final int MAX_PENDING = 16;
|
||||
|
||||
@@ -24,36 +24,22 @@
|
||||
package com.iluwatar.event.queue;
|
||||
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The Event Queue's queue will store the instances of this class.
|
||||
*
|
||||
* @author mkuprivecz
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class PlayMessage {
|
||||
|
||||
private AudioInputStream stream;
|
||||
private final AudioInputStream stream;
|
||||
|
||||
@Setter
|
||||
private float volume;
|
||||
|
||||
public PlayMessage(AudioInputStream stream, float volume) {
|
||||
setStream(stream);
|
||||
setVolume(volume);
|
||||
}
|
||||
|
||||
public AudioInputStream getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
private void setStream(AudioInputStream stream) {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public float getVolume() {
|
||||
return volume;
|
||||
}
|
||||
|
||||
public void setVolume(float volume) {
|
||||
this.volume = volume;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user