Date API should not be used
31 @NotNull private Double marketCap;
32 @NotNull private Double marketCapDominance;
33 @NotNull private Double fullyDilutedMarketCap;
34 @NotNull private Date lastUpdated;35
36 public EntityModel<CryptoCoinQuoteDto> toModel() {
37 final EntityModel<CryptoCoinQuoteDto> resource = EntityModel.of(this);
Date API should not be used
19
20 private List<Long> ids;
21 private String currency;
22 private Date lastUpdatedBefore;23 private Date lastUpdatedAfter;
24 private List<Long> cryptoPriceIds;
25
Date API should not be used
20 private List<Long> ids;
21 private String currency;
22 private Date lastUpdatedBefore;
23 private Date lastUpdatedAfter;24 private List<Long> cryptoPriceIds;
25
26 public PageRequest generatePageRequest() {
Date API should not be used
24 private Double circulatingSupply;
25 private Double totalSupply;
26 private Double maxSupply;
27 private Date dateAdded;28 private Long platformId;
29
30 public EntityModel<CryptoCoinPriceDto> toModel() {
Date API should not be used
22 private Double circulatingSupply;
23 private Double totalSupply;
24 private Double maxSupply;
25 private Date dateAdded;26 private Long platformId;
27 private List<Long> cryptoCoinIds;
28 private List<String> cryptoCoinSymbols;
Date API should not be used
27 private Double circulatingSupply;
28 private Double totalSupply;
29 private Double maxSupply;
30 private Date dateAdded;31 private Long platformId;
32
33 @JsonIgnore
Date API should not be used
29 private Double maxSupply;
30
31 @JsonProperty("last_updated")
32 private Date lastUpdated;33
34 @JsonProperty("date_added")
35 private Date dateAdded;
Date API should not be used
32 private Date lastUpdated;
33
34 @JsonProperty("date_added")
35 private Date dateAdded;36
37 private CoinMarketCryptoPlatform platform;
38 private Map<String, CoinMarketCryptoPriceQuote> quote;
Date API should not be used
27 private ArrayList<String> tagGroups;
28
29 @JsonProperty("date_added")
30 private Date dateAdded;31
32 @JsonProperty("twitter_username")
33 private String twitterUsername;
Date API should not be used
17 private Long isActive;
18
19 @JsonProperty("first_historical_data")
20 private Date firstHistoricalData;21
22 @JsonProperty("last_historical_data")
23 private Date lastHistoricalData;
Date API should not be used
20 private Date firstHistoricalData;
21
22 @JsonProperty("last_historical_data")
23 private Date lastHistoricalData;24
25 private CoinMarketCryptoPlatform platform;
26}
Date API should not be used
7
8@Data
9public class CoinMarketApiStatus {
10 private Date timestamp;11
12 @JsonProperty("error_code")
13 private Long errorCode;
Description
java.util.Date
API should be avoided.
Use of the old Date
API has been the source of many bugs in various Java programs. The design of this API is heavily
criticised by the Java community. Some notable oddities include:
1. Mutability of Date
instances.
2. Months being zero indexed.
3. No support for timezones.
Therefore, it is highly recommended to use an alternative API to work with date and time.
Recommended
Replace all usage of Date
with Clock if you are on
Java version greater than 8. For earlier Java versions, consider using Joda-Time.
References
- StackOverflow - What's wrong with the Java Date API?
Exception
If you would like to keep using the Date
API, consider adding an ignore rule for this project. See here
for more information on that.