Code Conventions
This commit is contained in:
parent
e81984fcc1
commit
a121811b12
@ -9,23 +9,37 @@ import java.util.List;
|
||||
*/
|
||||
public class TestFavorites implements IFAVORITES {
|
||||
|
||||
/**
|
||||
* Liste der favoriten.
|
||||
*/
|
||||
private List<String> favorites = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<String> getFavorites() {
|
||||
return favorites;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param deviceName the name of the device to be added
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String addFavorite(String deviceName) {
|
||||
public String addFavorite(final String deviceName) {
|
||||
if (!favorites.contains(deviceName)) {
|
||||
favorites.add(deviceName);
|
||||
}
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param deviceName the name of the device to be removed
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String removeFavorite(String deviceName) {
|
||||
public String removeFavorite(final String deviceName) {
|
||||
if (favorites.contains(deviceName)) {
|
||||
favorites.remove(deviceName);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user