diff options
Diffstat (limited to '')
22 files changed, 83 insertions, 45 deletions
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CarCarriageReservationData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CarCarriageReservationData.java index 97625e4..3abc50a 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CarCarriageReservationData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CarCarriageReservationData.java @@ -231,7 +231,7 @@ public class CarCarriageReservationData extends Object { public Long getBeginLoadingTime() {
- if (beginLoadingTime == null) return new Long(0);
+ if (beginLoadingTime == null) return 0L;
return beginLoadingTime;
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerCardData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerCardData.java index a7e7cfd..fcaf310 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerCardData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/CustomerCardData.java @@ -244,8 +244,8 @@ public class CustomerCardData extends Object { fromCal.clear();
fromCal.setTime(fromDate);
- this.validFromYear = new Long( fromCal.get(Calendar.YEAR));
- this.validFromDay = new Long (fromCal.get(Calendar.DAY_OF_YEAR));
+ this.validFromYear = Long.valueOf( fromCal.get(Calendar.YEAR));
+ this.validFromDay = Long.valueOf(fromCal.get(Calendar.DAY_OF_YEAR));
if (untilDate == null) return;
@@ -257,8 +257,8 @@ public class CustomerCardData extends Object { int yearDiff = untilCal.get(Calendar.YEAR) - fromCal.get(Calendar.YEAR);
- this.validUntilYear = new Long( yearDiff);
- this.validUntilDay = new Long (untildays);
+ this.validUntilYear = Long.valueOf( yearDiff);
+ this.validUntilDay = Long.valueOf(untildays);
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DelayConfirmation.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DelayConfirmation.java index daa9429..45d8d4b 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DelayConfirmation.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/DelayConfirmation.java @@ -282,11 +282,11 @@ public class DelayConfirmation extends Object { Calendar cal = Calendar.getInstance();
cal.setTime(date);
- this.plannedArrivalYear = new Long( cal.get(Calendar.YEAR));
- this.plannedArrivalDay = new Long (cal.get(Calendar.DAY_OF_YEAR));
+ this.plannedArrivalYear = Long.valueOf(cal.get(Calendar.YEAR));
+ this.plannedArrivalDay = Long.valueOf(cal.get(Calendar.DAY_OF_YEAR));
int time = cal.get(Calendar.HOUR_OF_DAY) * 60 + cal.get(Calendar.MINUTE);
if (time > 0) {
- this.plannedArrivalTime = new Long (time );
+ this.plannedArrivalTime = Long.valueOf(time );
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IncludedOpenTicketType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IncludedOpenTicketType.java index ce46a94..4e9d294 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IncludedOpenTicketType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IncludedOpenTicketType.java @@ -385,12 +385,12 @@ public class IncludedOpenTicketType extends Object { public void setValidFromTimeZone(Date dateLocal, Date dateUTC ) {
// -- (UTC = local + offset * 15 Minutes)
- this.validFromUTCOffset = new Long(dateLocal.getTime() - dateUTC.getTime()) / (1000 * 60 * 15);
+ this.validFromUTCOffset = Long.valueOf((dateLocal.getTime() - dateUTC.getTime()) / (1000 * 60 * 15));
}
public void setValidUntilTimeZone(Date dateLocal, Date dateUTC ) {
// -- (UTC = local + offset * 15 Minutes)
- this.validUntilUTCOffset = new Long(dateLocal.getTime() - dateUTC.getTime()) / (1000 * 60 * 15);
+ this.validUntilUTCOffset = Long.valueOf((dateLocal.getTime() - dateUTC.getTime()) / (1000 * 60 * 15));
if (this.validFromUTCOffset.longValue() == this.validUntilUTCOffset.longValue()) {
this.validUntilUTCOffset = null;
@@ -401,6 +401,16 @@ public class IncludedOpenTicketType extends Object { public Date getValidFromDate(Date issuingDate){
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validFromTime == null) {
+ this.validFromTime = 0L;
+ }
+
return DateTimeUtils.getDate(issuingDate, this.validFromDay, this.validFromTime);
}
@@ -426,10 +436,40 @@ public class IncludedOpenTicketType extends Object { }
public Date getUTCValidFromDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+ if (this.getValidUntilTime() == null) {
+ this.validUntilTime = 1439L;
+ }
+
return DateTimeUtils.getUTCDate(issuingDate, this.validFromDay, this.validFromTime, this.validFromUTCOffset);
}
public Date getUTCValidUntilDate(Date issuingDate){
+
+ if (issuingDate == null) return null;
+
+ if (this.validFromDay == null) {
+ this.validFromDay = 0L;
+ }
+
+ if (this.validUntilDay == null) {
+ return null;
+ }
+
+ if (this.getValidUntilTime() == null) {
+ this.validUntilTime = 1439L;
+ }
+
this.getValidUntilDate(issuingDate);
if (this.validUntilUTCOffset == null) {
return DateTimeUtils.getUTCDate(issuingDate, this.validFromDay + this.validUntilDay, this.validFromTime, this.validFromUTCOffset);
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IssuingData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IssuingData.java index f8e8477..78d5609 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IssuingData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/IssuingData.java @@ -184,7 +184,7 @@ public class IssuingData extends Object { public Long getCurrencyFract() {
if (currencyFract == null) {
- return new Long(2);
+ return Long.valueOf(2L);
}
return this.currencyFract;
}
@@ -323,11 +323,11 @@ public class IssuingData extends Object { Calendar cal = Calendar.getInstance();
cal.setTime(date);
- this.issuingYear = new Long( cal.get(Calendar.YEAR));
- this.issuingDay = new Long (cal.get(Calendar.DAY_OF_YEAR));
+ this.issuingYear = Long.valueOf(cal.get(Calendar.YEAR));
+ this.issuingDay = Long.valueOf(cal.get(Calendar.DAY_OF_YEAR));
int time = cal.get(Calendar.HOUR_OF_DAY) * 60 + cal.get(Calendar.MINUTE);
if (time >= 0) {
- this.issuingTime = new Long (time );
+ this.issuingTime = Long.valueOf(time );
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LuggageRestrictionType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LuggageRestrictionType.java index 684b762..04db732 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LuggageRestrictionType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/LuggageRestrictionType.java @@ -54,7 +54,7 @@ public class LuggageRestrictionType extends Object { public Long getMaxHandLuggagePieces() {
if (maxHandLuggagePieces == null) {
- return new Long(3);
+ return 3L;
}
return this.maxHandLuggagePieces;
@@ -63,7 +63,7 @@ public class LuggageRestrictionType extends Object { public Long getMaxNonHandLuggagePieces() {
if (maxNonHandLuggagePieces == null) {
- return new Long(1);
+ return 1L;
}
return this.maxNonHandLuggagePieces;
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/OpenTicketData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/OpenTicketData.java index b9bd214..c73b9cf 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/OpenTicketData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/OpenTicketData.java @@ -35,7 +35,6 @@ import org.uic.barcode.asn1.datatypes.RestrictedString; import org.uic.barcode.asn1.datatypes.Sequence;
import org.uic.barcode.asn1.datatypes.SizeRange;
import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
-import org.uic.barcode.ticket.api.asn.omv3.SequenceOfActivatedDays;
import org.uic.barcode.ticket.api.utils.DateTimeUtils;
@Sequence
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassData.java index 9ef1acb..1a3dc63 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/PassData.java @@ -34,7 +34,6 @@ import org.uic.barcode.asn1.datatypes.IntRange; import org.uic.barcode.asn1.datatypes.RestrictedString;
import org.uic.barcode.asn1.datatypes.Sequence;
import org.uic.barcode.asn1.datatypesimpl.SequenceOfStringIA5;
-import org.uic.barcode.ticket.api.asn.omv3.SequenceOfActivatedDays;
import org.uic.barcode.ticket.api.utils.DateTimeUtils;
@Sequence
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReservationData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReservationData.java index f841f91..c656f8a 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReservationData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ReservationData.java @@ -314,7 +314,7 @@ public class ReservationData extends Object { public Long getArrivalDate() {
if (arrivalDate == null) {
- return new Long(0);
+ return Long.valueOf(0L);
}
return this.arrivalDate;
@@ -397,7 +397,7 @@ public class ReservationData extends Object { public Long getTypeOfSupplement() {
if (typeOfSupplement == null){
- return new Long(0);
+ return 0L;
}
@@ -407,7 +407,7 @@ public class ReservationData extends Object { public Long getNumberOfSupplements() {
if (numberOfSupplements == null) {
- return new Long(0);
+ return 0L;
}
return this.numberOfSupplements;
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfActivatedDays.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfActivatedDays.java index 1166a20..7b80a93 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfActivatedDays.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfActivatedDays.java @@ -14,7 +14,7 @@ public class SequenceOfActivatedDays extends Asn1SequenceOf<Long> { public SequenceOfActivatedDays(List<Long> numbers) {
super();
for (Long number: numbers){
- this.add(new Long(number));
+ this.add(Long.valueOf(number));
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierNum.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierNum.java index 3447264..e292687 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierNum.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCarrierNum.java @@ -15,7 +15,7 @@ public class SequenceOfCarrierNum extends Asn1SequenceOf<Long> { public SequenceOfCarrierNum(List<Long> numbers) {
super();
for (Long number: numbers){
- this.add(new Long(number));
+ this.add(Long.valueOf(number));
}
}
public static SequenceOfCarrierNum getSequence(List<Long> numList) {
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCountries.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCountries.java index 46c72e8..8bd0907 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCountries.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfCountries.java @@ -15,7 +15,7 @@ public class SequenceOfCountries extends Asn1SequenceOf<Long> { public SequenceOfCountries(List<Long> numbers) {
super();
for (Long number: numbers){
- this.add(new Long(number));
+ this.add(Long.valueOf(number));
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfPlaceNum.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfPlaceNum.java index 1a6dbfc..33ee317 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfPlaceNum.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfPlaceNum.java @@ -16,7 +16,7 @@ public class SequenceOfPlaceNum extends Asn1SequenceOf<Long> { public SequenceOfPlaceNum(List<Long> numbers) {
super();
for (Long number: numbers){
- this.add(new Long(number));
+ this.add(Long.valueOf(number));
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfServiceBrands.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfServiceBrands.java index 3048235..2c7a596 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfServiceBrands.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfServiceBrands.java @@ -15,7 +15,7 @@ public class SequenceOfServiceBrands extends Asn1SequenceOf<Long> { public SequenceOfServiceBrands(List<Long> numbers) {
super();
for (Long number: numbers){
- this.add(new Long(number));
+ this.add(Long.valueOf(number));
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTransportTypes.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTransportTypes.java index edec045..b6dcf70 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTransportTypes.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTransportTypes.java @@ -15,7 +15,7 @@ public class SequenceOfTransportTypes extends Asn1SequenceOf<Long> { public SequenceOfTransportTypes(List<Long> numbers) {
super();
for (Long number: numbers){
- this.add(new Long(number));
+ this.add(Long.valueOf(number));
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerId.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerId.java index 6808104..e548211 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerId.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/SequenceOfTravelerId.java @@ -14,7 +14,7 @@ public class SequenceOfTravelerId extends Asn1SequenceOf<Long> { public SequenceOfTravelerId(List<Long> numbers) {
super();
for (Long number: numbers){
- this.add(new Long(number));
+ this.add(Long.valueOf(number));
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TariffType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TariffType.java index 1159451..a04688f 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TariffType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TariffType.java @@ -81,7 +81,7 @@ public class TariffType extends Object { public Long getNumberOfPassengers() {
if (numberOfPassengers == null) {
- return new Long(1);
+ return 1L;
}
return this.numberOfPassengers;
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainLinkType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainLinkType.java index 1f0d188..3bdfadd 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainLinkType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainLinkType.java @@ -178,7 +178,7 @@ public class TrainLinkType extends Object { public void setDepartureTimeZone(Date dateLocal, Date dateUTC ) {
// -- (UTC = local + offset * 15 Minutes)
- this.departureUTCOffset = new Long(dateLocal.getTime() - dateUTC.getTime()) / (1000 * 60 * 15);
+ this.departureUTCOffset = Long.valueOf((dateLocal.getTime() - dateUTC.getTime()) / (1000 * 60 * 15));
}
public Date getDepartureDate(Date issuingDate){
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainValidityType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainValidityType.java index 4f1bd72..460f899 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainValidityType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TrainValidityType.java @@ -97,7 +97,7 @@ public class TrainValidityType extends Object { public Long getValidFromDay() {
if (validFromDay == null) {
- return new Long(0);
+ return 0L;
}
return this.validFromDay;
@@ -111,7 +111,7 @@ public class TrainValidityType extends Object { public Long getValidUntilDay() {
if (validUntilDay == null) {
- return new Long(0);
+ return 0L;
}
return this.validUntilDay;
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerType.java index e41f758..c22092d 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/TravelerType.java @@ -305,9 +305,9 @@ public class TravelerType extends Object { Calendar cal = Calendar.getInstance();
cal.setTime(date);
- this.yearOfBirth = new Long( cal.get(Calendar.YEAR));
- this.monthOfBirth = new Long(cal.get(Calendar.MONTH) + 1);
- this.dayOfBirth = new Long (cal.get(Calendar.DAY_OF_MONTH));
+ this.yearOfBirth = Long.valueOf( cal.get(Calendar.YEAR));
+ this.monthOfBirth = Long.valueOf(cal.get(Calendar.MONTH) + 1);
+ this.dayOfBirth = Long.valueOf(cal.get(Calendar.DAY_OF_MONTH));
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodType.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodType.java index 79364a3..b932177 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodType.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/ValidityPeriodType.java @@ -62,7 +62,7 @@ public class ValidityPeriodType extends Object { public Long getValidFromDay() {
if (validFromDay == null) {
- return new Long(0);
+ return 0L;
}
return this.validFromDay;
@@ -76,7 +76,7 @@ public class ValidityPeriodType extends Object { public Long getValidUntilDay() {
if (validUntilDay == null) {
- return new Long(0);
+ return 0L;
}
return this.validUntilDay;
diff --git a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VoucherData.java b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VoucherData.java index e139832..b7cbca2 100644 --- a/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VoucherData.java +++ b/src/main/java/org/uic/barcode/ticket/api/asn/omv3/VoucherData.java @@ -241,8 +241,8 @@ public class VoucherData extends Object { fromCal.clear();
fromCal.setTime(fromDate);
- this.validFromYear = new Long( fromCal.get(Calendar.YEAR));
- this.validFromDay = new Long (fromCal.get(Calendar.DAY_OF_YEAR));
+ this.validFromYear = Long.valueOf( fromCal.get(Calendar.YEAR));
+ this.validFromDay = Long.valueOf(fromCal.get(Calendar.DAY_OF_YEAR));
if (untilDate == null) return;
@@ -250,8 +250,8 @@ public class VoucherData extends Object { untilCal.clear();
untilCal.setTime(untilDate);
- this.validUntilYear = new Long( untilCal.get(Calendar.YEAR));
- this.validUntilDay = new Long (untilCal.get(Calendar.DAY_OF_YEAR));
+ this.validUntilYear = Long.valueOf( untilCal.get(Calendar.YEAR));
+ this.validUntilDay = Long.valueOf(untilCal.get(Calendar.DAY_OF_YEAR));
}
@@ -264,8 +264,8 @@ public class VoucherData extends Object { fromCal.clear();
fromCal.setTime(fromDate);
- this.validFromYear = new Long( fromCal.get(Calendar.YEAR));
- this.validFromDay = new Long (fromCal.get(Calendar.DAY_OF_YEAR));
+ this.validFromYear = Long.valueOf( fromCal.get(Calendar.YEAR));
+ this.validFromDay = Long.valueOf(fromCal.get(Calendar.DAY_OF_YEAR));
}
@@ -277,8 +277,8 @@ public class VoucherData extends Object { untilCal.clear();
untilCal.setTime(untilDate);
- this.validUntilYear = new Long( untilCal.get(Calendar.YEAR));
- this.validUntilDay = new Long (untilCal.get(Calendar.DAY_OF_YEAR));
+ this.validUntilYear = Long.valueOf( untilCal.get(Calendar.YEAR));
+ this.validUntilDay = Long.valueOf(untilCal.get(Calendar.DAY_OF_YEAR));
}
|