Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
<version>5.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
22 changes: 5 additions & 17 deletions src/main/java/ru/netology/domain/Radio.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package ru.netology.domain;

import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@Data
public class Radio {
private int numberOfStations = 10;
private int currentStation;
Expand All @@ -9,9 +14,6 @@ public class Radio {
private int maxVolume = 100;
private int minVolume = 0;

public Radio() {
}

public Radio(int numberOfStations) {
if (numberOfStations > 0) {
this.numberOfStations = numberOfStations;
Expand All @@ -21,10 +23,6 @@ public Radio(int numberOfStations) {
}
}

public int getNumberOfStations() {
return numberOfStations;
}

public void setNumberOfStations(int numberOfStations) {
if (numberOfStations > 0) {
this.numberOfStations = numberOfStations;
Expand All @@ -33,11 +31,6 @@ public void setNumberOfStations(int numberOfStations) {
}
}

// 1) станции
public int getCurrentStation() {
return currentStation;
}

public void setCurrentStation(int currentStation) {
if (currentStation <= maxStation && currentStation >= minStation) {
this.currentStation = currentStation;
Expand All @@ -62,11 +55,6 @@ public void shiftPrevStation() {
}
}

// 2) звук
public int getCurrentVolume() {
return currentVolume;
}

public void setCurrentVolume(int currentVolume) {
if (currentVolume <= maxVolume && currentVolume >= minVolume) {
this.currentVolume = currentVolume;
Expand Down