Skip to content

Commit fca7532

Browse files
committed
Use Java 17 records
1 parent e631f7d commit fca7532

2 files changed

Lines changed: 9 additions & 62 deletions

File tree

chartjs-java-model/src/test/java/software/xdev/chartjs/model/BasicChartTest.java

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -185,35 +185,11 @@ private static <D extends HomogeneousData<D, S>, S extends Dataset<S, O>, O> Sup
185185
};
186186
}
187187

188-
public static class ArgumentDTO<O extends Options<?, ?>, D extends AbstractData<?, ?>>
188+
public record ArgumentDTO<O extends Options<?, ?>, D extends AbstractData<?, ?>>(
189+
Supplier<Chart<?, O, D>> chartSupplier,
190+
Supplier<O> optionsSupplier,
191+
Supplier<D> dataSupplier
192+
)
189193
{
190-
private final Supplier<Chart<?, O, D>> chartSupplier;
191-
private final Supplier<O> optionsSupplier;
192-
private final Supplier<D> dataSupplier;
193-
194-
public ArgumentDTO(
195-
final Supplier<Chart<?, O, D>> chartSupplier,
196-
final Supplier<O> optionsSupplier,
197-
final Supplier<D> dataSupplier)
198-
{
199-
this.chartSupplier = chartSupplier;
200-
this.optionsSupplier = optionsSupplier;
201-
this.dataSupplier = dataSupplier;
202-
}
203-
204-
public Supplier<Chart<?, O, D>> chartSupplier()
205-
{
206-
return this.chartSupplier;
207-
}
208-
209-
public Supplier<O> optionsSupplier()
210-
{
211-
return this.optionsSupplier;
212-
}
213-
214-
public Supplier<D> dataSupplier()
215-
{
216-
return this.dataSupplier;
217-
}
218194
}
219195
}

chartjs-java-model/src/test/java/software/xdev/chartjs/model/ChartAxisFormatTest.java

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -51,40 +51,11 @@ void format()
5151
"Format");
5252
}
5353

54-
public static class CurrencyFormatOptions
54+
public record CurrencyFormatOptions(
55+
String style,
56+
String currency
57+
)
5558
{
56-
private String style;
57-
private String currency;
58-
59-
public CurrencyFormatOptions()
60-
{
61-
}
62-
63-
public CurrencyFormatOptions(final String style, final String currency)
64-
{
65-
this.style = style;
66-
this.currency = currency;
67-
}
68-
69-
public String getStyle()
70-
{
71-
return this.style;
72-
}
73-
74-
public void setStyle(final String style)
75-
{
76-
this.style = style;
77-
}
78-
79-
public String getCurrency()
80-
{
81-
return this.currency;
82-
}
83-
84-
public void setCurrency(final String currency)
85-
{
86-
this.currency = currency;
87-
}
8859
}
8960

9061
static BarData data()

0 commit comments

Comments
 (0)