summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/uic/barcode/ticket/api/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/uic/barcode/ticket/api/impl')
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java14
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java197
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java7
-rw-r--r--src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java22
4 files changed, 240 insertions, 0 deletions
diff --git a/src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java b/src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java
index a8f4a92..479db78 100644
--- a/src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java
+++ b/src/main/java/org/uic/barcode/ticket/api/impl/SimplePass.java
@@ -11,6 +11,7 @@ import org.uic.barcode.ticket.api.spec.IExtension;
import org.uic.barcode.ticket.api.spec.IPass;
import org.uic.barcode.ticket.api.spec.IRegionalValidity;
import org.uic.barcode.ticket.api.spec.ITariff;
+import org.uic.barcode.ticket.api.spec.ITrainValidity;
import org.uic.barcode.ticket.api.spec.ITravelClassType;
import org.uic.barcode.ticket.api.spec.IValidityDetails;
import org.uic.barcode.ticket.api.spec.IVatDetail;
@@ -97,6 +98,9 @@ public class SimplePass extends SimpleDocumentData implements IPass {
/** The price. */
protected Long price;
+
+
+ protected ITrainValidity trainValidity;
/* (nicht-Javadoc)
@@ -482,4 +486,14 @@ public class SimplePass extends SimpleDocumentData implements IPass {
this.setValidUntil(date);
}
+ @Override
+ public void setTrainValidity(ITrainValidity trainValidity) {
+ this.trainValidity = trainValidity;
+ }
+
+ @Override
+ public ITrainValidity getTrainValidity() {
+ return trainValidity;
+ }
+
}
diff --git a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java
new file mode 100644
index 0000000..610a268
--- /dev/null
+++ b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java
@@ -0,0 +1,197 @@
+package org.uic.barcode.ticket.api.impl;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.LinkedHashSet;
+
+import org.uic.barcode.ticket.api.spec.IBoardingOrArrivalType;
+import org.uic.barcode.ticket.api.spec.ITrainValidity;
+
+/**
+ * The Class SimpleTrainValidity.
+ */
+public class SimpleTrainValidity implements ITrainValidity {
+
+
+ /** The valid from. */
+ protected Date validFrom;
+
+ /** The valid until. */
+ protected Date validUntil;
+
+ /** The included carriers. */
+ protected Collection<String>includedCarriers = new LinkedHashSet<String>();
+
+ /** The excluded carriers. */
+ protected Collection<String>excludedCarriers = new LinkedHashSet<String>();
+
+ /** The included service brands. */
+ protected Collection<Integer>includedServiceBrands = new LinkedHashSet<Integer>();
+
+ /** The excluded service brands. */
+ protected Collection<Integer>excludedServiceBrands = new LinkedHashSet<Integer>();
+
+ /** The class code. */
+ protected IBoardingOrArrivalType boardingOrArrival = IBoardingOrArrivalType.boarding;
+
+ /** The valid from utc coffset. */
+ protected Long validFromUTCoffset;
+
+ /** The valid until utc coffset. */
+ protected Long validUntilUTCoffset;
+
+
+ /**
+ * Gets the included carriers.
+ *
+ * @return the included carriers
+ */
+ public Collection<String> getIncludedCarriers() {
+ return includedCarriers;
+ }
+
+
+ /**
+ * Adds the included carrier.
+ *
+ * @param carrier the carrier
+ */
+ public void addIncludedCarrier(String carrier) {
+ this.includedCarriers.add(carrier);
+ }
+
+ /**
+ * Gets the excluded carriers.
+ *
+ * @return the excluded carriers
+ */
+ public Collection<String> getExcludedCarriers() {
+ return excludedCarriers;
+ }
+
+ /**
+ * Adds the excluded carrier.
+ *
+ * @param carrier the carrier
+ */
+ public void addExcludedCarrier(String carrier) {
+ this.excludedCarriers.add(carrier);
+ }
+
+ /**
+ * Gets the included service brands.
+ *
+ * @return the included service brands
+ */
+ public Collection<Integer> getIncludedServiceBrands() {
+ return includedServiceBrands;
+ }
+
+ /**
+ * Adds the included service brand.
+ *
+ * @param includedServiceBrand the included service brand
+ */
+ public void addIncludedServiceBrand(Integer includedServiceBrand) {
+ this.includedServiceBrands.add(includedServiceBrand);
+ }
+
+ /**
+ * Gets the excluded service brands.
+ *
+ * @return the excluded service brands
+ */
+ public Collection<Integer> getExcludedServiceBrands() {
+ return excludedServiceBrands;
+ }
+
+ /**
+ * Adds the excluded service brand.
+ *
+ * @param excludedServiceBrand the excluded service brand
+ */
+ public void addExcludedServiceBrand(Integer excludedServiceBrand) {
+ this.excludedServiceBrands.add(excludedServiceBrand);
+ }
+
+ public Date getFromDate() {
+ return validFrom;
+ }
+
+ public void setFromDate(Date validFrom) {
+ this.validFrom = validFrom;
+ }
+
+
+
+
+
+ /**
+ * Gets the valid from UT coffset.
+ *
+ * @return the valid from UT coffset
+ */
+ public Long getValidFromUTCoffset() {
+ return validFromUTCoffset;
+ }
+
+ /**
+ * Sets the valid from UT coffset.
+ *
+ * @param validFromUTCoffset the new valid from UT coffset
+ */
+ public void setValidFromUTCoffset(Long validFromUTCoffset) {
+ this.validFromUTCoffset = validFromUTCoffset;
+ }
+
+ /**
+ * Gets the valid until UT coffset.
+ *
+ * @return the valid until UT coffset
+ */
+ public Long getValidUntilUTCoffset() {
+ return validUntilUTCoffset;
+ }
+
+ /**
+ * Sets the valid until UT coffset.
+ *
+ * @param validUntilUTCoffset the new valid until UT coffset
+ */
+ public void setValidUntilUTCoffset(Long validUntilUTCoffset) {
+ this.validUntilUTCoffset = validUntilUTCoffset;
+ }
+
+ /**
+ * Sets the until date.
+ *
+ * @param date the new until date
+ */
+ @Override
+ public void setUntilDate(Date validUntil) {
+ this.validUntil = validUntil;
+ }
+
+
+ public Date getUntilDate() {
+ return validUntil;
+ }
+
+
+
+
+ @Override
+ public IBoardingOrArrivalType getBoardingOrArrival() {
+ return this.boardingOrArrival;
+ }
+
+
+ @Override
+ public void setBoardingOrArrival(IBoardingOrArrivalType boardingOrArrival) {
+ this.boardingOrArrival = boardingOrArrival;
+ }
+
+
+
+
+}
diff --git a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java
index 3e3eac0..0d284ba 100644
--- a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java
+++ b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleUicTicketObjectFactory.java
@@ -35,6 +35,7 @@ import org.uic.barcode.ticket.api.spec.ITicketLink;
import org.uic.barcode.ticket.api.spec.ITimeRange;
import org.uic.barcode.ticket.api.spec.IToken;
import org.uic.barcode.ticket.api.spec.ITrainLink;
+import org.uic.barcode.ticket.api.spec.ITrainValidity;
import org.uic.barcode.ticket.api.spec.ITraveler;
import org.uic.barcode.ticket.api.spec.ITravelerDetail;
import org.uic.barcode.ticket.api.spec.IUicRailTicket;
@@ -236,6 +237,12 @@ public class SimpleUicTicketObjectFactory implements IUicTicketObjectFactory {
return new SimpleVatDetail();
}
+
+ @Override
+ public ITrainValidity createTrainValidity() {
+ return new SimpleTrainValidity();
+ }
+
diff --git a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java
index da0d815..4419ea2 100644
--- a/src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java
+++ b/src/main/java/org/uic/barcode/ticket/api/impl/SimpleViaStation.java
@@ -39,6 +39,13 @@ public class SimpleViaStation implements IViaStation {
/** The series id. */
protected int seriesId;
+ /** The included service brands. */
+ protected Collection<Integer>includedServiceBrands = new LinkedHashSet<Integer>();
+
+ /** The excluded service brands. */
+ protected Collection<Integer>excludedServiceBrands = new LinkedHashSet<Integer>();
+
+
/* (nicht-Javadoc)
* @see org.uic.ticket.api.spec.IViaStation#getStationCodeTable()
*/
@@ -151,7 +158,22 @@ public class SimpleViaStation implements IViaStation {
public void setSeriesId(int seriesId) {
this.seriesId = seriesId;
}
+
+ public Collection<Integer> getIncludedServiceBrands() {
+ return includedServiceBrands;
+ }
+
+ public void addIncludedServiceBrand(Integer includedServiceBrand) {
+ this.includedServiceBrands.add(includedServiceBrand);
+ }
+
+ public Collection<Integer> getExcludedServiceBrands() {
+ return excludedServiceBrands;
+ }
+ public void addExcludedServiceBrand(Integer excludedServiceBrand) {
+ this.excludedServiceBrands.add(excludedServiceBrand);
+ }
}