Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package de.focus_shift.launchpad.core;

import static java.util.stream.Collectors.toList;

import de.focus_shift.launchpad.api.HasLaunchpad;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -30,7 +28,7 @@ public void addAttributes(Model model, Locale locale, Authentication authenticat
app ->
new AppDto(
app.getUrl().toString(), app.getAppName().get(locale), app.getIcon()))
.collect(toList());
.toList();

if (!appDtos.isEmpty()) {
model.addAttribute("launchpad", new LaunchpadDto(appDtos));
Expand Down
32 changes: 1 addition & 31 deletions src/main/java/de/focus_shift/launchpad/core/LaunchpadDto.java
Original file line number Diff line number Diff line change
@@ -1,35 +1,5 @@
package de.focus_shift.launchpad.core;

import java.util.List;
import java.util.Objects;

class LaunchpadDto {

private final List<AppDto> apps;

LaunchpadDto(List<AppDto> apps) {
this.apps = apps;
}

public List<AppDto> getApps() {
return apps;
}

@Override
public String toString() {
return "LaunchpadDto{" + "apps=" + apps + '}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LaunchpadDto that = (LaunchpadDto) o;
return Objects.equals(apps, that.apps);
}

@Override
public int hashCode() {
return Objects.hash(apps);
}
}
record LaunchpadDto(List<AppDto> apps) {}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.focus_shift.launchpad.core;

import static java.lang.invoke.MethodHandles.lookup;
import static java.util.stream.Collectors.toList;

import de.focus_shift.launchpad.api.LaunchpadAppUrlCustomizer;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -37,7 +36,7 @@ private List<App> getApplications(Authentication authentication) {
.filter(Optional::isPresent)
.flatMap(Optional::stream)
.filter(app -> isAllowed(app, authentication))
.collect(toList());
.toList();
}

private boolean isAllowed(App app, Authentication authentication) {
Expand Down