Skip to content

Commit 1bacff7

Browse files
authored
refactor!: remove deprecated methods using Date (#7991)
1 parent 83ec504 commit 1bacff7

31 files changed

+13
-344
lines changed

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/AbstractSeriesItem.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package com.vaadin.flow.component.charts.model;
1010

1111
import java.time.Instant;
12-
import java.util.Date;
1312

1413
import com.vaadin.flow.component.charts.model.style.Color;
1514
import com.vaadin.flow.component.charts.util.Util;
@@ -102,14 +101,6 @@ public void setX(Instant instant) {
102101
setX(Util.toHighchartsTS(instant));
103102
}
104103

105-
/**
106-
* @deprecated as of 4.0. Use {@link #setX(Instant)}
107-
*/
108-
@Deprecated
109-
public void setX(Date date) {
110-
setX(Util.toHighchartsTS(date));
111-
}
112-
113104
/**
114105
* Checks whether or not the item is sliced. Makes sense only in pie charts.
115106
*

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/AreaOptions.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package com.vaadin.flow.component.charts.model;
1010

1111
import java.time.Instant;
12-
import java.util.Date;
1312

1413
import com.vaadin.flow.component.charts.model.style.Color;
1514

@@ -754,12 +753,6 @@ public abstract void setNavigatorOptions(
754753
*/
755754
public abstract void setPointRange(Number pointRange);
756755

757-
/**
758-
* @deprecated as of 4.0. Use {@link #setPointStart(Instant)}
759-
*/
760-
@Deprecated
761-
public abstract void setPointStart(Date date);
762-
763756
/**
764757
* @see #setPointStart(Number)
765758
*/

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/Axis.java

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,6 @@ public void setMin(Number min) {
5656
this.min = min;
5757
}
5858

59-
/**
60-
* The minimum value of the axis as Date.
61-
*
62-
* @param min
63-
* @see #setMin(Number)
64-
* @deprecated use setMin(Instant) instead
65-
*/
66-
@Deprecated
67-
public void setMin(Date min) {
68-
this.min = Util.toHighchartsTS(min);
69-
}
70-
7159
/**
7260
* The minimum value of the axis as Instant.
7361
*
@@ -98,18 +86,6 @@ public void setMax(Number max) {
9886
this.max = max;
9987
}
10088

101-
/**
102-
* The maximum value of the axis as Date.
103-
*
104-
* @param max
105-
* @see #setMax(Number)
106-
* @deprecated use setMax(Instant) instead
107-
*/
108-
@Deprecated
109-
public void setMax(Date max) {
110-
this.max = Util.toHighchartsTS(max);
111-
}
112-
11389
/**
11490
* The maximum value of the axis as Instant.
11591
*
@@ -253,8 +229,8 @@ public void setExtremes(Instant minimum, Instant maximum, boolean redraw,
253229
@Deprecated(since = "25.0", forRemoval = true)
254230
public void setExtremes(Date minimum, Date maximum, boolean redraw,
255231
boolean animate) {
256-
setMin(minimum);
257-
setMax(maximum);
232+
setMin(minimum.toInstant());
233+
setMax(maximum.toInstant());
258234
if (configuration != null) {
259235
configuration.fireAxesRescaled(this, min, max, redraw, animate);
260236
}

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/AxisType.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
*/
99
package com.vaadin.flow.component.charts.model;
1010

11-
import java.util.Date;
11+
import java.time.Instant;
1212

1313
/**
1414
* Enum representing different axis types. Can be one of LINEAR, LOGARITHMIC,
1515
* CATEGORY or DATETIME. In a DATETIME axis, the numbers are given in
16-
* milliseconds (or as {@link Date}s), and tick marks are placed on appropriate
17-
* values like full hours or days. The default for new axes is LINEAR. CATEGORY
18-
* is a convenience mode for where the point names of the first series are used
19-
* for categories - avoiding the need to call
16+
* milliseconds (or as {@link Instant}s), and tick marks are placed on
17+
* appropriate values like full hours or days. The default for new axes is
18+
* LINEAR. CATEGORY is a convenience mode for where the point names of the first
19+
* series are used for categories - avoiding the need to call
2020
* {@link Axis#setCategories(String...)}.
2121
*/
2222
public enum AxisType implements ChartEnum {
2323
LINEAR("linear"),
2424
LOGARITHMIC("logarithmic"),
25-
/**
26-
* In axis mode, the numbers are given in milliseconds (or as {@link Date}
27-
* s), and tick marks are placed on appropriate values like full hours or
28-
* days and formatted appropriately.
25+
/*
26+
* In axis mode, the numbers are given in milliseconds (or as {@link
27+
* Instant} s), and tick marks are placed on appropriate values like full
28+
* hours or days and formatted appropriately.
2929
*/
3030
DATETIME("datetime"),
3131
/**

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/Breaks.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package com.vaadin.flow.component.charts.model;
1010

1111
import java.time.Instant;
12-
import java.util.Date;
1312

1413
import com.vaadin.flow.component.charts.util.Util;
1514

@@ -91,29 +90,13 @@ public void setTo(Number to) {
9190
this.to = to;
9291
}
9392

94-
/**
95-
* @deprecated as of 4.0. Use {@link #setPointStart(Instant)}
96-
*/
97-
@Deprecated
98-
public void setFrom(Date date) {
99-
this.from = Util.toHighchartsTS(date);
100-
}
101-
10293
/**
10394
* @see #setFrom(Number)
10495
*/
10596
public void setFrom(Instant instant) {
10697
this.from = Util.toHighchartsTS(instant);
10798
}
10899

109-
/**
110-
* @deprecated as of 4.0. Use {@link #setPointStart(Instant)}
111-
*/
112-
@Deprecated
113-
public void setTo(Date date) {
114-
this.to = Util.toHighchartsTS(date);
115-
}
116-
117100
/**
118101
* @see #setTo(Number)
119102
*/

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/ColumnOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
package com.vaadin.flow.component.charts.model;
1010

11-
import java.util.Date;
11+
import java.time.Instant;
1212

1313
import com.vaadin.flow.component.charts.model.style.Color;
1414

@@ -567,5 +567,5 @@ public abstract class ColumnOptions extends AbstractPlotOptions {
567567
/**
568568
* @see #setPointStart(Number)
569569
*/
570-
public abstract void setPointStart(Date date);
570+
public abstract void setPointStart(Instant instant);
571571
}

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/DataSeriesItem.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package com.vaadin.flow.component.charts.model;
1010

1111
import java.time.Instant;
12-
import java.util.Date;
1312

1413
import com.fasterxml.jackson.annotation.JsonIgnore;
1514
import com.vaadin.flow.component.charts.model.style.Color;
@@ -119,15 +118,6 @@ public DataSeriesItem(Instant instant, Number y) {
119118
setY(y);
120119
}
121120

122-
/**
123-
* @deprecated as of 4.0. Use {@link #DataSeriesItem(Instant, Number)}
124-
*/
125-
@Deprecated
126-
public DataSeriesItem(Date date, Number y) {
127-
setX(date);
128-
setY(y);
129-
}
130-
131121
/**
132122
* Constructs a DataSeriesItem with the given instant as X value with min
133123
* and max values for use in range visualizations.
@@ -145,17 +135,6 @@ public DataSeriesItem(Instant instant, Number low, Number high) {
145135
setHigh(high);
146136
}
147137

148-
/**
149-
* @deprecated as of 4.0. Use
150-
* {@link #DataSeriesItem(Instant, Number,Number)}
151-
*/
152-
@Deprecated
153-
public DataSeriesItem(Date date, Number low, Number high) {
154-
setX(date);
155-
setLow(low);
156-
setHigh(high);
157-
}
158-
159138
/**
160139
* Constructs a DataSeriesItem with the given X, min and max values for use
161140
* in range visualizations.

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/FlagItem.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package com.vaadin.flow.component.charts.model;
1010

1111
import java.time.Instant;
12-
import java.util.Date;
1312

1413
/**
1514
* DataSeriesItem that can hold also title and text values. Used in flags
@@ -42,15 +41,6 @@ public FlagItem(Instant instant, String title) {
4241
setTitle(title);
4342
}
4443

45-
/**
46-
* @deprecated as of 4.0. Use {@link #FlagItem(Instant, String)}
47-
*/
48-
@Deprecated
49-
public FlagItem(Date date, String title) {
50-
setX(date);
51-
setTitle(title);
52-
}
53-
5444
/**
5545
* Constructs an item with X, Title and Text values
5646
*
@@ -76,16 +66,6 @@ public FlagItem(Instant instant, String title, String text) {
7666
setText(text);
7767
}
7868

79-
/**
80-
* @deprecated as of 4.0. Use {@link #FlagItem(Instant, String, String)}
81-
*/
82-
@Deprecated
83-
public FlagItem(Date date, String title, String text) {
84-
setX(date);
85-
setTitle(title);
86-
setText(text);
87-
}
88-
8969
/**
9070
* Sets the title of the flag
9171
*

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/OhlcItem.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package com.vaadin.flow.component.charts.model;
1010

1111
import java.time.Instant;
12-
import java.util.Date;
1312

1413
/**
1514
* A DataSeriesItem implementation suitable for <a
@@ -70,21 +69,6 @@ public OhlcItem(Instant instant, Number open, Number high, Number low,
7069
setClose(close);
7170
}
7271

73-
/**
74-
* @deprecated as of 4.0. Use
75-
* {@link #OhlcItem(Instant, Number, Number, Number, Number)}
76-
*/
77-
@Deprecated
78-
public OhlcItem(Date date, Number open, Number high, Number low,
79-
Number close) {
80-
this();
81-
setX(date);
82-
setOpen(open);
83-
setLow(low);
84-
setHigh(high);
85-
setClose(close);
86-
}
87-
8872
/**
8973
* @see #setOpen(Number)
9074
*/

vaadin-charts-flow-parent/vaadin-charts-flow/src/main/java/com/vaadin/flow/component/charts/model/OhlcOptions.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package com.vaadin.flow.component.charts.model;
1010

1111
import java.time.Instant;
12-
import java.util.Date;
1312

1413
import com.vaadin.flow.component.charts.model.style.Color;
1514

@@ -743,12 +742,6 @@ public abstract void setSkipKeyboardNavigation(
743742
*/
744743
public abstract void removeZone(Zones zone);
745744

746-
/**
747-
* @deprecated as of 4.0. Use {@link #setPointStart(Instant)}
748-
*/
749-
@Deprecated
750-
public abstract void setPointStart(Date date);
751-
752745
/**
753746
* @see #setPointStart(Number)
754747
*/

0 commit comments

Comments
 (0)