Skip to content
Snippets Groups Projects
Commit f2dd42ca authored by Robert Goldmann's avatar Robert Goldmann
Browse files

convert class NewsEntry to record

parent e5060dd4
No related branches found
No related tags found
No related merge requests found
......@@ -4,17 +4,8 @@ import de.thecodelabs.utils.util.Localization;
import java.text.MessageFormat;
public class NewsEntry
public record NewsEntry(String headline, String description)
{
private final String headline;
private final String description;
public NewsEntry(String headline, String description)
{
this.headline = headline;
this.description = description;
}
public static NewsEntry createWithLocalizationKey(String shortKey)
{
return createWithLocalizationKeys(MessageFormat.format("news.{0}.headline", shortKey),
......@@ -26,15 +17,6 @@ public class NewsEntry
return new NewsEntry(Localization.getString(headlineKey), Localization.getString(descriptionKey));
}
public String getHeadline()
{
return headline;
}
public String getDescription()
{
return description;
}
@Override
public String toString()
......
......@@ -13,8 +13,8 @@
<#list newsEntries as entry>
<div class="row">
<div class="col s12">
<h5>${entry.getHeadline()}</h5>
${entry.getDescription()}
<h5>${entry.headline()}</h5>
${entry.description()}
</div>
</div>
</#list>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment