blob: 682203fdbc3dc0ace8136d05a1321b34c288629b (
plain) (
tree)
|
|
/*
* 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.omv2;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import net.gcdc.asn1.datatypes.Asn1Optional;
import net.gcdc.asn1.datatypes.CharacterRestriction;
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.datatypes.SizeRange;
@Sequence
@HasExtensionMarker
public class TravelerType extends Object {
public TravelerType() {
}
@RestrictedString(CharacterRestriction.UTF8String)
@Asn1Optional public String firstName;
@RestrictedString(CharacterRestriction.UTF8String)
@Asn1Optional public String secondName;
@RestrictedString(CharacterRestriction.UTF8String)
@Asn1Optional public String lastName;
@RestrictedString(CharacterRestriction.IA5String)
@Asn1Optional public String idCard;
@RestrictedString(CharacterRestriction.IA5String)
@Asn1Optional public String passportId;
@SizeRange(minValue = 1, maxValue = 3)
@RestrictedString(CharacterRestriction.IA5String)
@Asn1Optional public String title;
@Asn1Optional public GenderType gender;
@RestrictedString(CharacterRestriction.IA5String)
@Asn1Optional public String customerIdIA5;
@Asn1Optional public Long customerIdNum;
@IntRange(minValue=1901,maxValue=2155)
@Asn1Optional public Long yearOfBirth;
@IntRange(minValue=0,maxValue=366)
@Asn1Optional public Long dayOfBirth;
public Boolean ticketHolder = true;
@Asn1Optional public PassengerType passengerType;
@Asn1Optional public Boolean passengerWithReducedMobility;
@IntRange(minValue=1,maxValue=999)
@Asn1Optional public Long countryOfResidence;
@IntRange(minValue=1,maxValue=999)
@Asn1Optional public Long countryOfPassport;
@IntRange(minValue=1,maxValue=999)
@Asn1Optional public Long countryOfIdCard;
@Asn1Optional public SequenceOfCustomerStatusType status;
public String getFirstName() {
return this.firstName;
}
public String getSecondName() {
return this.secondName;
}
public String getLastName() {
return this.lastName;
}
public String getIdCard() {
return this.idCard;
}
public String getPassportId() {
return this.passportId;
}
public String getTitle() {
return this.title;
}
public GenderType getGender() {
return this.gender;
}
public String getCustomerIdIA5() {
return this.customerIdIA5;
}
public Long getCustomerIdNum() {
return this.customerIdNum;
}
public Long getYearOfBirth() {
return this.yearOfBirth;
}
public Long getDayOfBirth() {
return this.dayOfBirth;
}
public Boolean getTicketHolder() {
return this.ticketHolder;
}
public PassengerType getPassengerType() {
return this.passengerType;
}
public Boolean getPassengerWithReducedMobility() {
return this.passengerWithReducedMobility;
}
public Long getCountryOfResidence() {
return this.countryOfResidence;
}
public Long getCountryOfPassport() {
return this.countryOfPassport;
}
public Long getCountryOfIdCard() {
return this.countryOfIdCard;
}
public SequenceOfCustomerStatusType getStatus() {
return this.status;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setSecondName(String secondName) {
this.secondName = secondName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void setIdCard(String idCard) {
this.idCard = idCard;
}
public void setPassportId(String passportId) {
this.passportId = passportId;
}
public void setTitle(String title) {
this.title = title;
}
public void setGender(GenderType gender) {
this.gender = gender;
}
public void setCustomerIdIA5(String customerIdIA5) {
this.customerIdIA5 = customerIdIA5;
}
public void setCustomerIdNum(Long customerIdNum) {
this.customerIdNum = customerIdNum;
}
public void setYearOfBirth(Long yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
public void setDayOfBirth(Long dayOfBirth) {
this.dayOfBirth = dayOfBirth;
}
public void setTicketHolder(Boolean ticketHolder) {
this.ticketHolder = ticketHolder;
}
public void setPassengerType(PassengerType passengerType) {
this.passengerType = passengerType;
}
public void setPassengerWithReducedMobility(Boolean passengerWithReducedMobility) {
this.passengerWithReducedMobility = passengerWithReducedMobility;
}
public void setCountryOfResidence(Long countryOfResidence) {
this.countryOfResidence = countryOfResidence;
}
public void setCountryOfPassport(Long countryOfPassport) {
this.countryOfPassport = countryOfPassport;
}
public void setCountryOfIdCard(Long countryOfIdCard) {
this.countryOfIdCard = countryOfIdCard;
}
public void setStatus(SequenceOfCustomerStatusType status) {
this.status = status;
}
public void setDateOfBirth(Date date){
if (date == null) return;
Calendar cal = Calendar.getInstance();
cal.setTime(date);
this.yearOfBirth = new Long( cal.get(Calendar.YEAR));
this.dayOfBirth = new Long (cal.get(Calendar.DAY_OF_YEAR));
}
public Date getDateOfBirth() {
if (this.yearOfBirth == null) return null;
if (this.dayOfBirth == null) return null;
Calendar cal = Calendar.getInstance();
cal.clear();
cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.yearOfBirth.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.dayOfBirth.intValue());
cal.set(Calendar.HOUR_OF_DAY,0);
cal.set(Calendar.MINUTE,0);
return cal.getTime();
}
}
|