From 119a99ff49d314cf33b94d1c922f5091a26489d6 Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Mon, 28 Jun 2021 16:54:11 +0200 Subject: - initial implementation of FCB version 3.0.0 - !!Tests still missing!! --- .../ticket/api/impl/SimpleTrainValidity.java | 197 +++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java (limited to 'src/main/java/org/uic/barcode/ticket/api/impl/SimpleTrainValidity.java') 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 CollectionincludedCarriers = new LinkedHashSet(); + + /** The excluded carriers. */ + protected CollectionexcludedCarriers = new LinkedHashSet(); + + /** The included service brands. */ + protected CollectionincludedServiceBrands = new LinkedHashSet(); + + /** The excluded service brands. */ + protected CollectionexcludedServiceBrands = new LinkedHashSet(); + + /** 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 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 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 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 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; + } + + + + +} -- cgit v1.2.3