summaryrefslogblamecommitdiffstats
path: root/src/org/uic/ticket/api/asn/omv1/CarCarriageReservationData.java
blob: e6942b9ad0fb2e1ad016156c5fc92aec43018eec (plain) (tree)
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736































                                                                                  
                                           













                                                         
                               

                                                      
                               


                                                          
                               



                                                    
                               


                                                    
                               


                                                  
                               


                                                    
                               


                                                          
                               

                                                          
                               


                                                   
                               


                                                          
                                


                                                
                                


                                                          
                                


                                                
                                


                                                           
                                


                                                           
                                


                                                             
                                


                                                  
                                


                                                          
                                


                                                
                                


                                                          
                                


                                                           
                                


                                                           
                                


                                                          
                                


                                                          
                                

                                                                        
                                


                                                          
                                


                                                          
                                


                                         
                                


                                                
                                

                                            
                                


                                                        
                                


                                                  
                                


                                                 
                                


                                                    
                                


                                                      
                                


                                                    
                                


                                                          
                                

                                                              
                                

                                                             
                                

                                  
                                


                                                      
                                

                                            
                                

                                                      
                                


                                                           
                                







































































































































































































































































































































































































































































































































                                                                                                               
/*
 *   This file was generated by openASN.1 - an open source ASN.1 toolkit for java
 *
 *   openASN.1 is Copyright (C) 2007 Clayton Hoss, Marc Weyland
 *
 *   openASN.1 is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as
 *   published by the Free Software Foundation, either version 3 of
 *   the License, or (at your option) any later version.
 *
 *   openASN.1 is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *   GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public License
 *   along with openASN.1. If not, see <http://www.gnu.org/licenses/>.
 *
 */
package org.uic.ticket.api.asn.omv1;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import org.uic.ticket.api.asn.omv1.SequenceOfCarrierNum;

import net.gcdc.asn1.datatypes.Asn1BigInteger;
import net.gcdc.asn1.datatypes.Asn1Default;

import net.gcdc.asn1.datatypes.Asn1Optional;
import net.gcdc.asn1.datatypes.CharacterRestriction;
import net.gcdc.asn1.datatypes.FieldOrder;
import net.gcdc.asn1.datatypes.HasExtensionMarker;
import net.gcdc.asn1.datatypes.IntRange;
import net.gcdc.asn1.datatypes.RestrictedString;
import net.gcdc.asn1.datatypes.Sequence;
import net.gcdc.asn1.datatypesimpl.SequenceOfStringIA5;



@Sequence
@HasExtensionMarker
public class CarCarriageReservationData extends Object {
	public CarCarriageReservationData() {
	}

	@FieldOrder(order = 0)
	@Asn1Optional public Asn1BigInteger trainNum;

	@FieldOrder(order = 1)
	@RestrictedString(CharacterRestriction.IA5String)
	@Asn1Optional public String trainIA5;
	
	@FieldOrder(order = 2)
	@IntRange(minValue=-1,maxValue=370)
	@Asn1Default(value="0")
	@Asn1Optional public Long beginLoadingDate;

	@FieldOrder(order = 3)
	@IntRange(minValue=0,maxValue=1440)
	@Asn1Optional public Long beginLoadingTime;
	
	@FieldOrder(order = 4)
	@IntRange(minValue=0,maxValue=1440)
	@Asn1Optional public Long endLoadingTime;

	@FieldOrder(order = 5)
	@IntRange(minValue=-60, maxValue=60)
	@Asn1Optional public Long loadingUTCOffset;
	
	@FieldOrder(order = 6)
	@RestrictedString(CharacterRestriction.IA5String)
	@Asn1Optional public String referenceIA5;

	@FieldOrder(order = 7)
	@Asn1Optional public Asn1BigInteger referenceNum;

	@FieldOrder(order = 8)
	@IntRange(minValue=1,maxValue=32000)
	@Asn1Optional public Long productOwnerNum;

	@FieldOrder(order = 9)
	@RestrictedString(CharacterRestriction.IA5String)
	@Asn1Optional public String productOwnerIA5;

	@FieldOrder(order = 10)
	@IntRange(minValue=1,maxValue=32000)
	@Asn1Optional public Long productIdNum;

	@FieldOrder(order = 11)
	@RestrictedString(CharacterRestriction.IA5String)
	@Asn1Optional public String productIdIA5;

	@FieldOrder(order = 12)
	@IntRange(minValue=1,maxValue=32000)
	@Asn1Optional public Long serviceBrand;

	@FieldOrder(order = 13)
	@RestrictedString(CharacterRestriction.UTF8String)
	@Asn1Optional public String serviceBrandAbrUTF8;

	@FieldOrder(order = 14)
	@RestrictedString(CharacterRestriction.UTF8String)
	@Asn1Optional public String serviceBrandNameUTF8;

	@FieldOrder(order = 15)
	@Asn1Default("stationUICReservation")
	@Asn1Optional public CodeTableType stationCodeTable;

	@FieldOrder(order = 16)
	@IntRange(minValue=1,maxValue=9999999)
	@Asn1Optional public Long fromStationNum;

	@FieldOrder(order = 17)
	@RestrictedString(CharacterRestriction.IA5String)
	@Asn1Optional public String fromStationIA5;

	@FieldOrder(order = 18)
	@IntRange(minValue=1,maxValue=9999999)
	@Asn1Optional public Long toStationNum;

	@FieldOrder(order = 19)
	@RestrictedString(CharacterRestriction.IA5String)
	@Asn1Optional public String toStationIA5;

	@FieldOrder(order = 20)
	@RestrictedString(CharacterRestriction.UTF8String)
	@Asn1Optional public String fromStationNameUTF8;

	@FieldOrder(order = 21)
	@RestrictedString(CharacterRestriction.UTF8String)
	@Asn1Optional public String toStationNameUTF8;

	@FieldOrder(order = 22)
	@RestrictedString(CharacterRestriction.IA5String)
	@Asn1Optional public String coach;

	@FieldOrder(order = 23)
	@RestrictedString(CharacterRestriction.IA5String)
	@Asn1Optional public String place;

	@FieldOrder(order = 24)
	@Asn1Optional public CompartmentDetailsType compartmentDetails;

	@FieldOrder(order = 25)
	@RestrictedString(CharacterRestriction.IA5String)
	public String numberPlate;

	@FieldOrder(order = 26)
	@RestrictedString(CharacterRestriction.IA5String)
	@Asn1Optional public String trailerPlate;

	@FieldOrder(order = 27)
	@IntRange(minValue=0,maxValue=9)
	public Long carCategory;

	@FieldOrder(order = 28)
	@IntRange(minValue=0,maxValue=6)
	@Asn1Optional public Long boatCategory;

	@FieldOrder(order = 29)
	public Boolean textileRoof = false;

	@FieldOrder(order = 30)
	@Asn1Default(value ="norack")
	@Asn1Optional public RoofRackType roofRackType;

	@FieldOrder(order = 31)
	@IntRange(minValue=0,maxValue=99)
	@Asn1Optional public Long roofRackHeight;

	@FieldOrder(order = 32)
	@IntRange(minValue=0,maxValue=2)
	@Asn1Optional public Long attachedBoats;

	@FieldOrder(order = 33)
	@IntRange(minValue=0,maxValue=4)
	@Asn1Optional public Long attachedBicycles;

	@FieldOrder(order = 34)
	@IntRange(minValue=0,maxValue=5)
	@Asn1Optional public Long attachedSurfboards;

	@FieldOrder(order = 35)
	@IntRange(minValue=0,maxValue=999)
	@Asn1Optional public Long loadingListEntry;

	@FieldOrder(order = 36)
	@Asn1Default(value="upper")
	@Asn1Optional public LoadingDeckType loadingDeck;

	@FieldOrder(order = 37)
	@Asn1Optional public SequenceOfCarrierNum carrierNum;

	@FieldOrder(order = 38)
	@Asn1Optional public SequenceOfStringIA5 carrierIA5;

	@FieldOrder(order = 39)
	public TariffType tariff;

	@FieldOrder(order = 40)
	@Asn1Default(value="travelPrice")
	@Asn1Optional public PriceTypeType priceType;
	
	@FieldOrder(order = 41)
	@Asn1Optional Asn1BigInteger price;
	
	@FieldOrder(order = 42)
	@Asn1Optional SequenceOfVatDetail vatDetails;
	
	@FieldOrder(order = 43)
	@RestrictedString(CharacterRestriction.UTF8String)
	@Asn1Optional public String infoText;

	@FieldOrder(order = 44)
	@Asn1Optional public ExtensionData extension;
	
	public Long getTrainNum() {
		if (this.trainNum == null) return null;
		return Asn1BigInteger.toLong(this.trainNum);
	}

	public String getTrainIA5() {

		return this.trainIA5;
	}

	public Long getBeginLoadingDate() {
		
		return this.beginLoadingDate;
	}

	public Long getBeginLoadingTime() {

		if (beginLoadingTime == null) return new Long(0);
		return beginLoadingTime;
	}

	public Long getEndLoadingTime() {

		return this.endLoadingTime;
	}

	public String getReferenceIA5() {

		return this.referenceIA5;
	}

	public Long getReferenceNum() {
		return Asn1BigInteger.toLong(this.referenceNum);
	}

	public Long getProductOwnerNum() {

		return this.productOwnerNum;
	}

	public String getProductOwnerIA5() {

		return this.productOwnerIA5;
	}

	public Long getProductIdNum() {

		return this.productIdNum;
	}

	public String getProductIdIA5() {

		return this.productIdIA5;
	}

	public Long getServiceBrand() {

		return this.serviceBrand;
	}

	public String getServiceBrandAbrUTF8() {

		return this.serviceBrandAbrUTF8;
	}

	public String getServiceBrandNameUTF8() {

		return this.serviceBrandNameUTF8;
	}

	public CodeTableType getStationCodeTable() {

		if (stationCodeTable == null) {
			return CodeTableType.stationUICReservation;
		}
		
		return this.stationCodeTable;
	}

	public Long getFromStationNum() {

		return this.fromStationNum;
	}

	public String getFromStationIA5() {

		return this.fromStationIA5;
	}

	public Long getToStationNum() {

		return this.toStationNum;
	}

	public String getToStationIA5() {

		return this.toStationIA5;
	}

	public String getFromStationNameUTF8() {

		return this.fromStationNameUTF8;
	}

	public String getToStationNameUTF8() {

		return this.toStationNameUTF8;
	}

	public String getCoach() {

		return this.coach;
	}

	public String getPlace() {

		return this.place;
	}

	public CompartmentDetailsType getCompartmentDetails() {

		return this.compartmentDetails;
	}

	public String getNumberPlate() {

		return this.numberPlate;
	}

	public String getTrailerPlate() {

		return this.trailerPlate;
	}

	public Long getCarCategory() {

		return this.carCategory;
	}

	public Long getBoatCategory() {

		return this.boatCategory;
	}

	public Boolean getTextileRoof() {

		return this.textileRoof;
	}

	public RoofRackType getRoofRackType() {

		if (this.roofRackType == null)  return RoofRackType.norack;
		return this.roofRackType;
	}

	public Long getRoofRackHeight() {

		return this.roofRackHeight;
	}

	public Long getAttachedBoats() {

		return this.attachedBoats;
	}

	public Long getAttachedBicycles() {

		return this.attachedBicycles;
	}

	public Long getAttachedSurfboards() {

		return this.attachedSurfboards;
	}

	public Long getLoadingListEntry() {

		return this.loadingListEntry;
	}

	public LoadingDeckType getLoadingDeck() {

		if (this.loadingDeck == null) return LoadingDeckType.upper;
		return this.loadingDeck;
	}

	public SequenceOfCarrierNum getCarrierNum() {

		return this.carrierNum;
	}

	public SequenceOfStringIA5 getCarrierIA5() {

		return this.carrierIA5;
	}

	public TariffType getTariff() {

		return this.tariff;
	}

	public PriceTypeType getPriceType() {
		if (this.priceType == null) return PriceTypeType.travelPrice;
		return this.priceType;
	}

	public String getInfoText() {

		return this.infoText;
	}

	public ExtensionData getExtension() {

		return this.extension;
	}

	public void setTrainNum(Long trainNum) {
		
		this.trainNum = new Asn1BigInteger(trainNum);
	}

	public void setTrainIA5(String trainIA5) {

		this.trainIA5 = trainIA5;
	}

	public void setBeginLoadingDate(Long beginLoadingDate) {

		this.beginLoadingDate = beginLoadingDate;
	}

	public void setBeginLoadingTime(Long beginLoadingTime) {

		this.beginLoadingTime = beginLoadingTime;
	}

	public void setEndLoadingTime(Long endLoadingTime) {
		this.endLoadingTime = endLoadingTime;
	}

	public void setReferenceIA5(String referenceIA5) {

		this.referenceIA5 = referenceIA5;
	}

	public void setReferenceNum(Long referenceNum) {

		this.referenceNum = Asn1BigInteger.toAsn1(referenceNum);
	}

	public void setProductOwnerNum(Long productOwnerNum) {

		this.productOwnerNum = productOwnerNum;
	}

	public void setProductOwnerIA5(String productOwnerIA5) {

		this.productOwnerIA5 = productOwnerIA5;
	}

	public void setProductIdNum(Long productIdNum) {

		this.productIdNum = productIdNum;
	}

	public void setProductIdIA5(String productIdIA5) {

		this.productIdIA5 = productIdIA5;
	}

	public void setServiceBrand(Long serviceBrand) {

		this.serviceBrand = serviceBrand;
	}

	public void setServiceBrandAbrUTF8(String serviceBrandAbrUTF8) {

		this.serviceBrandAbrUTF8 = serviceBrandAbrUTF8;
	}

	public void setServiceBrandNameUTF8(String serviceBrandNameUTF8) {

		this.serviceBrandNameUTF8 = serviceBrandNameUTF8;
	}

	public void setStationCodeTable(CodeTableType stationCodeTable) {

		this.stationCodeTable = stationCodeTable;
	}

	public void setFromStationNum(Long fromStationNum) {

		this.fromStationNum = fromStationNum;
	}

	public void setFromStationIA5(String fromStationIA5) {

		this.fromStationIA5 = fromStationIA5;
	}

	public void setToStationNum(Long toStationNum) {

		this.toStationNum = toStationNum;
	}

	public void setToStationIA5(String toStationIA5) {

		this.toStationIA5 = toStationIA5;
	}

	public void setFromStationNameUTF8(String fromStationNameUTF8) {

		this.fromStationNameUTF8 = fromStationNameUTF8;
	}

	public void setToStationNameUTF8(String toStationNameUTF8) {

		this.toStationNameUTF8 = toStationNameUTF8;
	}

	public void setCoach(String coach) {

		this.coach = coach;
	}

	public void setPlace(String place) {

		this.place = place;
	}

	public void setCompartmentDetails(CompartmentDetailsType compartmentDetails) {

		this.compartmentDetails = compartmentDetails;
	}

	public void setNumberPlate(String numberPlate) {

		this.numberPlate = numberPlate;
	}

	public void setTrailerPlate(String trailerPlate) {

		this.trailerPlate = trailerPlate;
	}

	public void setCarCategory(Long carCategory) {

		this.carCategory = carCategory;
	}

	public void setBoatCategory(Long boatCategory) {

		this.boatCategory = boatCategory;
	}

	public void setTextileRoof(Boolean textileRoof) {

		this.textileRoof = textileRoof;
	}

	public void setRoofRackType(RoofRackType roofRackType) {

		this.roofRackType = roofRackType;
	}

	public void setRoofRackHeight(Long roofRackHeight) {

		this.roofRackHeight = roofRackHeight;
	}

	public void setAttachedBoats(Long attachedBoats) {

		this.attachedBoats = attachedBoats;
	}

	public void setAttachedBicycles(Long attachedBicycles) {

		this.attachedBicycles = attachedBicycles;
	}

	public void setAttachedSurfboards(Long attachedSurfboards) {

		this.attachedSurfboards = attachedSurfboards;
	}

	public void setLoadingListEntry(Long loadingListEntry) {

		this.loadingListEntry = loadingListEntry;
	}

	public void setLoadingDeck(LoadingDeckType loadingDeck) {

		this.loadingDeck = loadingDeck;
	}

	public void setCarrierNum(SequenceOfCarrierNum carrierNum) {

		this.carrierNum = carrierNum;
	}
	
	public void setCarrierNum(List<Long> longs) {
		if (longs == null || longs.isEmpty()) return;
		this.carrierNum = new SequenceOfCarrierNum(longs);
	}
	

	public void setCarrierIA5(SequenceOfStringIA5 carrierIA5) {

		this.carrierIA5 = carrierIA5;
	}

	public void setTariff(TariffType tariff) {

		this.tariff = tariff;
	}

	public void setPriceType(PriceTypeType priceType) {

		this.priceType = priceType;
	}

	public void setInfoText(String infoText) {

		this.infoText = infoText;
	}

	public void setExtension(ExtensionData extension) {

		this.extension = extension;
	}
	
	public Long getPrice() {
		return Asn1BigInteger.toLong(price);
	}

	public void setPrice(Long price) {
		this.price = Asn1BigInteger.toAsn1(price);
	}

	public SequenceOfVatDetail getVatDetails() {
		return vatDetails;
	}

	public void setVatDetails(SequenceOfVatDetail vatDetails) {
		this.vatDetails = vatDetails;
	}

	public void addVatDetail(VatDetailType vatDetail) {
		if (this.vatDetails == null) {
			this.vatDetails = new SequenceOfVatDetail();
		}
		this.vatDetails.add(vatDetail);
	}
	
	public void setLoadingDates (Date beginLoading, Date endLoading, Date issuingDate){
		
		if (issuingDate == null || beginLoading == null) return;
		
		this.beginLoadingDate = DateTimeUtils.getDateDifference(issuingDate,beginLoading);
		this.beginLoadingTime =  DateTimeUtils.getTime(beginLoading);
				
		if (endLoading != null) {
			this.endLoadingTime =  DateTimeUtils.getTime(endLoading);
		}
	}
	
	public Date getBeginLoadingDate(Date issuingDate){
		
		if (issuingDate == null) return null;
		
		if (this.beginLoadingDate == null) {
			this.beginLoadingDate = 0L;
		}
		
		return DateTimeUtils.getDate(issuingDate, this.beginLoadingDate, this.beginLoadingTime);

	}
	
	public Date getEndLoadingDate(Date issuingDate){
		
		if (issuingDate == null) return null;
		
		if (this.beginLoadingDate == null) {
			this.beginLoadingDate = 0L;
		}
		
		if (this.endLoadingTime == null) {
			return null;
		}
		
		Date begin = DateTimeUtils.getDate(issuingDate, this.beginLoadingDate, this.beginLoadingTime);
		Date end = DateTimeUtils.getDate(issuingDate, this.beginLoadingDate, this.endLoadingTime);
		
		//max one day difference assumed
		if (end.before(begin)) {
			Calendar cal = Calendar.getInstance();
			cal.clear();
			cal.setTime(end);
			cal.add(Calendar.DAY_OF_YEAR,1);
			return cal.getTime();
		} else {
			return end;
		}

	}

	public Long getLoadingUTCOffset() {
		return loadingUTCOffset;
	}

	public void setLoadingUTCOffset(Long loadingUTCOffset) {
		this.loadingUTCOffset = loadingUTCOffset;
	}
	
	


}