Package entsoe
Record Class EntsoeDate
java.lang.Object
java.lang.Record
entsoe.EntsoeDate
- Record Components:
utcDate- the utc date
- All Implemented Interfaces:
Comparable<EntsoeDate>
Helper record to handle the special date format used in the ENTSO-E API.
The record is comparable/sortable. It supports equals() and can thus be used without restriction as a key attribute in all Java Collection classes.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEntsoeDate(ZonedDateTime utcDate) Creates a new object based on the provided utc time. -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.static EntsoeDatefromENTSOEDate(EntsoeDate entsoeDate, int position, EntsoeResolution entsoeResolution) Constrict an new object based on an existing object and a relative offset (position).static EntsoeDatefromENTSOEDateString(String entsoeFormat) Create a new object of the String representation of an ENTSO-E date.Date-only ENTSO-E String representation of the utc date objectDate-time ENTSO-E String representation of the utc date objectfinal inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this record class.utcDate()Returns the value of theutcDaterecord component.
-
Field Details
-
UTC_ZONE
The default ZoneId
-
-
Constructor Details
-
EntsoeDate
Creates a new object based on the provided utc time.- Parameters:
utcDate- the utc time
-
-
Method Details
-
fromENTSOEDate
public static EntsoeDate fromENTSOEDate(EntsoeDate entsoeDate, int position, EntsoeResolution entsoeResolution) Constrict an new object based on an existing object and a relative offset (position).- Parameters:
entsoeDate- The base dateposition- the relative position to the date comparedentsoeResolution- the resolution to use.EntsoeResolution.PT60Msupports only full hours,EntsoeResolution.PT15Msupports 15-minute intervals- Returns:
- the new date
-
fromENTSOEDateString
Create a new object of the String representation of an ENTSO-E date.- Parameters:
entsoeFormat- A date like 202301010123 what means Jan 1st, 2023 at 1:23am- Returns:
- new object
-
getEntsoeDate
Date-only ENTSO-E String representation of the utc date object- Returns:
- Date-only ENTSO-E String representation of the utc date object
-
getEntsoeDateTime
Date-time ENTSO-E String representation of the utc date object- Returns:
- Date-time ENTSO-E String representation of the utc date object
-
toPrettyLocalString
-
toPrettyUTCString
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
compareTo
- Specified by:
compareToin interfaceComparable<EntsoeDate>
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
utcDate
Returns the value of theutcDaterecord component.- Returns:
- the value of the
utcDaterecord component
-