Commit e992755e authored by R.W.Majeed's avatar R.W.Majeed
Browse files

deprecate functions without timezone info

parent 75c3e7dc
...@@ -66,26 +66,32 @@ public class DateTimeAccuracy implements Comparable<DateTimeAccuracy> { ...@@ -66,26 +66,32 @@ public class DateTimeAccuracy implements Comparable<DateTimeAccuracy> {
this.instant = instant; this.instant = instant;
this.accuracy = ChronoUnit.SECONDS; this.accuracy = ChronoUnit.SECONDS;
} }
@Deprecated
public DateTimeAccuracy(int year) { public DateTimeAccuracy(int year) {
instant = LocalDateTime.of(year, 1, 1, 0, 0).toInstant(ZoneOffset.UTC); instant = LocalDateTime.of(year, 1, 1, 0, 0).toInstant(ZoneOffset.UTC);
accuracy = ChronoUnit.YEARS; accuracy = ChronoUnit.YEARS;
} }
@Deprecated
public DateTimeAccuracy(int year, int month) { public DateTimeAccuracy(int year, int month) {
instant = LocalDateTime.of(year, month, 1, 0, 0).toInstant(ZoneOffset.UTC); instant = LocalDateTime.of(year, month, 1, 0, 0).toInstant(ZoneOffset.UTC);
accuracy = ChronoUnit.MONTHS; accuracy = ChronoUnit.MONTHS;
} }
@Deprecated
public DateTimeAccuracy(int year, int month, int day) { public DateTimeAccuracy(int year, int month, int day) {
instant = LocalDateTime.of(year, month, day, 0, 0).toInstant(ZoneOffset.UTC); instant = LocalDateTime.of(year, month, day, 0, 0).toInstant(ZoneOffset.UTC);
accuracy = ChronoUnit.DAYS; accuracy = ChronoUnit.DAYS;
} }
@Deprecated
public DateTimeAccuracy(int year, int month, int day, int hours) { public DateTimeAccuracy(int year, int month, int day, int hours) {
instant = LocalDateTime.of(year, month, day, hours, 0).toInstant(ZoneOffset.UTC); instant = LocalDateTime.of(year, month, day, hours, 0).toInstant(ZoneOffset.UTC);
accuracy = ChronoUnit.HOURS; accuracy = ChronoUnit.HOURS;
} }
@Deprecated
public DateTimeAccuracy(int year, int month, int day, int hours, int mins) { public DateTimeAccuracy(int year, int month, int day, int hours, int mins) {
instant = LocalDateTime.of(year, month, day, hours, mins).toInstant(ZoneOffset.UTC); instant = LocalDateTime.of(year, month, day, hours, mins).toInstant(ZoneOffset.UTC);
accuracy = ChronoUnit.MINUTES; accuracy = ChronoUnit.MINUTES;
} }
@Deprecated
public DateTimeAccuracy(int year, int month, int day, int hours, int mins, int secs) { public DateTimeAccuracy(int year, int month, int day, int hours, int mins, int secs) {
instant = LocalDateTime.of(year, month, day, hours, mins, secs).toInstant(ZoneOffset.UTC); instant = LocalDateTime.of(year, month, day, hours, mins, secs).toInstant(ZoneOffset.UTC);
accuracy = ChronoUnit.SECONDS; accuracy = ChronoUnit.SECONDS;
...@@ -141,7 +147,7 @@ public class DateTimeAccuracy implements Comparable<DateTimeAccuracy> { ...@@ -141,7 +147,7 @@ public class DateTimeAccuracy implements Comparable<DateTimeAccuracy> {
@Override @Override
public String toString(){ public String toString(){
return toPartialIso8601(); return toPartialIso8601(ZoneOffset.UTC.normalized());
} }
/** /**
...@@ -245,6 +251,7 @@ public class DateTimeAccuracy implements Comparable<DateTimeAccuracy> { ...@@ -245,6 +251,7 @@ public class DateTimeAccuracy implements Comparable<DateTimeAccuracy> {
* @throws ParseException for unparsable string * @throws ParseException for unparsable string
* @throws IllegalArgumentException unparsable string (old unchecked exception) * @throws IllegalArgumentException unparsable string (old unchecked exception)
*/ */
@Deprecated
public static DateTimeAccuracy parsePartialIso8601(String str)throws ParseException{ public static DateTimeAccuracy parsePartialIso8601(String str)throws ParseException{
return parsePartialIso8601(str, null); return parsePartialIso8601(str, null);
} }
......
...@@ -65,7 +65,7 @@ public class GroupedXMLReader implements ObservationSupplier { ...@@ -65,7 +65,7 @@ public class GroupedXMLReader implements ObservationSupplier {
private Map<String,String> visitData; private Map<String,String> visitData;
private ZoneId zoneId; private ZoneId zoneId;
@Deprecated
public GroupedXMLReader(ObservationFactory factory, InputStream input)throws JAXBException, XMLStreamException, FactoryConfigurationError{ public GroupedXMLReader(ObservationFactory factory, InputStream input)throws JAXBException, XMLStreamException, FactoryConfigurationError{
this(factory, input, null); this(factory, input, null);
} }
...@@ -82,6 +82,7 @@ public class GroupedXMLReader implements ObservationSupplier { ...@@ -82,6 +82,7 @@ public class GroupedXMLReader implements ObservationSupplier {
public GroupedXMLReader(ObservationFactory factory, InputStream input, ZoneId localZone)throws JAXBException, XMLStreamException, FactoryConfigurationError{ public GroupedXMLReader(ObservationFactory factory, InputStream input, ZoneId localZone)throws JAXBException, XMLStreamException, FactoryConfigurationError{
this(factory, XMLInputFactory.newInstance().createXMLStreamReader(input), localZone); this(factory, XMLInputFactory.newInstance().createXMLStreamReader(input), localZone);
} }
@Deprecated // TODO remove method without zoneid
public GroupedXMLReader(ObservationFactory factory, XMLStreamReader reader) throws JAXBException, XMLStreamException{ public GroupedXMLReader(ObservationFactory factory, XMLStreamReader reader) throws JAXBException, XMLStreamException{
this(factory,reader,null); this(factory,reader,null);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment