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