diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2023-11-30 08:57:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 08:57:50 +0100 |
commit | 949978f7eea65000737414f15426e1e015c9e4bf (patch) | |
tree | 86e5345c061cb1dc4d3f1ad4b783f6590c03d660 /src/main/java/org/uic/barcode/ticket/api/utils | |
parent | Merge pull request #72 from UnionInternationalCheminsdeFer/1.4.4 (diff) | |
parent | c1 (diff) | |
download | UIC-barcode-949978f7eea65000737414f15426e1e015c9e4bf.tar UIC-barcode-949978f7eea65000737414f15426e1e015c9e4bf.tar.gz UIC-barcode-949978f7eea65000737414f15426e1e015c9e4bf.tar.bz2 UIC-barcode-949978f7eea65000737414f15426e1e015c9e4bf.tar.lz UIC-barcode-949978f7eea65000737414f15426e1e015c9e4bf.tar.xz UIC-barcode-949978f7eea65000737414f15426e1e015c9e4bf.tar.zst UIC-barcode-949978f7eea65000737414f15426e1e015c9e4bf.zip |
Diffstat (limited to '')
9 files changed, 62 insertions, 67 deletions
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/Api2AsnEncoder.java b/src/main/java/org/uic/barcode/ticket/api/utils/Api2AsnEncoder.java index 11052b0..7c06209 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/Api2AsnEncoder.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/Api2AsnEncoder.java @@ -1,7 +1,6 @@ package org.uic.barcode.ticket.api.utils;
import org.uic.barcode.ticket.EncodingFormatException;
-import org.uic.barcode.ticket.api.asn.omv1.UicRailTicketData;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
public abstract interface Api2AsnEncoder {
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoder.java b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoder.java index ada4c1a..615f646 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoder.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoder.java @@ -317,7 +317,7 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { asnData.setConfirmationType(ConfirmationTypeType.values()[document.getConfirmationType()]);
- asnData.setDelay(new Long(document.getDelay()));
+ asnData.setDelay(Long.valueOf(document.getDelay()));
asnData.setTrainCancelled(document.isTrainCancelled());
@@ -758,11 +758,11 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { }
if (document.getExternalIssuer() > 0) {
- asnData.setExternalIssuerId(new Long(document.getExternalIssuer()));
+ asnData.setExternalIssuerId(Long.valueOf(document.getExternalIssuer()));
}
if (document.getAuthorizationCode() > 0) {
- asnData.setIssuerAutorizationId(new Long(document.getAuthorizationCode()));
+ asnData.setIssuerAutorizationId(Long.valueOf(document.getAuthorizationCode()));
}
if (document.getValidRegionList()!= null && document.getValidRegionList().size() > 0) {
@@ -936,11 +936,11 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { }
if (document.getExternalIssuer()>0) {
- asnData.setExtIssuerId(new Long(document.getExternalIssuer()));
+ asnData.setExtIssuerId(Long.valueOf(document.getExternalIssuer()));
}
if (document.getAuthorizationCode()>0) {
- asnData.setIssuerAutorizationId(new Long (document.getAuthorizationCode()));
+ asnData.setIssuerAutorizationId(Long.valueOf(document.getAuthorizationCode()));
}
if (document.getValidRegionList() != null && document.getValidRegionList().size() > 0) {
@@ -1031,8 +1031,8 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { }
asnData.setGroupName(document.getGroupName());
- asnData.setNumberOfCountermark(new Long(document.getNumberOfCountermark()));
- asnData.setTotalOfCountermarks(new Long(document.getTotalOfCountermarks()));
+ asnData.setNumberOfCountermark(Long.valueOf(document.getNumberOfCountermark()));
+ asnData.setTotalOfCountermarks(Long.valueOf(document.getTotalOfCountermarks()));
asnData.setReferenceNum(UicEncoderUtils.getNum(document.getReference()));
asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
@@ -1145,11 +1145,11 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { asnData.setRoute(encodeViaStationCollection(document.getRoute()));
if (document.getRouteId() > 0){
- asnData.setRouteId(new Long(document.getRouteId()));
+ asnData.setRouteId(Long.valueOf(document.getRouteId()));
}
if (document.getSeriesId() > 0) {
- asnData.setSeriesId(new Long(document.getSeriesId()));
+ asnData.setSeriesId(Long.valueOf(document.getSeriesId()));
}
return asnData;
@@ -1290,7 +1290,7 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { asnData.setTerminatingStationNum(UicEncoderUtils.getNum(data.getTerminatingStation()));
if (data.getCity() > 0) {
- asnData.setCity(new Long(data.getCity()));
+ asnData.setCity(Long.valueOf(data.getCity()));
}
asnData.setLineId(SequenceOfUnrestrictedLong.getSequence(UicEncoderUtils.encodeIntegerCollection(data.getLineIds())));
@@ -1650,7 +1650,7 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { asnData.setNumberOfValidityDays(UicEncoderUtils.getRestrictedInt(document.getNumberOfValidityDays(), 1, 370));
asnData.setPassDescription(document.getPassDescription());
if (document.getPassType() > 0 ){
- asnData.setPassType(new Long(document.getPassType()));
+ asnData.setPassType(Long.valueOf(document.getPassType()));
}
asnData.setTariffs(encodeTariffCollection(document.getTariffs()));
@@ -1702,8 +1702,8 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { }
TimeRangeType asnRange = new TimeRangeType();
- asnRange.setFromTime(new Long(range.getFromTime()));
- asnRange.setUntilTime(new Long(range.getUntilTime()));
+ asnRange.setFromTime(Long.valueOf(range.getFromTime()));
+ asnRange.setUntilTime(Long.valueOf(range.getUntilTime()));
asnData.getExcludedTimeRange().add(asnRange);
}
@@ -1811,7 +1811,7 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
if (document.getNumberOfdaysAllowed() > 0) {
- asnData.setNumberOfDaysValid(new Long(document.getNumberOfdaysAllowed()));
+ asnData.setNumberOfDaysValid(Long.valueOf(document.getNumberOfdaysAllowed()));
}
asnData.setProductName(document.getProductName());
@@ -2271,8 +2271,8 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { VatDetailType asnVatDetail = new VatDetailType();
asnVatDetail.setAmount(vatDetail.getAmount());
- asnVatDetail.setCountry(new Long(vatDetail.getCountry()));
- asnVatDetail.setPercentage(new Long(vatDetail.getPercentage()));
+ asnVatDetail.setCountry(Long.valueOf(vatDetail.getCountry()));
+ asnVatDetail.setPercentage(Long.valueOf(vatDetail.getPercentage()));
asnVatDetail.setVatId(vatDetail.getVatId());
return asnVatDetail;
@@ -2351,7 +2351,7 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { CustomerStatusType asnStatus = new CustomerStatusType();
if (status.getStatus() > 0) {
- asnStatus.setCustomerStatus(new Long(status.getStatus()));
+ asnStatus.setCustomerStatus(Long.valueOf(status.getStatus()));
}
asnStatus.setCustomerStatusDescr(status.getDescription());
asnStatus.setStatusProviderIA5(UicEncoderUtils.getIA5NonNum(status.getStatusProvider()));
@@ -2399,10 +2399,6 @@ public class Api2OpenAsnEncoder implements Api2AsnEncoder { return TravelClassType.second;
}
-
-
-
-
return TravelClassType.valueOf(apiClass.name());
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java index 3468ec6..0656d49 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV2.java @@ -314,7 +314,7 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { asnData.setConfirmationType(ConfirmationTypeType.values()[document.getConfirmationType()]);
- asnData.setDelay(new Long(document.getDelay()));
+ asnData.setDelay(Long.valueOf(document.getDelay()));
asnData.setTrainCancelled(document.isTrainCancelled());
@@ -758,11 +758,11 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { }
if (document.getExternalIssuer() > 0) {
- asnData.setExternalIssuerId(new Long(document.getExternalIssuer()));
+ asnData.setExternalIssuerId(Long.valueOf(document.getExternalIssuer()));
}
if (document.getAuthorizationCode() > 0) {
- asnData.setIssuerAutorizationId(new Long(document.getAuthorizationCode()));
+ asnData.setIssuerAutorizationId(Long.valueOf(document.getAuthorizationCode()));
}
if (document.getValidRegionList()!= null && document.getValidRegionList().size() > 0) {
@@ -938,11 +938,11 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { }
if (document.getExternalIssuer()>0) {
- asnData.setExtIssuerId(new Long(document.getExternalIssuer()));
+ asnData.setExtIssuerId(Long.valueOf(document.getExternalIssuer()));
}
if (document.getAuthorizationCode()>0) {
- asnData.setIssuerAutorizationId(new Long (document.getAuthorizationCode()));
+ asnData.setIssuerAutorizationId(Long.valueOf(document.getAuthorizationCode()));
}
if (document.getValidRegionList() != null && document.getValidRegionList().size() > 0) {
@@ -1032,8 +1032,8 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { }
asnData.setGroupName(document.getGroupName());
- asnData.setNumberOfCountermark(new Long(document.getNumberOfCountermark()));
- asnData.setTotalOfCountermarks(new Long(document.getTotalOfCountermarks()));
+ asnData.setNumberOfCountermark(Long.valueOf(document.getNumberOfCountermark()));
+ asnData.setTotalOfCountermarks(Long.valueOf(document.getTotalOfCountermarks()));
asnData.setReferenceNum(UicEncoderUtils.getNum(document.getReference()));
asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
@@ -1147,10 +1147,10 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { asnData.setRoute(encodeViaStationCollection(document.getRoute()));
if (document.getRouteId() > 0){
- asnData.setRouteId(new Long(document.getRouteId()));
+ asnData.setRouteId(Long.valueOf(document.getRouteId()));
}
if (document.getSeriesId() > 0){
- asnData.setSeriesId(new Long(document.getSeriesId()));
+ asnData.setSeriesId(Long.valueOf(document.getSeriesId()));
}
return asnData;
@@ -1294,7 +1294,7 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { asnData.setTerminatingStationNum(UicEncoderUtils.getNum(document.getTerminatingStation()));
if (document.getCity() > 0) {
- asnData.setCity(new Long(document.getCity()));
+ asnData.setCity(Long.valueOf(document.getCity()));
}
asnData.setLineId(SequenceOfUnrestrictedLong.getSequence(UicEncoderUtils.encodeIntegerCollection(document.getLineIds())));
@@ -1654,7 +1654,7 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { asnData.setNumberOfValidityDays(UicEncoderUtils.getRestrictedInt(document.getNumberOfValidityDays(), 1, 370));
asnData.setPassDescription(document.getPassDescription());
if (document.getPassType() > 0 ){
- asnData.setPassType(new Long(document.getPassType()));
+ asnData.setPassType(Long.valueOf(document.getPassType()));
}
asnData.setTariffs(encodeTariffCollection(document.getTariffs()));
@@ -1703,8 +1703,8 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { }
TimeRangeType asnRange = new TimeRangeType();
- asnRange.setFromTime(new Long(range.getFromTime()));
- asnRange.setUntilTime(new Long(range.getUntilTime()));
+ asnRange.setFromTime(Long.valueOf(range.getFromTime()));
+ asnRange.setUntilTime(Long.valueOf(range.getUntilTime()));
if (asnData.getExcludedTimeRange() == null) {
asnData.setExcludedTimeRange(new SequenceOfTimeRangeType());
@@ -1815,7 +1815,7 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
if (document.getNumberOfdaysAllowed() > 0) {
- asnData.setNumberOfDaysValid(new Long(document.getNumberOfdaysAllowed()));
+ asnData.setNumberOfDaysValid(Long.valueOf(document.getNumberOfdaysAllowed()));
}
asnData.setProductName(document.getProductName());
@@ -2277,8 +2277,8 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { VatDetailType asnVatDetail = new VatDetailType();
asnVatDetail.setAmount(vatDetail.getAmount());
- asnVatDetail.setCountry(new Long(vatDetail.getCountry()));
- asnVatDetail.setPercentage(new Long(vatDetail.getPercentage()));
+ asnVatDetail.setCountry(Long.valueOf(vatDetail.getCountry()));
+ asnVatDetail.setPercentage(Long.valueOf(vatDetail.getPercentage()));
asnVatDetail.setVatId(vatDetail.getVatId());
return asnVatDetail;
@@ -2357,7 +2357,7 @@ public class Api2OpenAsnEncoderV2 implements Api2AsnEncoder { CustomerStatusType asnStatus = new CustomerStatusType();
if (status.getStatus() > 0) {
- asnStatus.setCustomerStatus(new Long(status.getStatus()));
+ asnStatus.setCustomerStatus(Long.valueOf(status.getStatus()));
}
asnStatus.setCustomerStatusDescr(status.getDescription());
asnStatus.setStatusProviderIA5(UicEncoderUtils.getIA5NonNum(status.getStatusProvider()));
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV3.java b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV3.java index 01bc209..d97e7b7 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV3.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/Api2OpenAsnEncoderV3.java @@ -317,7 +317,7 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { asnData.setConfirmationType(ConfirmationTypeType.values()[document.getConfirmationType()]);
- asnData.setDelay(new Long(document.getDelay()));
+ asnData.setDelay(Long.valueOf(document.getDelay()));
asnData.setTrainCancelled(document.isTrainCancelled());
@@ -762,11 +762,11 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { }
if (document.getExternalIssuer() > 0) {
- asnData.setExternalIssuerId(new Long(document.getExternalIssuer()));
+ asnData.setExternalIssuerId(Long.valueOf(document.getExternalIssuer()));
}
if (document.getAuthorizationCode() > 0) {
- asnData.setIssuerAutorizationId(new Long(document.getAuthorizationCode()));
+ asnData.setIssuerAutorizationId(Long.valueOf(document.getAuthorizationCode()));
}
if (document.getValidRegionList()!= null && document.getValidRegionList().size() > 0) {
@@ -945,11 +945,11 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { }
if (document.getExternalIssuer()>0) {
- asnData.setExtIssuerId(new Long(document.getExternalIssuer()));
+ asnData.setExtIssuerId(Long.valueOf(document.getExternalIssuer()));
}
if (document.getAuthorizationCode()>0) {
- asnData.setIssuerAutorizationId(new Long (document.getAuthorizationCode()));
+ asnData.setIssuerAutorizationId(Long.valueOf(document.getAuthorizationCode()));
}
if (document.getValidRegionList() != null && document.getValidRegionList().size() > 0) {
@@ -1040,8 +1040,8 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { }
asnData.setGroupName(document.getGroupName());
- asnData.setNumberOfCountermark(new Long(document.getNumberOfCountermark()));
- asnData.setTotalOfCountermarks(new Long(document.getTotalOfCountermarks()));
+ asnData.setNumberOfCountermark(Long.valueOf(document.getNumberOfCountermark()));
+ asnData.setTotalOfCountermarks(Long.valueOf(document.getTotalOfCountermarks()));
asnData.setReferenceNum(UicEncoderUtils.getNum(document.getReference()));
@@ -1158,11 +1158,11 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { asnData.setRoute(encodeViaStationCollection(document.getRoute()));
if (document.getRouteId() > 0){
- asnData.setRouteId(new Long(document.getRouteId()));
+ asnData.setRouteId(Long.valueOf(document.getRouteId()));
}
if (document.getSeriesId() > 0) {
- asnData.setSeriesId(new Long(document.getSeriesId()));
+ asnData.setSeriesId(Long.valueOf(document.getSeriesId()));
}
return asnData;
@@ -1302,7 +1302,7 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { asnData.setTerminatingStationNum(UicEncoderUtils.getNum(document.getTerminatingStation()));
if (document.getCity() > 0) {
- asnData.setCity(new Long(document.getCity()));
+ asnData.setCity(Long.valueOf(document.getCity()));
}
asnData.setLineId(SequenceOfUnrestrictedLong.getSequence(UicEncoderUtils.encodeIntegerCollection(document.getLineIds())));
@@ -1663,7 +1663,7 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { asnData.setNumberOfValidityDays(UicEncoderUtils.getRestrictedInt(document.getNumberOfValidityDays(), 1, 500));
asnData.setPassDescription(document.getPassDescription());
if (document.getPassType() > 0 ){
- asnData.setPassType(new Long(document.getPassType()));
+ asnData.setPassType(Long.valueOf(document.getPassType()));
}
asnData.setTariffs(encodeTariffCollection(document.getTariffs()));
@@ -1750,8 +1750,8 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { }
TimeRangeType asnRange = new TimeRangeType();
- asnRange.setFromTime(new Long(range.getFromTime()));
- asnRange.setUntilTime(new Long(range.getUntilTime()));
+ asnRange.setFromTime(Long.valueOf(range.getFromTime()));
+ asnRange.setUntilTime(Long.valueOf(range.getUntilTime()));
asnData.getExcludedTimeRange().add(asnRange);
}
@@ -1860,7 +1860,7 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { asnData.setReferenceIA5(UicEncoderUtils.getIA5NonNum(document.getReference()));
if (document.getNumberOfdaysAllowed() > 0) {
- asnData.setNumberOfDaysValid(new Long(document.getNumberOfdaysAllowed()));
+ asnData.setNumberOfDaysValid(Long.valueOf(document.getNumberOfdaysAllowed()));
}
asnData.setProductName(document.getProductName());
@@ -2321,8 +2321,8 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { VatDetailType asnVatDetail = new VatDetailType();
asnVatDetail.setAmount(vatDetail.getAmount());
- asnVatDetail.setCountry(new Long(vatDetail.getCountry()));
- asnVatDetail.setPercentage(new Long(vatDetail.getPercentage()));
+ asnVatDetail.setCountry(Long.valueOf(vatDetail.getCountry()));
+ asnVatDetail.setPercentage(Long.valueOf(vatDetail.getPercentage()));
asnVatDetail.setVatId(vatDetail.getVatId());
return asnVatDetail;
@@ -2401,7 +2401,7 @@ public class Api2OpenAsnEncoderV3 implements Api2AsnEncoder { CustomerStatusType asnStatus = new CustomerStatusType();
if (status.getStatus() > 0) {
- asnStatus.setCustomerStatus(new Long(status.getStatus()));
+ asnStatus.setCustomerStatus(Long.valueOf(status.getStatus()));
}
asnStatus.setCustomerStatusDescr(status.getDescription());
asnStatus.setStatusProviderIA5(UicEncoderUtils.getIA5NonNum(status.getStatusProvider()));
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/DateTimeUtils.java b/src/main/java/org/uic/barcode/ticket/api/utils/DateTimeUtils.java index c8664a5..7fe5bca 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/DateTimeUtils.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/DateTimeUtils.java @@ -37,7 +37,7 @@ public class DateTimeUtils { //long diff = localDate.getTime() - issuingDate.getTime();
//long dayDiff = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
- return new Long(diff);
+ return Long.valueOf(diff);
}
@@ -64,7 +64,7 @@ public class DateTimeUtils { long diff = localDate.getTime() - referenceDate.getTime();
long dayDiff = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
- return new Long(dayDiff);
+ return Long.valueOf(dayDiff);
}
@@ -110,7 +110,7 @@ public class DateTimeUtils { }
int time = cal.get(Calendar.HOUR_OF_DAY) * 60 + cal.get(Calendar.MINUTE);
- return new Long (time );
+ return Long.valueOf(time);
}
public static Long getTime (Date date) {
@@ -120,7 +120,7 @@ public class DateTimeUtils { cal.setTime(date);
int time = cal.get(Calendar.HOUR_OF_DAY) * 60 + cal.get(Calendar.MINUTE);
- return new Long (time );
+ return Long.valueOf(time );
}
public static Date getDate(Date issuingDate, Long date, Long time){
@@ -177,7 +177,7 @@ public class DateTimeUtils { */
int minuteOffset = - cal.getTimeZone().getRawOffset()/ ( 1000 * 60 * 15 );
- return new Long (minuteOffset);
+ return Long.valueOf(minuteOffset);
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoder.java b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoder.java index f9c6b7e..2fd7b6e 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoder.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoder.java @@ -1957,7 +1957,7 @@ public class OpenAsn2ApiDecoder implements Asn2ApiDecoder { if (asnDocument.getIncludedServices() != null && !asnDocument.getIncludedServices().isEmpty()){
for (Long service: asnDocument.getIncludedServices()){
- card.addIncludedService(new Integer(service.intValue()));
+ card.addIncludedService(Integer.valueOf(service.intValue()));
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV2.java b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV2.java index f21a592..828fa88 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV2.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV2.java @@ -1975,7 +1975,7 @@ public class OpenAsn2ApiDecoderV2 implements Asn2ApiDecoder { if (asnDocument.getIncludedServices() != null && !asnDocument.getIncludedServices().isEmpty()){
for (Long service: asnDocument.getIncludedServices()){
- card.addIncludedService(new Integer(service.intValue()));
+ card.addIncludedService(Integer.valueOf(service.intValue()));
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV3.java b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV3.java index 66a0d22..e951fb0 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV3.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/OpenAsn2ApiDecoderV3.java @@ -2051,7 +2051,7 @@ public class OpenAsn2ApiDecoderV3 implements Asn2ApiDecoder { if (asnDocument.getIncludedServices() != null && !asnDocument.getIncludedServices().isEmpty()){
for (Long service: asnDocument.getIncludedServices()){
- card.addIncludedService(new Integer(service.intValue()));
+ card.addIncludedService(Integer.valueOf(service.intValue()));
}
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/utils/UicEncoderUtils.java b/src/main/java/org/uic/barcode/ticket/api/utils/UicEncoderUtils.java index 261b7ac..ab6932e 100644 --- a/src/main/java/org/uic/barcode/ticket/api/utils/UicEncoderUtils.java +++ b/src/main/java/org/uic/barcode/ticket/api/utils/UicEncoderUtils.java @@ -388,7 +388,7 @@ public class UicEncoderUtils { if (value < min || value > max) {
throw new EncodingFormatException("Integer value exceeds boundaries");
}
- return new Long(value);
+ return Long.valueOf(value);
}
/**
@@ -407,7 +407,7 @@ public class UicEncoderUtils { if (value < min || value > max) {
throw new EncodingFormatException("Integer value exceeds boundaries");
}
- return new Long(value);
+ return Long.valueOf(value);
}
@@ -419,7 +419,7 @@ public class UicEncoderUtils { */
public static Long getUnRestrictedInt(int value) {
if (value == 0) return null;
- return new Long(value);
+ return Long.valueOf(value);
}
/**
|