index
int64
repo_id
string
file_path
string
content
string
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/AirWaybillNumber.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import javax.validation.constraints.Pattern; @JsonClassDescription("Air waybill number used to identify an air cargo entity.") public class AirWaybillNumber { @JsonIgnore public final String awbNumber; @JsonCreator public AirWaybillNumber(@Pattern(regexp = "[0-9]{3}-[0-9]{8}") String awbNumber) { this.awbNumber = awbNumber; } @JsonValue @JsonDocExample("020-97162321") @JsonPropertyDescription("A string consisting of a 3-digit airline number, followed by a hyphen, followed by an 8-digit number. " + "Regular expression: [0-9]{3}-[0-9]{8}") public String awbNumber() { return awbNumber; } public String airlinePrefix() { return awbNumber.substring(0,3); } public String serialNumber() { return awbNumber.substring(4); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AirWaybillNumber that = (AirWaybillNumber) o; return awbNumber.equals(that.awbNumber); } @Override public int hashCode() { return awbNumber.hashCode(); } @Override public String toString() { return awbNumber(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/CASSIndicator.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("CASS Indicator used in CASS messages.\n" + "This switch indicates whether commission or sales incentive applies, whether an AWB is used " + "as an invoice or service, cancelled or voided, whether a tax calculation is required, whether " + "an amount is original or revised and late reporting waybills.") public enum CASSIndicator { AWB_AS_INVOICE("I") ,CANCEL_AWB("C") ,CHARGES_CORRECTION_ADIVCE("CC") ,DEBIT_OR_CREDIT_MEMORANDUM("DC") ,IDENTIFICATION("ID") ,LATE_REPORTING_WAYBILLS("L") ,NO_COMMISSION_OR_NEGATIVE_SALES_INCENTIVE("N") ,ORIGINAL_DATA("DL") ,REVISED_ADJUSTED_DATA("AD") ,SERVICE_AWB("S") ,TAX_CALCULATION_REQUIRED("T") ,VOID_AWB("V"); public final String cargoImpCode; CASSIndicator(String cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static CASSIndicator fromCargoImpCode(String cargoImpCode) { for (CASSIndicator code : values()) { if (code.cargoImpCode.equals(cargoImpCode)) return code; } throw new IllegalArgumentException("No such cargo imp code: '"+cargoImpCode+"'"); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ChargeCode.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Charge Code: Code identifying a method of payment of charges.") public enum ChargeCode { ALL_CHARGES_COLLECT("CC") ,ALL_CHARGES_COLLECT_BY_CREDIT_CARD("CZ") ,ALL_CHARGES_COLLECT_BY_GBL("CG") ,ALL_CHARGES_PREPAID_CASH("PP") ,ALL_CHARGES_PREPAID_CREDIT("PX") ,ALL_CHARGES_PREPAID_BY_CREDIT_CARD("PZ") ,ALL_CHARGES_PREPAID_BY_GBL("PG") ,DESTINATION_COLLECT_CASH("CP") ,DESTINATION_COLLECT_CREDIT("CX") ,DESTINATION_COLLECT_BY_MCO("CM") ,NO_CHARGE("NC") ,NO_WEIGHT_CHARGE_OTHER_CHARGES_COLLECT("NT") ,NO_WEIGHT_CHARGE_OTHER_CHARGES_PREPAID_BY_CREDIT_CARD("NZ") ,NO_WEIGHT_CHARGE_OTHER_CHARGES_PREPAID_BY_GBL("NG") ,NO_WEIGHT_CHARGE_OTHER_CHARGES_PREPAID_CASH("NP") ,NO_WEIGHT_CHARGE_OTHER_CHARGES_PREPAID_CREDIT("NX") ,PARTIAL_COLLECT_CREDIT_PARTIAL_PREPAID_CASH("CA") ,PARTIAL_COLLECT_CREDIT_PARTIAL_PREPAID_CREDIT("CB") ,PARTIAL_COLLECT_CREDIT_CARD_PARTIAL_PREPAID_CASH("CE") ,PARTIAL_COLLECT_CREDIT_CARD_PARTIAL_PREPAID_CREDIT("CH") ,PARTIAL_PREPAID_CASH_PARTIAL_COLLECT_CASH("PC") ,PARTIAL_PREPAID_CREDIT_PARTIAL_COLLECT_CASH("PD") ,PARTIAL_PREPAID_CREDIT_CARD_PARTIAL_COLLECT_CASH("PE") ,PARTIAL_PREPAID_CREDIT_CARD_PARTIAL_COLLECT_CREDIT("PH") ,PARTIAL_PREPAID_CREDIT_CARD_PARTIAL_COLLECT_CREDIT_CARD("PF"); public final String cargoImpCode; ChargeCode(String cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static ChargeCode fromCargoImpCode(String code) { for (ChargeCode c : values()) { if (c.cargoImpCode.equals(code)) return c; } return null; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ContactDetail.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; @JsonClassDescription("Contact Details.") public class ContactDetail { @JsonProperty(required = true) @JsonPropertyDescription("Code identifying a means of contact for a participant.") @JsonDocExample("TE") public String contactIdentifier; @JsonProperty(required = true) @JsonPropertyDescription("Contact Number of a participant .") @JsonDocExample("5148446311") public String contactNumber; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/CustomerIdentification.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Customer identification.") public class CustomerIdentification { @JsonProperty(required = true) @JsonPropertyDescription("The name of the individual or company.") @JsonDocExample("Supersonic Shipping Co.") public String name; @JsonProperty(required = true) @JsonPropertyDescription("Location of individual or company.") @JsonDocExample("London") public String place; @JsonPropertyDescription("Account number: Coded identification of a participant.") @JsonDocExample("ABC94269") public Optional<String> accountNumber = Optional.empty(); @JsonPropertyDescription("IATA cargo agent numeric code Code issued by IATA to identify each IATA " + "cargo agent whose name is entered on the Cargo Agency List.") @JsonDocExample("1234567") public Optional<String> iataCargoAgentNumericCode = Optional.empty(); @JsonPropertyDescription("IATA cargo agent CASS address: Code issued by IATA to identify individual " + "agent locations for CASS billing purposes.") @JsonDocExample("1234") public Optional<String> iataCargoAgentCASSAddress = Optional.empty(); @JsonPropertyDescription("Participant identifier: Code identifying the type of participant involved in the movement of a shipment.") @JsonDocExample("CNE") public Optional<String> participantIdentifier = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/CustomsActionCode.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.constraints.Pattern; @JsonClassDescription("Customs Action Code") public class CustomsActionCode { @JsonIgnore public final String code; @JsonCreator public CustomsActionCode(@Pattern(regexp = "(?:[0-9]{3})") String code) { this.code = code; } @JsonValue @JsonDocExample("123") public String code() { return code; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/CustomsSecurityAndRegulatoryControlInformationIdentifier.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Customs, security and regulatory control information identifier.") public enum CustomsSecurityAndRegulatoryControlInformationIdentifier { ACCOUNT_CONSIGNOR("AC"), AUTHORISED_ECONOMIC_OPERATOR("E"), AUTOMATED_BROKER_INTERFACE("A"), CERTIFICATE_NUMBER("C"), DANGEROUS_GOODS("D"), EXEMPTION_LEGEND("L"), INVOICE_NUMBER("V"), ITEM_NUMBER("I"), FACILITIES_INFORMATION("F"), KNOWN_CONSIGNOR("KC"), MOVEMENT_REFERENCE_NUMBER("M"), PACKING_LIST_NUMBER("P"), REGULATED_AGENT("RA"), REGULATED_CARRIER("RC"), LICENSE_IDENTIFICATION("LI"), DECLARATION_IDENTIFICATION("DI"), SCREENING_METHOD("SM"), SECURITY_STATUS_DATE_AND_TIME("SD"), SECURITY_STATUS_NAME_OF_ISSUER("SN"), SECURITY_STATUS("SS"), SECURITY_TEXTUAL_STATEMENT("ST"), EXPIRY_DATE("ED"), SEAL_NUMBER("N"), SYSTEM_DOWNTIME_REFERENCE("S"), TRADER_IDENTIFICATION_NUMBER("T"), UNIQUE_CONSIGNMENT_REFERENCE_NUMBER("U"), CUSTOMS_SECURITY_BLOCK("CB"), CUSTOMS_SECURITY_HOLD_DO_NOT_LOAD("CD"), CUSTOMS_RELEASE_OK("CO"), CONTACT_PERSON("CP"), CONTACT_TELEPHONE_NUMBER("CT") ; public final String cargoImpCode; CustomsSecurityAndRegulatoryControlInformationIdentifier(String cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static CustomsSecurityAndRegulatoryControlInformationIdentifier fromCargoImpCode(String cargoImpCode) { for (CustomsSecurityAndRegulatoryControlInformationIdentifier code : values()) { if (code.cargoImpCode.equals(cargoImpCode)) return code; } throw new IllegalArgumentException("No such cargo imp code: '"+cargoImpCode+"'"); } public static boolean exists(String cargoImpCode) { for (CustomsSecurityAndRegulatoryControlInformationIdentifier code : values()) { if (code.cargoImpCode.equals(cargoImpCode)) return true; } return false; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/CustomsStatusCode.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import javax.validation.constraints.Pattern; @JsonClassDescription("Customs Status Code") public class CustomsStatusCode { @JsonIgnore public final String code; @JsonCreator public CustomsStatusCode(@Pattern(regexp = "(?:[A-Z]{2})") String code) { this.code = code; } @JsonValue @JsonDocExample("CC") public String code() { return code; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/DataElementGroupIdentifier.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Code identifying a particular group of data elements.") public enum DataElementGroupIdentifier { ACC("ACC", "Accounting Information") ,AGT("AGT", "(Nominated) Agent (Coded)/Consignee") ,ARD("ARD", "Agent Reference Data") ,API("API", "Air Waybill Piece Information") ,AIR("AIR", "Airline Header") ,ALA("ALA", "Allotment Availability Information") ,ALI("ALI", "Allotment Information") ,ALR("ALR", "Allotment Remaining") ,ALT("ALT", "Allotment Total") ,AUD("AUD", "Allotment Used Details") ,NFY("NFY", "(Also) Notify (Name and Address)") ,AMD("AMD", "Amendment Identification") ,AID("AID", "Arrival Information Details") ,ATH("ATH", "Authorisation") ,AVS("AVS", "Availability Supplementary Details") ,ABI("ABI", "AWB Amount Detail Information") ,ACS("ACS", "AWB Charge Summary") ,ACD("ACD", "AWB Consignment Details") ,CER("CER", "AWB Content Certification") ,ISU("ISU", "AWB Issue Details") ,ARI("ARI", "AWB Recapitulation Information") ,ABS("ABS", "AWB Supplementary Information") ,ABT("ABT", "AWB Total Amount Information") ,ATW("ATW", "AWB Total Weight Summary") ,BGD("BGD", "Baggage Detail Information") ,BGT("BGT", "Baggage Tag Identification") ,REF("REF", "Booking/Sender/Request References") ,BRK("BRK", "Broker") ,CCL("CCL", "Cargo Control Location") ,CRD("CRD", "Carrier Reference Data") ,CWI("CWI", "CASS AWB Information") ,CBD("CBD", "CASS Billing Details") ,CBI("CBI", "CASS Billing Information") ,CBP("CBP", "CASS Billing Period") ,CIN("CIN", "CASS Identification Number") ,CIH("CIH", "CASS Invoice Header Details") ,CDC("CDC", "CC Charges in Destination Currency") ,CAI("CAI", "CCA/Adjustment Information") ,CAS("CAS", "CCA/Adjustment Supplementary Information") ,CTI("CTI", "CCA/Adjustment Total Information") ,CTW("CTW", "CCA/Adjustment Total Weight Summary") ,RQD("RQD", "Charge Calculation Answer Details") ,RQT("RQT", "Charge Calculation Answer Totals") ,RQH("RQH", "Charge Calculation Request Header") ,RQU("RQU", "Charge Calculation Request — ULD") ,RQV("RQV", "Charge Calculation Request — Volume") ,CDI("CDI", "Charge Declarations") ,CVD("CVD", "Charge Declarations") ,COL("COL", "Collect Charge Summary") ,COI("COI", "Commission Information") ,CNE("CNE", "Consignee Name and Address") ,CCD("CCD", "Consignment Control Details") ,CMI("CMI", "Consignment Onward Movement Information") ,CID("CID", "Correction Identification") ,CBR("CBR", "Courier Baggage Receiver") ,CBS("CBS", "Courier Baggage Sender") ,CBV("CBV", "Courier Baggage Voucher Identification") ,CUR("CUR", "Currency Details") ,CUS("CUS", "Customer Identification") ,CAN("CAN", "Customs Action Notification") ,CND("CND", "Customs Notification Details") ,COR("COR", "Customs Origin") ,DTN("DTN", "Date/Time of Notification / DGD Item Technical Name") ,DCL("DCL", "Declarant") ,DES("DES", "Despatch Information") ,DAI("DAI", "DGD Additional Handling Information") ,DAP("DAP", "DGD “All Packed in One” Indication") ,DAT("DAT", "DGD “All Packed in One” Total") ,DCI("DCI", "DGD Emergency Contact Information") ,DHD("DHD", "DGD Header Details") ,DAU("DAU", "DGD Item Authorisation") ,DII("DII", "DGD Item Information") ,DNR("DNR", "DGD Item Number") ,DPI("DPI", "DGD Item Packing Group and Instructions") ,DQP("DQP", "DGD Item Quantity and Type of Packing") ,DSN("DSN", "DGD Item Shipping Name") ,DOS("DOS", "DGD Overpack Summary") ,DRA("DRA", "DGD Radioactive Activity Information") ,DRC("DRC", "DGD Radioactive Consignment Information") ,DRP("DRP", "DGD Radioactive Packing Instructions") ,DSU("DSU", "DGD Signatory Details") ,DIM("DIM", "Dimensions Information") ,DOC("DOC", "Documentation Identification") ,CRR("CRR", "Embargo Carriage Restrictions") ,COM("COM", "Embargoed Commodities") ,JST("JST", "Embargo Justification") ,RTS("RTS", "Embargo Routes/Areas") ,EIC("EIC", "Empty Equipment in Compartment Information") ,EXP("EXP", "Export") ,FLT("FLT", "Flight Booking/Information") ,TXT("TXT", "Free Text Description") ,GRI("GRI", "Grand AWB Recapitulation Information") ,GTI("GTI", "Grand Total Information") ,HDL("HDL", "Handling Details") ,HTS("HTS", "Harmonised Tariff Schedule Information") ,HWB("HWB", "House Waybill") ,HPI("HPI", "House Waybill Piece Information") ,HAH("HAH", "HWB Agent’s Head Office") ,HCD("HCD", "HWB Consignment Details") ,HLC("HLC", "HWB Letter of Credit Details") ,HBS("HBS", "House Waybill Summary Details") ,IMP("IMP", "Import") ,ITA("ITA", "Invoice Total Amount Information") ,ITW("ITW", "Invoice Total Weight Summary") ,LOC("LOC", "Location") ,MAL("MAL", "Mail") ,MCH("MCH", "Mail Consignment Header") ,MCT("MCT", "Mail Consignment Total") ,MHU("MHU", "Mail Handling Unit") ,MID("MID", "Mail Inbound Data") ,MLI("MLI", "Mail Label Identification") ,MOD("MOD", "Mail Outbound Data") ,MSD("MSD", "Mail Status Details") ,MUD("MUD", "Mail ULD Information") ,MBI("MBI", "Master Waybill Identification") ,MSU("MSU", "Message Sequence and ULD Origin") ,MAT("MAT", "Message Advice Type") ,MPI("MPI", "Movement Priority Information") ,NAM("NAM", "Name") ,NBI("NBI", "Net Billing Information") ,NNS("NNS", "Net/Net Sales") ,NEW("NEW", "New Information") ,NOM("NOM", "Nominated Handling Party") ,OLD("OLD", "Original Information") ,OTH("OTH", "Other Charges") ,OCI("OCI", "Other Customs, Security and Regulatory Control Information") ,OPI("OPI", "Other Participant Information") ,OSI("OSI", "Other Service Information") ,PAS("PAS", "Passenger Information") ,PPD("PPD", "Prepaid Charge Summary") ,PRD("PRD", "Planning Request Details") ,PID("PID", "Product Information") ,RTD("RTD", "Rate Description") ,RID("RID", "Rate Information Answer Details") ,RIH("RIH", "Rate Information Answer Header") ,RIR("RIR", "Rate Information Request Details") ,ACK("ACK", "Reason for Acknowledgement") ,RCI("RCI", "Recapitulation Amount Information") ,RTI("RTI", "Recapitulation Total Information") ,REC("REC", "Receptacle Information") ,RTG("RTG", "Routing") ,SII("SII", "Sales Incentive Information") ,SAR("SAR", "Schedule and Availability Information Request Details") ,SAA("SAA", "Schedule and Availability Information Answer Details") ,SKH("SKH", "Schedule Information Answer Header") ,SRI("SRI", "Shipment Reference Information") ,SHP("SHP", "Shipper Name and Address") ,SCI("SCI", "Special Customs Information") ,SPH("SPH", "Special Handling Details") ,SSR("SSR", "Special Service Request") ,STS("STS", "Status Details") ,SLC("SLC", "Status List Criteria") ,STI("STI", "Storage Information") ,ADR("ADR", "Street Address") ,SRA("SRA", "Supplementary Rate Information Answer Details") ,SRR("SRR", "Supplementary Rate Information Request Details") ,SSI("SSI", "Supplementary Status Information") ,SCS("SCS", "Surface Charge Summary") ,SDI("SDI", "Surface Delivery Information") ,SPI("SPI", "Surface Pickup Information") ,SVA("SVA", "Surface Vehicle Arrival Information") ,SVL("SVL", "Surface Vehicle Delay Information") ,SVD("SVD", "Surface Vehicle Departure Information") ,SVN("SVN", "Surface Vehicle Next Information") ,TXS("TXS", "Tax Summary") ,TID("TID", "Terminal Identification") ,OSS("OSS", "The Regulated Agent Accepting the Security Status for a Consignment Issued by Another Regulated Agent") ,ISS("ISS", "The Regulated Agent Issuing the Security Status for a Consignment") ,TOT("TOT", "Total Amount") ,TAR("TAR", "Total AWB Recapitulation Information") ,TCC("TCC", "Total Collect Charges") ,TRN("TRN", "Transfer/Transit Information") ,TRA("TRA", "Transit") ,UCI("UCI", "ULD Connection Information") ,ULD("ULD", "ULD Description") ,UDI("UDI", "ULD Destination Information") ,UII("UII", "ULD Inclusion Information") ,UMI("UMI", "ULD Movement Information") ,UPI("UPI", "Unique Piece Information") ,VOD("VOD", "Vehicle Operator Details") ,VCD("VCD", "Void/Cancel Details") ,WBD("WBD", "Waybill Details") ,WBL("WBL", "Waybill Details") ,WBH("WBH", "Waybill Header Details") ,WBI("WBI", "Waybill Identification/Information"); public final String cargoImpCode; public final String description; DataElementGroupIdentifier(String cargoImpCode, String description) { this.cargoImpCode = cargoImpCode; this.description = description; } public static DataElementGroupIdentifier fromCargoImpCode(String cargoImpCode) { for (DataElementGroupIdentifier code : values()) { if (code.cargoImpCode.equals(cargoImpCode)) return code; } throw new IllegalArgumentException("No such cargo imp code: '"+cargoImpCode+"'"); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/DataQuality.java
package aero.champ.cargojson.common; public enum DataQuality { MISSING, SYNTHETIC, SUPPLIED, ; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/DensityGroup.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.stream.Stream; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Enumeration indicating approximate density of goods.") public enum DensityGroup { KG60_PER_CUBICMETRE(5), KG90_PER_CUBICMETRE(2), KG120_PER_CUBICMETRE(3), KG160_PER_CUBICMETRE(0), KG220_PER_CUBICMETRE(4), KG250_PER_CUBICMETRE(6), KG300_PER_CUBICMETRE(1), KG400_PER_CUBICMETRE(8), KG600_PER_CUBICMETRE(9), KG950_PER_CUBICMETRE(10), ; public final int cargoImpCode; DensityGroup(int cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static DensityGroup fromCargoImp(int cargoImpCode) { return Stream.of(values()).filter(v->v.cargoImpCode == cargoImpCode).findFirst().get(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/DimensionInfo.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; @JsonClassDescription("Dimensions information.") public class DimensionInfo { @JsonProperty(required = true) @JsonPropertyDescription("Length dimension.") @JsonDocExample("150") public Integer length; @JsonProperty(required = true) @JsonPropertyDescription("Width dimension.") @JsonDocExample("200") public Integer width; @JsonProperty(required = true) @JsonPropertyDescription("Height dimension.") @JsonDocExample("50") public Integer height; @JsonProperty(required = true) @JsonPropertyDescription("Number of loose items and/or ULDs as accepted for carriage.") @JsonDocExample("14") public Integer numberOfPieces; @JsonProperty(required = true) @JsonPropertyDescription("Measurement unit of the dimension values.") public LengthUnit measurementUnit; @JsonProperty(required = true) @JsonPropertyDescription("Weight details.") public Weight weight; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/Dimensions.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; @JsonClassDescription("Dimension details of shipped goods.") public class Dimensions { @JsonProperty(required = true) @JsonPropertyDescription("Measurement unit of the dimension values.") public final LengthUnit unit; @JsonProperty(required = true) @JsonPropertyDescription("Length value.") @JsonDocExample("200") public final int length; @JsonProperty(required = true) @JsonPropertyDescription("Width value.") @JsonDocExample("150") public final int width; @JsonProperty(required = true) @JsonPropertyDescription("Height value.") @JsonDocExample("100") public final int height; @JsonCreator public Dimensions( @JsonProperty(value = "unit", required = true) LengthUnit unit, @JsonProperty(value = "length", required = true) int length, @JsonProperty(value = "width", required = true) int width, @JsonProperty(value = "height", required = true) int height) { this.unit = unit; this.length = length; this.width = width; this.height = height; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/DiscrepancyCode.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Optional; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Coded representation of a discrepancy.") public enum DiscrepancyCode { FOUND_AIR_WAYBILL("FDAW"), FOUND_CARGO("FDCA"), MISSING_AIR_WAYBILL("MSAW"), MISSING_CARGO("MSCA","CPEB"), FOUND_MAIL_DOCUMENT("FDAV"), FOUND_MAILBAG("FDMB"), MISSING_MAIL_DOCUMENT("MSAV"), MISSING_MAILBAG("MSMB"), DEFINITELY_LOADED("DFLD"), OFFLOADED("OFLD"), OVERCARRIED("OVCD"), SHORTSHIPPED("SSPD"); public final String cargoImpCode; public final Optional<String> alternateCode; DiscrepancyCode(String cargoImpCode) { this.cargoImpCode = cargoImpCode; this.alternateCode = Optional.empty(); } DiscrepancyCode(String cargoImpCode, String alternateCode) { this.cargoImpCode = cargoImpCode; this.alternateCode = Optional.of(alternateCode); } public static DiscrepancyCode fromCargoImpCode(String cargoImpCode) { for (DiscrepancyCode code : values()) { if (code.cargoImpCode.equals(cargoImpCode)) return code; } throw new IllegalArgumentException("No such cargo imp code: '"+cargoImpCode+"'"); } public static Optional<DiscrepancyCode> optFromCargoImpCode(String cargoImpCode) { for (DiscrepancyCode code : values()) { if (code.cargoImpCode.equals(cargoImpCode)) return Optional.of(code); if (code.alternateCode.map(c->c.equals(cargoImpCode)).orElse(false)) { return Optional.of(code); } } return Optional.empty(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/EdifactMessageHeader.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Message header for Edifact data.") public class EdifactMessageHeader { @JsonPropertyDescription("Common access reference: Reference serving as a key to relate all subsequent " + "transfers of data to the same business case or file.") @JsonDocExample("10381") public Optional<String> commonAccessReference = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("Message reference number assigned by the message sender.") @JsonDocExample("ORDERS:D:94B:UN") public String messageReference; @JsonPropertyDescription("Recipient's reference password.") @JsonDocExample("test1234") public Optional<String> password = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("Uniquely identifying the interchange. Created by the interchange sender.") @JsonDocExample("abcde1234567") public String interchangeControlReference; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/Flight.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDate; import java.time.LocalTime; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Flight data.") public class Flight { @JsonProperty(required = true) @JsonPropertyDescription("Flight identity.") public FlightIdentity flight; @JsonProperty(required = true) @JsonPropertyDescription("Scheduled date of the flight.") public LocalDate scheduledDate; @JsonPropertyDescription("Scheduled time of the flight.") public Optional<LocalTime> scheduledTime = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/FlightDetails.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Flight details.") public class FlightDetails { @JsonProperty(required = true) @JsonPropertyDescription("Flight identification data.") public Flight flight; @JsonProperty(required = true) @JsonPropertyDescription("Origin and destination airports of the flight.") public OriginAndDestination originAndDestination; @JsonPropertyDescription("Space allocation code.") public Optional<SpaceAllocationCode> spaceAllocationCode = Optional.empty(); @JsonPropertyDescription("Allotment identification: Reference assigned to guaranteed capacity on one or " + "more specific flights on specific date(s) to third parties such as agents and other airlines.") @JsonDocExample("MRC7615164") public Optional<String> allotmentIdentification = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/FlightIdentity.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import javax.validation.ValidationException; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; @JsonClassDescription("Flight identification.") public class FlightIdentity implements Comparable<FlightIdentity> { static final Pattern FLIGHT_NUMBER_PATTERN = Pattern.compile("((?:[A-Z][A-Z]|[A-Z][0-9]|[0-9][A-Z]))([0-9]{1,4})([A-Z])?"); @JsonCreator public FlightIdentity( @javax.validation.constraints.Pattern(regexp = "(?:[A-Z][A-Z]|[A-Z][0-9]|[0-9][A-Z])[0-9]{1,4}[A-Z]?") String flightIdentification) { this.flightIdentification = normalize(flightIdentification); } private String normalize(String flightIdentification) { Matcher m = FLIGHT_NUMBER_PATTERN.matcher(flightIdentification); if (!m.matches()) throw new ValidationException("Flight identification '"+flightIdentification+"' invalid"); String g2 = m.group(2); if (g2.length() > 2) return flightIdentification; if (g2.length() == 1) return m.group(1)+"00"+g2+ Optional.ofNullable(m.group(3)).orElse(""); return m.group(1)+"0"+g2+ Optional.ofNullable(m.group(3)).orElse(""); } @JsonIgnore public final String flightIdentification; @JsonValue @JsonPropertyDescription("Flight identification string that matches the regular expression\n\"(?:[A-Z][A-Z]|[A-Z][0-9]|[0-9][A-Z])[0-9]{1,4}[A-Z]?\"") @JsonDocExample("LH116") public String value() { return flightIdentification; } @JsonIgnore public IATACarrierCode carrierCode() { return new IATACarrierCode(flightIdentification.substring(0,2)); } @JsonIgnore public String flightnumber() { return flightIdentification.substring(2); } @JsonIgnore public String flightnumberWithoutSuffix() { String fn = flightIdentification.substring(2); if (Character.isDigit(fn.charAt(fn.length()-1))) return fn; return fn.substring(0,fn.length()-1); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FlightIdentity that = (FlightIdentity) o; return flightIdentification.equals(that.flightIdentification); } @Override public int hashCode() { return flightIdentification.hashCode(); } @Override public int compareTo(FlightIdentity o) { return flightIdentification.compareTo(o.flightIdentification); } @Override public String toString() { return value(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/FlightNumber.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.constraints.Pattern; import java.util.Optional; import java.util.regex.Matcher; public class FlightNumber { @JsonIgnore public final String flightNumber; @JsonCreator public FlightNumber(@Pattern(regexp = "[0-9]{1,4}[A-Z]?") String flightNumber) { this.flightNumber = flightNumber; } @JsonValue @JsonDocExample("116") public String flightNumber() { return flightNumber; } static final java.util.regex.Pattern EXTRACT_FLIGHTNUMBER = java.util.regex.Pattern.compile("([0-9]+)"); public int flightNumberWithoutOperationalSuffix() { Matcher m = EXTRACT_FLIGHTNUMBER.matcher(flightNumber); if (m.find()) { return Integer.parseInt(m.group(1)); } throw new IllegalStateException("Flight number corrupted: '"+flightNumber+"'"); } static final java.util.regex.Pattern EXTRACT_SUFFIX = java.util.regex.Pattern.compile("[0-9]+([A-Z])"); public Optional<String> operationalSuffix() { Matcher m = EXTRACT_SUFFIX.matcher(flightNumber); if (m.find()) { return Optional.of(m.group(1)); } return Optional.empty(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/IATAAirportCode.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import javax.validation.constraints.Pattern; import java.util.Objects; @JsonClassDescription("Airport code in IATA format.") public class IATAAirportCode { @JsonIgnore public final String code; @JsonCreator public IATAAirportCode(@Pattern(regexp = "[a-zA-Z]{3}") String code) { this.code = code; } @JsonValue @JsonDocExample("FRA") @JsonPropertyDescription("Three letter IATA style airport code.") public String code() { return code; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IATAAirportCode that = (IATAAirportCode) o; return Objects.equals(code,that.code); } @Override public int hashCode() { return code.hashCode(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/IATACarrierCode.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import javax.validation.constraints.Pattern; @JsonClassDescription("Coded identification approved by IATA for a carrier.") public class IATACarrierCode { @JsonIgnore public final String code; @JsonCreator public IATACarrierCode(@Pattern(regexp = "(?:[A-Z][A-Z]|[A-Z][0-9]|[0-9][A-Z])") String code) { this.code = code; } @JsonValue @JsonPropertyDescription("Code matching the regular expression:\n(?:[A-Z][A-Z]|[A-Z][0-9]|[0-9][A-Z])") @JsonDocExample("BA") public String code() { return code; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ICAOCarrierCode.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import javax.validation.constraints.Pattern; @JsonClassDescription("ICAO coded identification for carriers") public class ICAOCarrierCode { @JsonIgnore public final String code; @JsonCreator public ICAOCarrierCode(@Pattern(regexp = "(?:[A-Z]{3})") String code) { this.code = code; } @JsonValue @JsonPropertyDescription("Code") @JsonDocExample("AFR") public String code() { return code; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ISOCountryCode.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import javax.validation.constraints.Pattern; @JsonClassDescription("Coded representation of a country approved by ISO.") public class ISOCountryCode { @JsonIgnore public final String code; @JsonCreator public ISOCountryCode(@Pattern(regexp = "[A-Z]{2}") String code) { this.code = code; } @JsonValue @JsonPropertyDescription("Two letter code with uppercase letters from A-Z") @JsonDocExample("US") public String code() { return code; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ISOCountryCode that = (ISOCountryCode) o; return code.equals(that.code); } @Override public int hashCode() { return code.hashCode(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/InterchangeType.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Enumeration for Cargo Canonical message interchange types.") public enum InterchangeType { AirWayBillDataRequest, AirWayBill, Cancellation, ErrorMessage, UNKNOWN, CustomsStatusNotification, FreightBookedList, SpaceAllocationRequest, SpaceAllocationAnswer, SpaceAllocationChange, FlightManifest, ConsolidationList, Acknowledgement, StatusRequest, StatusAnswer, StatusUpdate, RateInformationAnswer, ScheduleAndAvailabilityRequest, ScheduleAndAvailabilityAnswer, CCSFreeText, HouseWaybillData, ScheduleInformationRequest, HouweWaybillStatusRequest, HouseWaybillStatusAnswer, HouseWaybillStatusUpdate, AllotmentInformationRequest, AllotmentInformationAnswer, Defective, GenericRequest; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/LengthUnit.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.stream.Stream; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Measurement unit for dimension data.") public enum LengthUnit { CENTIMETRE("CMT") ,DECIMETRE("DMT") ,FOOT("FOT") ,INCH("INH") ,METRE("MTR") ,MILLIMETRE("MMT") ,YARD("YRD"); public final String cargoImpCode; LengthUnit(String cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static LengthUnit fromCargoImp(String cargoImpCode) { return Stream.of(values()).filter(v->v.cargoImpCode.equals(cargoImpCode)).findFirst().get(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/Message.java
package aero.champ.cargojson.common; import aero.champ.cargojson.airlineflightmanifest.AirlineFlightManifestMessage; import aero.champ.cargojson.airmail.AirmailRequestMessage; import aero.champ.cargojson.airwaybill.AirWayBillMessage; import aero.champ.cargojson.confirmationreceipt.ConfirmationReceiptMessage; import aero.champ.cargojson.consolidation.ConsolidationListMessage; import aero.champ.cargojson.consolidation.HouseWaybillMessage; import aero.champ.cargojson.flightstatus.FlightHistoryMessage; import aero.champ.cargojson.flightstatus.FlightStatusMessage; import aero.champ.cargojson.flightstatus.FlightStatusRequestMessage; import aero.champ.cargojson.jackson.DefaultObjectMapperBuilder; import aero.champ.cargojson.spaceallocation.SpaceAllocationAnswerMessage; import aero.champ.cargojson.spaceallocation.SpaceAllocationRequestMessage; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.Optional; import java.util.UUID; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = SpaceAllocationRequestMessage.class, name = "space allocation request"), @JsonSubTypes.Type(value = FlightStatusMessage.class, name = "flight status"), @JsonSubTypes.Type(value = FlightHistoryMessage.class, name = "flight history"), @JsonSubTypes.Type(value = AirWayBillMessage.class, name = "air waybill"), // TODO check, if this is the right place @JsonSubTypes.Type(value = HouseWaybillMessage.class, name = "house waybill"), @JsonSubTypes.Type(value = ConfirmationReceiptMessage.class, name = "confirmation receipt"), @JsonSubTypes.Type(value = SpaceAllocationAnswerMessage.class, name = "space allocation answer"), @JsonSubTypes.Type(value = FlightStatusRequestMessage.class, name = "flight status request"), @JsonSubTypes.Type(value = AirmailRequestMessage.class, name = "airmail request"), @JsonSubTypes.Type(value = ConsolidationListMessage.class, name = "consolidation list"), @JsonSubTypes.Type(value = AirlineFlightManifestMessage.class, name = "flight manifest") }) @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Cargo Canonical Message base type containing all fields that are common to " + "all Cargo Canonical business messages.") @JsonSerialize(typing = JsonSerialize.Typing.DYNAMIC) public abstract class Message<T> implements Serializable { private static final long serialVersionUID = 1l; @JsonProperty(required = true) @JsonPropertyDescription("Unique identification of the message.") public UUID id = UUID.randomUUID(); @JsonProperty(required = true) @JsonPropertyDescription("The message header.") public MessageHeader messageHeader = new MessageHeader(); @JsonUnwrapped @JsonPropertyDescription("The body of the message containing the business payload.") public T payload; public <V extends Message<?>> Optional<V> narrow(Class<V> clazz) { if (clazz.isAssignableFrom(getClass())) return Optional.<V>of((V)this); return Optional.empty(); } private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException { out.writeUTF(DefaultObjectMapperBuilder.globalMapper().writeValueAsString(this)); } private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException { String json = stream.readUTF(); Message<?> msg = DefaultObjectMapperBuilder.globalMapper().readValue(json,Message.class); this.payload = (T)msg.payload; this.messageHeader = msg.messageHeader; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/MessageHeader.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDateTime; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Message header of a Cargo Canonical Message.") public class MessageHeader { @JsonProperty(required = true) @JsonPropertyDescription("Addressing data.") public Addressing addressing = new Addressing(); @JsonProperty(required = true) @JsonPropertyDescription("Date and time of message creation.") public LocalDateTime creationDate = LocalDateTime.now(); @JsonPropertyDescription("Edifact data.") public Optional<EdifactMessageHeader> edifactData = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/MovementPriorityCode.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.stream.Stream; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Enumeration for movement priorities.") public enum MovementPriorityCode { CONSIGNMENT_UNDER_BOND("B") ,EXPRESS_PARCEL_SHIPMENT("E") ,EXRESS_SHIPMENT("X") ,HIGH("H") ,LOW("L") ,SERVICE_SHIPMENT("S"); ; public final String cargoImpCode; MovementPriorityCode(String cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static MovementPriorityCode fromCargoImp(String cargoImpCode) { return Stream.of(values()).filter(v->v.cargoImpCode.equals(cargoImpCode)).findFirst().get(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/OCI.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.validation.CargoImpPatterns; import aero.champ.cargojson.validation.ValidationContext; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; import java.util.regex.Pattern; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Other Customs, security and regulatory control Information.") public class OCI { public OCI(){} @JsonPropertyDescription("ISO Country Code.") public Optional<ISOCountryCode> isoCountryCode = Optional.empty(); @JsonPropertyDescription("Information identifier.") public Optional<DataElementGroupIdentifier> informationIdentifier = Optional.empty(); @JsonPropertyDescription("Customs, security and regulatory control information identifier.") public Optional<CustomsSecurityAndRegulatoryControlInformationIdentifier> controlInformation = Optional.empty(); @JsonPropertyDescription("Customs, security and regulatory control information identifier not contained in IATA CIMP Spec.") @JsonDocExample("D") public Optional<String> additionalControlInformation = Optional.empty(); @JsonPropertyDescription("Supplementary information identifying a party or a location related to customs, security " + "and regulatory control reporting requirements.") @JsonDocExample("BCBP123") public Optional<String> supplementaryControlInformation = Optional.empty(); static final Pattern SUPPLEMENTARY_CONTROL_INFORMATION_PATTERN = CargoImpPatterns.toPattern("t[...35]"); public void validateCargoImp(ValidationContext validationContext) { supplementaryControlInformation.ifPresent(i->{ validationContext.checkPattern(i,SUPPLEMENTARY_CONTROL_INFORMATION_PATTERN,"supplementaryControlInformation"); }); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OCI oci = (OCI) o; if (!isoCountryCode.equals(oci.isoCountryCode)) return false; if (!informationIdentifier.equals(oci.informationIdentifier)) return false; if (!controlInformation.equals(oci.controlInformation)) return false; return supplementaryControlInformation.equals(oci.supplementaryControlInformation); } @Override public int hashCode() { int result = isoCountryCode.hashCode(); result = 31 * result + informationIdentifier.hashCode(); result = 31 * result + controlInformation.hashCode(); result = 31 * result + supplementaryControlInformation.hashCode(); return result; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/OfficeMessageAddress.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; @JsonClassDescription("Office message address.") public class OfficeMessageAddress { @JsonProperty(required = true) @JsonPropertyDescription("Coded representation of a specific airport/city code.") @JsonDocExample("LHR") public String airportCityCode; @JsonProperty(required = true) @JsonPropertyDescription("Office function designator: Code identifying an office for addressing purposes.") @JsonDocExample("6F") public String officeFunctionDesignator; @JsonProperty(required = true) @JsonPropertyDescription("Company designator: Code identifying a company for addressing purposes.") @JsonDocExample("XB") public String companyDesignator; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/OriginAndDestination.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; @JsonClassDescription("Origin and destination airports of a shipment.") public class OriginAndDestination { @JsonCreator public OriginAndDestination( @JsonProperty(required = true, value = "origin") IATAAirportCode origin, @JsonProperty(required = true, value = "destination") IATAAirportCode destination) { this.origin = origin; this.destination = destination; } @JsonProperty(required = true) @JsonPropertyDescription("Airport code of origin airport.") public final IATAAirportCode origin; @JsonProperty(required = true) @JsonPropertyDescription("Airport code of destination airport.") public final IATAAirportCode destination; @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OriginAndDestination that = (OriginAndDestination) o; if (!origin.equals(that.origin)) return false; return destination.equals(that.destination); } @Override public int hashCode() { int result = origin.hashCode(); result = 31 * result + destination.hashCode(); return result; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/OtherChargeCode.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Other charge code: Code identifying the type of an individual charge.") public enum OtherChargeCode { UC("UC", "Adjusting of improperly loaded ULD") ,BA("BA", "Advances and/or guarantees") ,FA("FA", "Airport arrival") ,BB("BB", "Appraisal Service") ,DG("DG", "AWB Cancellation") ,DH("DH", "AWB Charges Correction Advice") ,BC("BC", "AWB Copy") ,AW("AW", "Air Waybill Fee") ,DI("DI", "AWB Re-waybilling") ,AC("AC", "Animal Container") ,AS("AS", "Assembly Service Fee") ,AT("AT", "Attendant") ,BR("BR", "Bank Release") ,BL("BL", "Blacklist Certificate") ,CA("CA", "Bonding") ,DC("DC", "Certificate of Origin") ,FC("FC", "Charges Collect Fee") ,LC("LC", "Cleaning") ,LI("LI", "Cleaning of stalls/pens") ,CD("CD", "Clearance and Handling — Destination") ,CH("CH", "Clearance and Handling — Origin") ,JA("JA", "Clearance, General") ,BE("BE", "Collection of funds") ,CB("CB", "Completion/preparation of documents") ,PB("PB", "Cool/Cold room, freezer (Perishables)") ,ZC("ZC", "Cool/Cold room, freezer (Storage)") ,BF("BF", "Copies of documents") ,RA("RA", "Dangerous Goods Fee") ,SA("SA", "Delivery") ,SB("SB", "Delivery notification") ,SF("SF", "Delivery Order") ,UD("UD", "Demurrage") ,GA("GA", "Diplomatic consignment") ,UB("UB", "Disassembly") ,DB("DB", "Disbursement Fee") ,DF("DF", "Distribution Service Fee") ,FB("FB", "Domestic shipments") ,CG("CG", "Electronic processing or transmission of data for customs purposes") ,CE("CE", "Export/Import warrant") ,MY("MY", "Fuel Surcharge — Due Issuing Carrier") ,FE("FE", "General (Handling)") ,ZB("ZB", "General (Storage)") ,TX("TX", "General Taxes") ,GT("GT", "Government Tax") ,EA("EA", "Handling (Express)") ,KA("KA", "Handling (Heavy/Bulky cargo)") ,PA("PA", "Handling (Perishables)") ,UH("UH", "Handling (Unit Load Device)") ,VA("VA", "Handling (Valuable Cargo)") ,WA("WA", "Handling (Vulnerable cargo)") ,LE("LE", "Hotel") ,HR("HR", "Human Remains") ,BI("BI", "Import/export documents processing") ,CF("CF", "Inventory and/or inspection") ,IN("IN", "Insurance Premium") ,UE("UE", "Leasing") ,FF("FF", "Loading/unloading") ,KB("KB", "Loading/unloading equipment (forklift etc.)") ,LA("LA", "Live Animals") ,CC("CC", "Manual data entry for customs purposes") ,BH("BH", "Messenger service") ,MA("MA", "Miscellaneous — Due Agent (see)") ,MC("MC", "Miscellaneous — Due Carrier (see)") ,MO("MO", "Miscellaneous — Due Issuing Carrier") ,MP("MP", "Miscellaneous — Due Issuing Carrier") ,MQ("MQ", "Miscellaneous — Due Issuing Carrier") ,MR("MR", "Miscellaneous — Due Issuing Carrier") ,MS("MS", "Miscellaneous — Due Issuing Carrier") ,MT("MT", "Miscellaneous — Due Issuing Carrier") ,MU("MU", "Miscellaneous — Due Issuing Carrier") ,MV("MV", "Miscellaneous — Due Issuing Carrier") ,MW("MW", "Miscellaneous — Due Issuing Carrier") ,MX("MX", "Miscellaneous — Due Issuing Carrier") ,MZ("MZ", "Miscellaneous — Due Issuing Carrier") ,MD("MD", "Miscellaneous — Due Last Carrier") ,ME("ME", "Miscellaneous — Due Last Carrier") ,MF("MF", "Miscellaneous — Due Last Carrier") ,MG("MG", "Miscellaneous — Due Last Carrier") ,MH("MH", "Miscellaneous — Due Last Carrier") ,MI("MI", "Miscellaneous — Due Last Carrier") ,MJ("MJ", "Miscellaneous — Due Last Carrier") ,MK("MK", "Miscellaneous — Due Last Carrier") ,ML("ML", "Miscellaneous — Due Last Carrier") ,MM("MM", "Miscellaneous — Due Last Carrier") ,MN("MN", "Miscellaneous — Due Last Carrier") ,MB("MB", "Miscellaneous — Unassigned (see)") ,HB("HB", "Mortuary") ,NS("NS", "Navigation Surcharge — Due Issuing Carrier") ,CI("CI", "Overtime and Other Customs Imposed Charges") ,PK("PK", "Packing/Repacking") ,PU("PU", "Pick-Up") ,TA("TA", "Postal Tax") ,DD("DD", "Preparation of Cargo manifest") ,FD("FD", "Priority") ,DJ("DJ", "Proof of delivery (documentation)") ,SE("SE", "Proof of delivery (pickup and delivery)") ,LF("LF", "Quarantine") ,RD("RD", "Radio-active room") ,UF("UF", "Recontouring") ,RC("RC", "Referral of Charge") ,RB("RB", "Rejection") ,DK("DK", "Release order") ,RF("RF", "Remit Following Collection Fee") ,CJ("CJ", "Removal (carrierCode warehouse to warehouse)") ,LJ("LJ", "Rental of Stalls/pens") ,ZA("ZA", "Re-warehousing") ,TB("TB", "Sales Tax") ,VB("VB", "Security (armed guard/escort) handling") ,SC("SC", "Security Charge") ,XB("XB", "Security (Surcharge/premiums)") ,SP("SP", "Separate Early Release") ,SS("SS", "Signature Service") ,TC("TC", "Stamp Tax") ,ST("ST", "State Sales Tax") ,TD("TD", "State Tax") ,TE("TE", "Statistical Tax") ,SI("SI", "Stop in Transit") ,SR("SR", "Storage — Destination") ,LH("LH", "Storage (Live animals)") ,SO("SO", "Storage — Origin") ,VC("VC", "Strongroom") ,SD("SD", "Surface Charge — Destination") ,SU("SU", "Surface Charge — Origin") ,XC("XC", "Time") ,TR("TR", "Transit") ,UG("UG", "Unloading (Unit Load Device)") ,TV("TV", "Value Added Tax (General or for Export)") ,TI("TI", "Value Added Tax (For Import only)") ,IA("IA", "Very important cargo (VIC)") ,DV("DV", "Veterinary and/or Phytosanitary purposes") ,LG("LG", "Veterinary inspection") ,XD("XD", "War risk") ,FI("FI", "Weighing") ,XE("XE", "Weight") ,BM("BM", "Withdrawal of shipment after clearance"); public final String cargoImpCode; public final String description; OtherChargeCode(String cargoImpCode, String description) { this.cargoImpCode = cargoImpCode; this.description = description; } public static OtherChargeCode fromCargoImpCode(String code) { for (OtherChargeCode c : values()) { if (c.cargoImpCode.equals(code)) return c; } return null; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/OtherServiceInformation.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonProperty; public class OtherServiceInformation { @JsonProperty(required = true) public String osi_1; public String osi_2; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ParticipantAddress.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import java.util.regex.Pattern; @JsonClassDescription("Address of a participant in Cargo Canonical message handling.") public class ParticipantAddress { @JsonProperty(required = true) @JsonPropertyDescription("Participant address type.") @JsonDocExample("PIMA") public final ParticipantAddressType type; @JsonProperty(required = true) @JsonPropertyDescription("The address.") @JsonDocExample("REUAIR08AAL") public final String address; @JsonCreator public ParticipantAddress(@JsonProperty("type") ParticipantAddressType type, @JsonProperty("address") String address) { this.type = type; this.address = address; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ParticipantAddress address1 = (ParticipantAddress) o; if (type != address1.type) return false; return address.equals(address1.address); } @Override public int hashCode() { int result = type.hashCode(); result = 31 * result + address.hashCode(); return result; } @Override public String toString() { return type+":"+address; } static final Pattern PIMA_PATTERN= Pattern.compile("[A-Z0-9]{9,29}(?:/[A-Z0-9]{4,5})?"); static final Pattern TTY_PATTERN= Pattern.compile("[A-Z0-9]{7}"); static final Pattern CC3N_PATTERN= Pattern.compile("[0-9]{3}"); static final Pattern IATA_CC_PATTERN= Pattern.compile("[A-Z0-9]{2}"); @JsonIgnore public boolean isValid() { if (type == null || address == null) return false; switch (type) { case PIMA: return PIMA_PATTERN.matcher(address).matches(); case TTY: return TTY_PATTERN.matcher(address).matches(); case CARRIER_CODE_3N: return CC3N_PATTERN.matcher(address).matches(); case IATA_CARRIER_CODE: return IATA_CC_PATTERN.matcher(address).matches(); default: return false; } } public boolean isPrefixOf(ParticipantAddress other) { if (type != ParticipantAddressType.PIMA || other.type != ParticipantAddressType.PIMA) return false; return other.address.length() > address.length() && other.address.startsWith(address); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ParticipantAddressType.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Enumeration for the type of address of a participant in Cargo Canonical message handling.") public enum ParticipantAddressType { PIMA, TTY, CARRIER_CODE_3N, IATA_CARRIER_CODE, EMAIL, WEBSITE, UNNKOWN, ; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ParticipantCode.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import javax.validation.constraints.Pattern; public class ParticipantCode { @JsonProperty(required = true) @JsonPropertyDescription("Type of participant involved in the movement of a shipment.") public final ParticipantType type; @JsonProperty(required = true) @JsonPropertyDescription("Participant code: Coded identification of a participant involved in the movement of a shipment.") @Pattern(regexp = "(?:.{1,17})") @JsonDocExample("98764") public final String code; @JsonCreator public ParticipantCode(@JsonProperty("type") ParticipantType type, @JsonProperty("code") @Pattern(regexp = "(?:.{1,17})") String code) { this.type = type; this.code = code; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ParticipantIdentifier.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; @JsonClassDescription("Participant identification.") public class ParticipantIdentifier { @JsonProperty(required = true) @JsonPropertyDescription("Type of participant involved in the movement of a shipment.") public ParticipantType identifier; @JsonProperty(required = true) @JsonPropertyDescription("Participant code: Coded identification of a participant involved in the movement of a shipment.") @JsonDocExample("98764") public String code; @JsonProperty(required = true) @JsonPropertyDescription("Coded representation of a specific airport/city code.") @JsonDocExample("LHR") public String airportCityCode; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ParticipantType.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.stream.Stream; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Enumeration for participant type.") public enum ParticipantType { AIR("AIR", "Airline"), APT("APT", "Airport Authority"), AGT("AGT", "Agent"), BRK("BRK", "Broker"), CAG("CAG", "Commission Agent"), CNE("CNE", "Consignee"), CTM("CTM", "Customs"), DCL("DCL", "Declarant"), DEC("DEC", "Deconsolidator"), FFW("FFW", "Freight Forwarder"), GHA("GHA", "Ground Handling Agent"), PTT("PTT", "Post Office"), SHP("SHP", "Shipper"), TRK("TRK", "Trucker"); public final String cargoImpCode; public final String description; ParticipantType(String cargoImpCode, String description) { this.cargoImpCode = cargoImpCode; this.description = description; } public static ParticipantType fromCargoImpCode(String cargoImpCode) { return Stream.of(values()).filter(v -> v.cargoImpCode.equals(cargoImpCode)).findFirst().get(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/PaymentCondition.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Prepaid/Collect indicator: Code indicating whether payment will be made at origin (prepaid) or at destination (collect).") public enum PaymentCondition { Collect("C"), Prepaid("P"); public final String cargoImpCode; PaymentCondition(String code) { this.cargoImpCode = code; } public static PaymentCondition fromCargoImpCode(String code) { return Collect.cargoImpCode.equals(code) ? Collect : Prepaid.cargoImpCode.equals(code) ? Prepaid : null; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ProductInformation.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Product information.") public class ProductInformation { @JsonProperty(required = true) @JsonPropertyDescription("Service code.") public ServiceCode serviceCode; @JsonPropertyDescription("Rate class code.") public Optional<RateClassCode> rateClassCode = Optional.empty(); @JsonPropertyDescription("Commodity item number: Number to identify a specific commodity.") @JsonDocExample("9017") public Optional<String> commodityItemNumber = Optional.empty(); @JsonPropertyDescription("ULD rate class type: Coded description of a Unit Load Device rate class.") @JsonDocExample("8") public Optional<String> uldRateClassType = Optional.empty(); @JsonPropertyDescription("Basis rate class code.") public Optional<RateClassCode> rateClassCodeBasis = Optional.empty(); @JsonPropertyDescription("Class rate percentage A surcharge or discount percentage applied to an applicable rate or charge.") @JsonDocExample("67") public Optional<Integer> classRatePercentage = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/Quantity.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import java.math.BigInteger; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Quantity details of a shipment.") public class Quantity { @JsonProperty(required = true) @JsonPropertyDescription("Shipment description code.") public final ShipmentDescriptionCode shipmentDescriptionCode; @JsonProperty(required = true) @JsonPropertyDescription("Number of loose items and/or ULDs as accepted for carriage.") @JsonDocExample("8") public final BigInteger numberOfPieces; @JsonPropertyDescription("Weight of the cargo.") public final Optional<Weight> weight; @JsonCreator public Quantity(@JsonProperty(required = true, value = "shipmentDescriptionCode") ShipmentDescriptionCode shipmentDescriptionCode, @JsonProperty(required = true, value = "numberOfPieces") BigInteger numberOfPieces, @JsonProperty(value = "weight") Optional<Weight> weight) { this.shipmentDescriptionCode = Optional.ofNullable(shipmentDescriptionCode).orElse(ShipmentDescriptionCode.TOTAL_CONSIGNMENT); this.numberOfPieces = numberOfPieces; this.weight = Optional.ofNullable(weight).orElse(Optional.empty()); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Quantity quantity = (Quantity) o; if (shipmentDescriptionCode != quantity.shipmentDescriptionCode) return false; if (!numberOfPieces.equals(quantity.numberOfPieces)) return false; return weight.equals(quantity.weight); } @Override public int hashCode() { int result = shipmentDescriptionCode.hashCode(); result = 31 * result + numberOfPieces.hashCode(); result = 31 * result + weight.hashCode(); return result; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/RateClassCode.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Optional; import java.util.stream.Stream; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Code representing a specific rate category.") public enum RateClassCode { BASIC_CHARGE("B", "6") ,CLASS_RATE_REDUCTION("R", null) ,CLASS_RATE_SURCHARGE("S", null) ,INTERNATIONAL_PRIORITY_SERVICE_RATE("P", null) ,MINIMUM_CHARGE("M", "8") ,NORMAL_RATE("N", "9") ,QUANTITY_RATE("Q", "10") ,RATE_PER_KILOGRAM("K", "7") ,SPECIFIC_COMMODITY_RATE("C", null) ,UNIT_LOAD_DEVICE_ADDITIONAL_INFORMATION("X", null) ,UNIT_LOAD_DEVICE_ADDITIONAL_RATE("E", null) ,UNIT_LOAD_DEVIDE_BASIC_CHARGE_OR_RATE("U", null) ,UNIT_LOAD_DEVICE_DISCOUNT("Y", null) ; public final String cargoImpCode; private final String cargoFactCode; public Optional<String> cargoFactCode() { return Optional.ofNullable(cargoFactCode); } RateClassCode(String cargoImpCode, String cargoFactCode) { this.cargoImpCode = cargoImpCode; this.cargoFactCode = cargoFactCode; } public static RateClassCode fromCargoImp(String cargoImpCode) { return Stream.of(values()).filter(v->v.cargoImpCode.equals(cargoImpCode)).findFirst().get(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ReferenceInfo.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("General multi-purpose reference information.") public class ReferenceInfo { @JsonPropertyDescription("Office message address.") public Optional<OfficeMessageAddress> officeMessageAddress = Optional.empty(); @JsonPropertyDescription("File reference: A reference used to identify a specific booking or file.") @JsonDocExample("123456") public Optional<String> fileReference = Optional.empty(); @JsonPropertyDescription("Participant identification ") public Optional<ParticipantIdentifier> participantIdentifier = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/Routing.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonClassDescription("Routing data. At least one of the fields must be set.") public class Routing { @JsonPropertyDescription("Carrier code") public final Optional<IATACarrierCode> carrierCode; @JsonPropertyDescription("Destination (airport/city code)") public final Optional<IATAAirportCode> destination; @JsonCreator public Routing(@JsonProperty("carrierCode") Optional<IATACarrierCode> carrierCode, @JsonProperty("destination") Optional<IATAAirportCode> destination) { this.carrierCode = carrierCode; this.destination = destination; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ServiceCode.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Service code to identify cargo products.") public enum ServiceCode { AIRPORT_TO_AIRPORT("A"), SERVICE_SHIPMENT("B"), COMPANY_MATERIAL("C"), DOOR_TO_DOOR_SERVICE("D"), AIRPORT_TO_DOOR("E"), FLIGHT_SPECIFIC("F"), DOOR_TO_AIRPORT("G"), COMPANY_MAIL("H"), DIPLOMATIC_MAIL("I"), PRIORITY_SERVICE("J"), UNDOCUMENTED_K("K"), UNDOCUMENTED_L("L"), UNDOCUMENTED_M("M"), UNDOCUMENTED_N("N"), UNDOCUMENTED_O("O"), SMALL_PACKAGE_SERVICE("P"), UNDOCUMENTED_Q("Q"), UNDOCUMENTED_R("R"), SUBSTITUTE_TRUCK("S"), CHARTER("T"), UNDOCUMENTED_U("U"), UNDOCUMENTED_V("V"), UNDOCUMENTED_W("W"), EXPRESS_SHIPMENTS("X"), UNDOCUMENTED_Y("Y"), UNDOCUMENTED_Z("Z"), ; public final String cargoImpCode; ServiceCode(String cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static ServiceCode fromCargoImpCode(String code) { for (ServiceCode c : values()) { if (c.cargoImpCode.equals(code)) return c; } return null; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ShipmentDescriptionCode.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.stream.Stream; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Enumeration of codes indicating whether a shipment is a total, part or split consignment.") public enum ShipmentDescriptionCode { DIVIDED_CONSIGNMENT("D") ,MULTI_SHIPMENTS("M") ,PART_CONSIGNMENT("P") ,SPLIT_CONSIGMENT("S") ,TOTAL_CONSIGNMENT("T"); public final String cargoImpCode; ShipmentDescriptionCode(String cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static ShipmentDescriptionCode fromCargoImp(String cargoImpCode) { return Stream.of(values()).filter(v->v.cargoImpCode.equals(cargoImpCode)).findFirst().get(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ShipmentReferenceInfo.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Shipment reference information.") public class ShipmentReferenceInfo { @JsonPropertyDescription("Reference number allocated to a consignment as per shipper/agent/issuing carrier agreement.") @JsonDocExample("ABCD-12345") public Optional<String> referenceNumber = Optional.empty(); @JsonPropertyDescription("Additional shipment information that supplements the reference number.") @JsonDocExample("COMPANY MAT") public Optional<String> info = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/SpaceAllocationCode.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Space Allocation Code: Coded indication of the action requested, taken or confirmed related to space allocation.") public enum SpaceAllocationCode { XX("XX", "Cancel Any Previous Space Allocatiomn"), SS("SS", "Reporting Sale"), NA("NA", "Requesting Space Allocation, if Not Available Will Accept Alternative"), NL("NL", "Requesting Space Allocation, for Wait List"), NN("NN", "Requesting Space Allocation, Will Not Accept Alternative"), CA("CA", "Selling Space Allocation Against Allotment"), CN("CN", "Cancellation Noted"), KK("KK", "Confirming"), UU("UU", "Unable"), UN("UN", "Unable, Flight Does Not Operate"), LL("LL", "Wait List"), HN("HN", "Have Requested Space Allocation"), HK("HK", "Holding Confirmed"), HL("HL", "Holding Wait List"); public final String cargoImpCode; public final String description; SpaceAllocationCode(String cargoImpCode, String description) { this.cargoImpCode = cargoImpCode; this.description = description; } public static SpaceAllocationCode fromCargoImpCode(String code) { for (SpaceAllocationCode c : values()) { if (c.cargoImpCode.equals(code)) return c; } return null; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/SpecialHandlingAndDangerousGoodsCode.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Enumeration of codes for special handling and dangerous goods.") public enum SpecialHandlingAndDangerousGoodsCode { ACT("Active Temperature Controlled System"), AOG("Aircraft on Ground"), BUP("Bulk Unitization Programme, Shipper/Consignee Handled Unit"), CAO("Cargo Aircraft Only"), CAT("Cargo Attendant Accompanying Shipment"), NSC("Cargo Has Not Been Secured Yet for Passenger or All-Cargo Aircraft"), SHR("Secure for Passenger, All-Cargo and All-Mail Aircraft in Accordance with High Risk Requirements"), COM("Company Mail"), ECP("Consignment established with a paper air waybill contract being printed under an e-AWB agreement"), ECC("Consignment established with an electronically concluded cargo contract with no accompanying paper airwaybill"), CRT("Control Room Temperature +15°C to +25°C"), COL("Cool Goods"), RDS("Diagnostic Specimens"), DIP("Diplomatic Mail"), EAP("e-freight Consignment with Accompanying Paper Documents"), EAW("e-freight Consignment with No Accompanying Paper Documents"), REQ("Excepted Quantities of Dangerous Goods"), RRE("Excepted Quantities of Radioactive Material"), PES("Fish/Seafood"), PEF("Flowers"), EAT("Foodstuffs"), FRI("Frozen Goods Subject to Veterinary/Phytosanitary Inspections"), FRO("Frozen Goods"), PEP("Fruits and Vegetables"), ATT("Goods Attached to Air Waybill"), GOH("Hanging Garments"), HEG("Hatching Eggs"), HEA("Heavy Cargo/150 kilograms and over per piece"), HUM("Human Remains in Coffin"), PEA("Hunting trophies, skin, hide and all articles made from or containing parts of species listed in the CITES (Convention on International Trade in Endangered Species) appendices"), SCO("Cargo Secure forAll-Cargo Aircraft Only"), SPF("Laboratory Animals"), SPX("Cargo Secure for Passenger and All-Cargo Aircraft"), LIC("License Required"), AVI("Live Animal"), LHO("Living Human Organs/Blood"), MAL("Mail"), PEM("Meat"), MUW("Munitions of War"), NWP("Newspapers, Magazines"), OBX("Obnoxious Cargo"), BIG("Outsized"), OHG("Overhang Item"), PAC("Passenger and Cargo"), PER("Perishable Cargo"), PIL("Pharmaceuticals"), XPS("Priority Small Package"), QRT("Quick Ramp Transfer"), RAC("Reserved Air Cargo"), SHL("Save Human Life"), WET("Shipments of Wet Material not Packed in Watertight Containers"), SWP("Sporting Weapons"), SUR("Surface Transportation"), FIL("Undeveloped/Unexposed Film"), VAL("Valuable Cargo"), VIC("Very Important Cargo"), VOL("Volume"), VUN("Vulnerable Cargo"), PEB("Animal products for non-human consumption"), PHY("Goods subject to phytosanitary inspections"), VAG("SWISS Air Volume Agreement"), FSA("KLM FSA Code"), XPH("KLM XPH Code"), AER("KLM AER Code"), VIP("KLM VIP Code"), UCB("KLM UCB Code"), XPU("KLM XPU Code"), MON("KLM MON Code"), PEV("KLM PEV Code"), ART("KLM ART Code"), BSD("LH BSD Code"), BPL("LH BPL Code"), CSL("LH CSL Code"), DGR("LH DGR Code"), NOS("LH NOS Code"), PPL("LH PPL Code"), SEC("LH SEC Code"), SMU("LH SMU Code"), ZXF("LH ZXF Code"), ZXO("LH ZXO Code") ,ELI("Lithium Ion Batteries otherwise excepted from the IATA DGR", true) ,ELM("Lithium Metal Batteries otherwise excepted from the IATA DGR", true) ,RCM("Corrosive", true) ,RCL("Cryogenic Liquids", true) ,RFW("Dangerous When Wet", true) ,ICE("Dry Ice", true) ,REX("To be reserved for normally forbidden Explosives, Divisions 1.1, 1.2, 1.3, 1.4F, 1.5 and 1.6", true) ,RCX("Explosives 1.3C", true) ,RGX("Explosives 1.3G", true) ,RLI("Fully Regulated Lithium Ion Batteries (Class 9, true)", true) ,RLM("Fully Regulated Lithium Metal Batteries (Class 9, true)", true) ,RXB("Explosives 1.4B", true) ,RXC("Explosives 1.4C", true) ,RXD("Explosives 1.4D", true) ,RXE("Explosives 1.4E", true) ,RXG("Explosives 1.4G", true) ,RXS("Explosives 1.4S", true) ,RFG("Flammable Gas", true) ,RFL("Flammable Liquid", true) ,RFS("Flammable Solid", true) ,RIS("Infectious Substance", true) ,MAG("Magnetized Material", true) ,RMD("Miscellaneous Dangerous Goods", true) ,RNG("Non-Flammable Non-Toxic Gas", true) ,ROP("Organic Peroxide", true) ,ROX("Oxidizer", true) ,RPB("Toxic Substance", true) ,RPG("Toxic Gas", true) ,RSB("Polymeric Beads", true) ,RRW("Radioactive Material Category I-White", true) ,RRY("Radioactive Material Categories II-Yellow and III-Yellow", true) ,RSC("Spontaneously Combustible", true); public final String description; public final boolean isDangerousGoodsCode; SpecialHandlingAndDangerousGoodsCode(String decription) { this(decription,false); } SpecialHandlingAndDangerousGoodsCode(String decription, boolean isDangerousGoodsCode) { this.description = decription; this.isDangerousGoodsCode = isDangerousGoodsCode; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/TeleContact.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonProperty; public class TeleContact { @JsonProperty(required = true) public TeleContactType teleContactType; @JsonProperty(required = true) public String address; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/TeleContactType.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonFormat; @JsonFormat(shape = JsonFormat.Shape.STRING) public enum TeleContactType { TELEPHONE, TELEFAX, TELEX, EMAIL, ; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/TimeInformation.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.LocalDateTime; public class TimeInformation { public TimeInformation( @JsonProperty(required = true, value = "typeOfTime") TypeOfTimeIndicator typeOfTime, @JsonProperty(required = true, value = "time") LocalDateTime time) { this.typeOfTime = typeOfTime; this.time = time; } @JsonProperty(required = true) public final TypeOfTimeIndicator typeOfTime; @JsonProperty(required = true) public final LocalDateTime time; public TimeInformation plusDays(int days) { return new TimeInformation(typeOfTime,time.plusDays(days)); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/TransferManifestNumber.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import javax.validation.constraints.Pattern; @JsonClassDescription("Transfer manifest number: Identification number allocated to each transfer manifest or substitute flight manifest.") public class TransferManifestNumber { @JsonIgnore public final String number; @JsonCreator public TransferManifestNumber(@Pattern(regexp = "[0-9]{1,6}") String number) { this.number = number; } @JsonValue @JsonPropertyDescription("Value of the transfer manifest number.") @JsonDocExample("123456") public String number() { return number; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/TypeOfTimeIndicator.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.stream.Stream; @JsonFormat(shape = JsonFormat.Shape.STRING) public enum TypeOfTimeIndicator { ACTUAL("A"), ESTIMATED("E"), SCHEDULED("S"), DLH_L("L"), DLH_D("D"), DLH_T("T"), DLH_N("N"); public final String cargoImpCode; TypeOfTimeIndicator(String cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static TypeOfTimeIndicator fromCargoImp(String cargoImpCode) { return Stream.of(values()).filter(v->v.cargoImpCode.equals(cargoImpCode)).findFirst().get(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ULD.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import javax.validation.constraints.Pattern; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Unit Load Device (ULD).") public class ULD { @JsonProperty(required = true) @Pattern(regexp = "[A-Z][A-Z0-9]{2}") @JsonPropertyDescription("Code identifying a standard Unit Load Device type.\n" + "Must match regular expression '[A-Z][A-Z0-9]{2}'.") @JsonDocExample("ASE") public String type; @JsonProperty(required = true) @Pattern(regexp = "[A-Z0-9][0-9]{3,4}") @JsonPropertyDescription("Serial number allocated to each Unit Load Device by its owner.\n" + "Must match regular expression '[A-Z0-9][0-9]{3,4}'.") @JsonDocExample("1234") public String serialNumber; @JsonProperty(required = true) @Pattern(regexp = "[A-Z0-9]{2}") @JsonPropertyDescription("Code to identify the owner of a Unit Load Device.\n" + "Must match regular expression '[A-Z0-9]{2}'.") @JsonDocExample("TW") public String ownerCode; @JsonPropertyDescription("ULD loading indicator.") public Optional<ULDLoadingIndicator> loadingIndicator = Optional.empty(); @JsonPropertyDescription("Information related to a specific Unit Load Device") @JsonDocExample("Do not load via nose door.") public Optional<String> remarks = Optional.empty(); @JsonPropertyDescription("Weight of the ULD contents.") public Optional<Weight> weightOfULDContents = Optional.empty(); @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ULD uld = (ULD) o; if (!type.equals(uld.type)) return false; if (!serialNumber.equals(uld.serialNumber)) return false; if (!ownerCode.equals(uld.ownerCode)) return false; if (!loadingIndicator.equals(uld.loadingIndicator)) return false; if (!remarks.equals(uld.remarks)) return false; return weightOfULDContents.equals(uld.weightOfULDContents); } @Override public int hashCode() { int result = type.hashCode(); result = 31 * result + serialNumber.hashCode(); result = 31 * result + ownerCode.hashCode(); result = 31 * result + loadingIndicator.hashCode(); result = 31 * result + remarks.hashCode(); result = 31 * result + weightOfULDContents.hashCode(); return result; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/ULDLoadingIndicator.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("ULD Loading Indicator: Code indicating ULD height or loading limitation.") public enum ULDLoadingIndicator { MAIN_DECK_LOADING_ONLY("M") ,NOSE_DOOR_LOADING_ONLY("N") ,ULD_HEIGHT_BELOW_160_CENTIMETRES("L") ,ULD_HEIGHT_BELOW_160_AND_244_CENTIMETRES("U") ,ULD_HEIGHT_ABOVE_244_CENTIMETRES("R"); public final String cargoImpCode; ULDLoadingIndicator(String cargoImpCode) { this.cargoImpCode = cargoImpCode; } public static ULDLoadingIndicator fromCargoImpCode(String cargoImpCode) { for (ULDLoadingIndicator code : values()) { if (code.cargoImpCode.equals(cargoImpCode)) return code; } throw new IllegalArgumentException("No such cargo imp code: '"+cargoImpCode+"'"); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/Volume.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.math.BigDecimal; @JsonClassDescription("This structure holds the volume data of a shipment.") public class Volume { @JsonCreator public Volume(@JsonProperty(required = true, value = "amount") BigDecimal amount, @JsonProperty(required = true, value = "unit") VolumeUnit unit) { this.amount = amount; this.unit = unit; } @JsonProperty(required = true) @JsonPropertyDescription("Amount of volume units.") @JsonDocExample("250") public final BigDecimal amount; @JsonProperty(required = true) @JsonPropertyDescription("Unit of the reported volume amount.") public final VolumeUnit unit; @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Volume volume = (Volume) o; if (!amount.stripTrailingZeros().equals(volume.amount.stripTrailingZeros())) return false; return unit == volume.unit; } @Override public int hashCode() { int result = amount.stripTrailingZeros().hashCode(); result = 31 * result + unit.hashCode(); return result; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/VolumeUnit.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.stream.Stream; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Enumeration for volume units.") public enum VolumeUnit { CUBIC_CENTIMETRE("CC","CMQ"), CUBIC_FOOT("CF","FTQ"), CUBIC_INCH("CI","INQ"), CUBIC_METRE("MC","MTQ"), ; public final String cargoImpCode; public final String cargoFactCode; VolumeUnit(String cargoImpCode, String cargoFactCode) { this.cargoImpCode = cargoImpCode; this.cargoFactCode = cargoFactCode; } public static VolumeUnit fromCargoImp(String cargoImpCode) { return Stream.of(values()).filter(v->v.cargoImpCode.equals(cargoImpCode)).findFirst().get(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/Weight.java
package aero.champ.cargojson.common; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.math.BigDecimal; @JsonClassDescription("This structure holds the weight data of a shipment.") public class Weight { @JsonCreator public Weight(@JsonProperty(required = true, value = "amount") BigDecimal amount, @JsonProperty(required = true, value = "unit") WeightUnit unit) { this.amount = amount; this.unit = unit; } @JsonProperty(required = true) @JsonPropertyDescription("Amount of weight units.") @JsonDocExample("100") public final BigDecimal amount; @JsonProperty(required = true) @JsonPropertyDescription("Unit of the reported weight amount.") public final WeightUnit unit; @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Weight weight = (Weight) o; if (amount.stripTrailingZeros().compareTo(weight.amount.stripTrailingZeros()) != 0) return false; return unit == weight.unit; } @Override public int hashCode() { int result = amount.stripTrailingZeros().hashCode(); result = 31 * result + unit.hashCode(); return result; } public Weight convert(WeightUnit target) { if (target == unit) return this; BigDecimal newValue = amount.multiply(unit.kilogramEquivalent) .divide(target.kilogramEquivalent, 10, BigDecimal.ROUND_HALF_DOWN).setScale(3, BigDecimal.ROUND_HALF_DOWN).stripTrailingZeros(); return new Weight(newValue, target); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/common/WeightUnit.java
package aero.champ.cargojson.common; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonFormat; import java.math.BigDecimal; import java.util.stream.Stream; @JsonFormat(shape = JsonFormat.Shape.STRING) @JsonClassDescription("Enumeration for weight units.") public enum WeightUnit { KILOGRAM("K","KGM", BigDecimal.ONE), POUND("L","LBR", BigDecimal.valueOf(0.45359233).setScale(8,BigDecimal.ROUND_HALF_DOWN)), ; public final String cargoImpCode; public final String cargoFactCode; public final BigDecimal kilogramEquivalent; WeightUnit(String cargoImpCode, String cargoFactCode, BigDecimal kilogramEquivalent) { this.cargoImpCode = cargoImpCode; this.cargoFactCode = cargoFactCode; this.kilogramEquivalent = kilogramEquivalent; } public static WeightUnit fromCargoImp(String cargoImpCode) { return Stream.of(values()).filter(v->v.cargoImpCode.equals(cargoImpCode)).findFirst().get(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/confirmationreceipt/ConfirmationReceipt.java
package aero.champ.cargojson.confirmationreceipt; import aero.champ.cargojson.common.AirWaybillNumber; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.common.InterchangeType; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.*; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This type is used to acknowledge the receipt of a message in the case when an " + "automatic response is not immediately possible or an error has occurred. Corresponds to CIMP " + "message types FMA and FNA.") public class ConfirmationReceipt { @JsonPropertyDescription("Interchange type of the original message.") public Optional<InterchangeType> referencedMessageType = Optional.empty(); @JsonPropertyDescription("Air waybill number of the original message.") public Optional<AirWaybillNumber> airWaybillNumber = Optional.empty(); @JsonPropertyDescription("Origin airport code of the original message.") public Optional<IATAAirportCode> origin = Optional.empty(); @JsonPropertyDescription("Destination airport code of the original message.") public Optional<IATAAirportCode> destination = Optional.empty(); @JsonPropertyDescription("Flag indicating if the original message was rejected with an error.") @JsonProperty(required = true) public boolean rejected = false; @JsonPropertyDescription("Message body of the confirmation receipt. This should be the reason for acknowledgement " + "or the reason for rejection or error.") @JsonDocExample("Invalid AWB number") public Optional<String> textMessage = Optional.empty(); @JsonPropertyDescription("Content of the original message in its original message format.") @JsonDocExample("FSR\n" + "157-97631844") public Optional<String> referenceMessageContent = Optional.empty(); @JsonIgnore public Optional<String> fnaEnrichmentCode = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/confirmationreceipt/ConfirmationReceiptMessage.java
package aero.champ.cargojson.confirmationreceipt; import aero.champ.cargojson.common.Message; import aero.champ.cargojson.docgen.annotations.JsonDocHint; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonDocHint(toplevel = true) @JsonClassDescription("Cargo Canonical message containing a ConfirmationReceipt as payload.") public class ConfirmationReceiptMessage extends Message<ConfirmationReceipt> { }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/consolidation/ConsolidationList.java
package aero.champ.cargojson.consolidation; import aero.champ.cargojson.airwaybill.ChargeDeclarations; import aero.champ.cargojson.common.AccountContact; import aero.champ.cargojson.common.AirWaybillNumber; import aero.champ.cargojson.common.OriginAndDestination; import aero.champ.cargojson.common.Quantity; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.ArrayList; import java.util.List; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("A consolidation list is to provide a \"Check-list\" of House Waybills associated with a Master Air Waybill.") public class ConsolidationList { @JsonProperty(required = true) @JsonPropertyDescription("Contains the air waybill number.") public AirWaybillNumber airWaybillNumber; @JsonProperty(required = true) @JsonPropertyDescription("Origin and destination airports of the shipment.") public OriginAndDestination originAndDestination; @JsonProperty(required = true) @JsonPropertyDescription("Quantity details of the shipment.") public Quantity quantity; @JsonProperty(required = true) @JsonPropertyDescription("Array of house waybill summary details.") public List<HouseWaybillSummary> houseWaybillSummaries = new ArrayList<>(); @JsonPropertyDescription("Account contact of the shipper.") public Optional<AccountContact> shipper = Optional.empty(); @JsonPropertyDescription("Account contact of the consignee.") public Optional<AccountContact> consignee = Optional.empty(); @JsonPropertyDescription("Charge Declarations.") public Optional<ChargeDeclarations> chargeDeclarations = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/consolidation/ConsolidationListMessage.java
package aero.champ.cargojson.consolidation; import aero.champ.cargojson.common.Message; import aero.champ.cargojson.docgen.annotations.JsonDocHint; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Cargo Canonical message containing a ConsolidationList as payload.") @JsonDocHint(toplevel = true) public class ConsolidationListMessage extends Message<ConsolidationList> { }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/consolidation/HouseWaybill.java
package aero.champ.cargojson.consolidation; import aero.champ.cargojson.airwaybill.*; import aero.champ.cargojson.common.*; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; @JsonInclude(JsonInclude.Include.NON_EMPTY) public class HouseWaybill { @JsonProperty(required = true) public AirWaybillNumber airWaybillNumber; @JsonProperty(required = true) public IATAAirportCode origin; @JsonProperty(required = true) public IATAAirportCode destination; @JsonProperty(required = true) @JsonPropertyDescription("The house way bill serial number") @JsonDocExample("LON123456789") public String serialNumber; @JsonProperty(required = true) public int numberOfPieces; @JsonProperty(required = true) public Weight weight; public Optional<List<Flight>> flights = Optional.empty(); public Optional<List<Routing>> route = Optional.empty(); public Optional<AccountContact> shipper = Optional.empty(); public Optional<AccountContact> consignee = Optional.empty(); public Optional<AgentIdentification> agent = Optional.empty(); @JsonDocExample("En close pouch with export documents") public Optional<String> specialServiceRequest = Optional.empty(); public Optional<AccountContact> alsoNotify = Optional.empty(); public Optional<List<Accounting>> accounting = Optional.empty(); @JsonProperty(required = true) public ChargeDeclarations chargeDeclarations; public Optional<List<ChargeItem>> chargeItems = Optional.empty(); public Optional<List<OtherChargeItem>> otherCharges = Optional.empty(); public Optional<ChargeSummary> prepaidChargeSummary = Optional.empty(); public Optional<ChargeSummary> collectChargeSummary = Optional.empty(); public Optional<String> shippersCertification = Optional.empty(); @JsonProperty(required = true) public CarriersExecution carriersExecution; @JsonDocExample("not secured") public Optional<String> otherServiceInformation = Optional.empty(); public Optional<String> customsOriginCode = Optional.empty(); @JsonProperty(required = true) public AccountContact agentsHeadOffice; public Optional<String> letterOfCredit = Optional.empty(); public Optional<List<OtherParticipant>> otherParticipant = Optional.empty(); public Set<SpecialHandlingAndDangerousGoodsCode> specialHandlingCodes = new HashSet<>(); @JsonPropertyDescription("Special handling codes that are not covered by the enumeration type of field 'specialHandlingCodes'.") @JsonDocExample("FOO") public Set<String> additionalSpecialHandlingCodes = new HashSet<>(); @JsonPropertyDescription("Shipment reference information.") public Optional<ShipmentReferenceInfo> shipmentReferenceInformation = Optional.empty(); public Optional<List<OCI>> oci = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/consolidation/HouseWaybillMessage.java
package aero.champ.cargojson.consolidation; import aero.champ.cargojson.common.Message; import aero.champ.cargojson.docgen.annotations.JsonDocHint; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Cargo Canonical message containing a HouseWaybill as payload.") @JsonDocHint(toplevel = true) public class HouseWaybillMessage extends Message<HouseWaybill> { }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/consolidation/HouseWaybillSummary.java
package aero.champ.cargojson.consolidation; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.common.OCI; import aero.champ.cargojson.common.SpecialHandlingAndDangerousGoodsCode; import aero.champ.cargojson.common.Weight; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.*; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("House waybill summary details.") public class HouseWaybillSummary { @JsonProperty(required = true) @JsonPropertyDescription("A serial number allocated by an agent/consolidator to identify a particular " + "air cargo shipment within a master air waybill.") @JsonDocExample("12345678ABCD") public String serialNumber; @JsonProperty(required = true) @JsonPropertyDescription("Airport code of origin airport.") public IATAAirportCode origin; @JsonProperty(required = true) @JsonPropertyDescription("Airport code of destination airport.") public IATAAirportCode destination; @JsonProperty(required = true) @JsonPropertyDescription("Number of loose items and/or ULDs as accepted for carriage.") @JsonDocExample("8") public int numberOfPieces; @JsonProperty(required = true) @JsonPropertyDescription("Weight of the cargo.") public Weight weight; @JsonProperty(required = true) @JsonPropertyDescription("Description of the goods for manifest purposes.") @JsonDocExample("Television sets") public String natureOfGoods; @JsonPropertyDescription("Shipper's load and count.") @JsonDocExample("15000") public Optional<Integer> shippersLoadAndCount = Optional.empty(); @JsonPropertyDescription("Array of codes for special handling and dangerous goods.") public Set<SpecialHandlingAndDangerousGoodsCode> specialHandlingRequirementsCodes = new HashSet<>(); @JsonPropertyDescription("Free Text description of goods.") @JsonDocExample("3D 4K supersonic television sets.") public Optional<String> freeTextDescriptionOfGoods = Optional.empty(); @JsonPropertyDescription("Harmonised tariff schedule information: Number identifying goods for customs or statistical purposes.") @JsonDocExample("427127829") public List<String> harmonisedTariffScheduleInformation = new ArrayList<>(); @JsonPropertyDescription("Array of other customs, security and regulatory control information.") public List<OCI> oci = new ArrayList<>(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/customs/BriefStatus.java
package aero.champ.cargojson.customs; public enum BriefStatus { Accepted, Rejected, Other ; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/customs/CustomsAction.java
package aero.champ.cargojson.customs; import aero.champ.cargojson.common.CustomsActionCode; import aero.champ.cargojson.common.CustomsStatusCode; import aero.champ.cargojson.common.OCI; import aero.champ.cargojson.common.ParticipantCode; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import javax.validation.constraints.Pattern; import java.math.BigInteger; import java.time.LocalDateTime; import java.util.List; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) public class CustomsAction { @JsonPropertyDescription("Optional information on the customs status code to facilitate interpretation.") public Optional<BriefStatus> briefStatus = Optional.empty(); @JsonProperty(required = true) public CustomsStatusCode customsStatusCode; @JsonPropertyDescription("Information provided to, or received from, Customs.") @JsonProperty(required = true) public String notification; @JsonProperty(required = true) public CustomsActionCode customsActionCode; @JsonProperty(required = true) public LocalDateTime dateOfNotification; @JsonPropertyDescription("Number assigned to the Customs Entry by Customs.") @JsonDocExample("48622") @JsonProperty(required = true) @Pattern(regexp = "(?:[0-9A-Z]{1,35})") public String customsEntryNumber; @JsonProperty(required = true) @JsonPropertyDescription("Actioned number of pieces.") @JsonDocExample("20") public BigInteger actionedNumberOfPieces; @JsonPropertyDescription("Coded identification of the warehouse where a bonded shipment will be stored.") @JsonDocExample("96763") @Pattern(regexp = "(?:[0-9A-Z]{1,7})") public Optional<String> bondedPremisesIdentification = Optional.empty(); @JsonPropertyDescription("Identification of individual or company involved in the movement of a consignment.") @JsonDocExample("ACE SHIPPING CO") public Optional<String> nameOfNominatedAgentOrConsignee = Optional.empty(); @JsonPropertyDescription("Coded identification of a participant involved in the movement of a shipment.") @Pattern(regexp = "(?:.{1,17})") @JsonDocExample("96764") public Optional<ParticipantCode> participantCodeOfNominatedAgentOrConsignee = Optional.empty(); @JsonPropertyDescription("Other customs, security and regulatory information.") public Optional<List<OCI>> oci = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/customs/CustomsStatusNotification.java
package aero.champ.cargojson.customs; import aero.champ.cargojson.common.*; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) public class CustomsStatusNotification { @JsonProperty(required = true) @JsonPropertyDescription("Contains the air waybill number.") public AirWaybillNumber airWaybillNumber; @JsonPropertyDescription("Master AWB Indication, included if House Waybills are associated with the AWB.") public Optional<Boolean> isMasterAWB = Optional.empty(); @JsonPropertyDescription("House Waybill Serial Number if applicable.") @JsonDocExample("12345678ABCD") public Optional<String> houseWayBillSerialNumber = Optional.empty(); @JsonPropertyDescription("Optional information on wether the message is security or customs related. Background. CIMP CSN messages are often used to convey security information.") public Optional<Relation> relation = Optional.empty(); @JsonPropertyDescription("IATA Code for the flight's carrier if known. At least one of iataCarrierCode or icaoCarrierCode has to be provided.") public Optional<IATACarrierCode> iataCarrierCode = Optional.empty(); @JsonPropertyDescription("IATA Code for the flight's carrier if known. At least one of iataCarrierCode or icaoCarrierCode has to be provided.") public Optional<ICAOCarrierCode> icaoCarrierCode = Optional.empty(); @JsonProperty(required = true) public FlightNumber flightNumber; @JsonProperty(required = true) public IATAAirportCode airportCodeOfLoading; @JsonProperty(required = true) public IATAAirportCode airportCodeOfUnloading; @JsonProperty(required = true) public LocalDate dateOfScheduledArrival; public Optional<IATAAirportCode> airportCodeOfFirstEntryPoint = Optional.empty(); public List<CustomsAction> customsActions = new ArrayList<>(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/customs/CustomsStatusNotificationMessage.java
package aero.champ.cargojson.customs; import aero.champ.cargojson.common.Message; import aero.champ.cargojson.docgen.annotations.JsonDocHint; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Cargo Canonical message containing a Customs Status Notification as payload.") @JsonDocHint(toplevel = true) public class CustomsStatusNotificationMessage extends Message<CustomsStatusNotification> { }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/customs/Relation.java
package aero.champ.cargojson.customs; public enum Relation { Customs, Security, ; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/docgen
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/docgen/annotations/JsonDocExample.java
package aero.champ.cargojson.docgen.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation used to define an example of a value of a JSON datatype (like 'abc' for a string or '42' for a number). * Currently used to populate the example field in generated JSON Schema Documentation. */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface JsonDocExample { /** * Eexample of a value of a JSON datatype (like 'abc' for a string or '42' for a number). */ String value(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/docgen
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/docgen/annotations/JsonDocHint.java
package aero.champ.cargojson.docgen.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Annotation used to pass composition hints to the JsonDocComposer. */ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface JsonDocHint { /** * Tells the composer to consider the documented type as toplevel. */ boolean toplevel() default false; /** * Tells the composer to skip (not to document) this type. */ boolean skip() default false; }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/FlightEvent.java
package aero.champ.cargojson.flightstatus; import aero.champ.cargojson.common.*; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.events.*; import aero.champ.cargojson.jackson.DefaultObjectMapperBuilder; import aero.champ.cargojson.validation.ValidationContext; import com.fasterxml.jackson.annotation.*; import java.math.BigInteger; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Optional; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = Discrepancy.class, name = "discrepancy"), @JsonSubTypes.Type(value = ArrivalDocumentationDelivered.class, name = "arrival documentation delivered"), @JsonSubTypes.Type(value = ArrivalDocumentationReceived.class, name = "arrival documentation received"), @JsonSubTypes.Type(value = ConsigneeNotified.class, name = "consignee notified"), @JsonSubTypes.Type(value = Arrived.class, name = "arrived"), @JsonSubTypes.Type(value = Booked.class, name = "booked"), @JsonSubTypes.Type(value = CustomsCleared.class, name = "customs cleared"), @JsonSubTypes.Type(value = TransferManifested.class, name = "transfer manifested"), @JsonSubTypes.Type(value = Manifested.class, name = "manifested"), @JsonSubTypes.Type(value = Delivered.class, name = "delivered"), @JsonSubTypes.Type(value = DeliveredAtDoor.class, name = "delivered at door"), @JsonSubTypes.Type(value = ReceivedFromFlight.class, name = "received from flight"), @JsonSubTypes.Type(value = ReceivedFromShipper.class, name = "received from shipper"), @JsonSubTypes.Type(value = ReceivedFromCarrier.class, name = "received from carrier"), @JsonSubTypes.Type(value = TransferredToCarrier.class, name = "transferred to carrier"), @JsonSubTypes.Type(value = FreightPrepared.class, name = "freight prepared"), @JsonSubTypes.Type(value = ReportedToCustoms.class, name = "reported to customs"), @JsonSubTypes.Type(value = TransferredToCustoms.class, name = "transferred to customs"), @JsonSubTypes.Type(value = Departed.class, name = "departed"), @JsonSubTypes.Type(value = FreightOnHand.class, name = "freight on hand"), @JsonSubTypes.Type(value = InFlight.class, name = "in flight"), }) @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Base type representing common data of a flight event. A flight event is a new status in " + "the shipment process of a consignment.") public abstract class FlightEvent { @JsonProperty(required = true) @JsonPropertyDescription("Number of pieces of the consignment this flight event belongs to.") @JsonDocExample("12") public BigInteger numberOfPieces; @JsonPropertyDescription("Weight of the consignment this flight event belongs to.") public Optional<Weight> weight = Optional.empty(); @JsonPropertyDescription("Unit Load Device (ULD) data.") public List<ULD> uld = new ArrayList<>(); @JsonProperty(required = true) @JsonPropertyDescription("Date and time when this event was created or reported.") public LocalDateTime timeOfEvent; @JsonProperty(required = true) @JsonPropertyDescription("Certain sources might not convey the time part of the event. This field shows the quality of the time information in timeOfEvent") public DataQuality timeOfEventTimePartQuality = DataQuality.SUPPLIED; public void validateCargoImp(ValidationContext validationContext) { validationContext.checkSize(uld,0,5,"uld"); } public <V extends FlightEvent> Optional<V> narrow(Class<V> clazz) { if (clazz.isAssignableFrom(this.getClass())) return Optional.<V>of((V)this); return Optional.empty(); } @JsonPropertyDescription("Other service information: Remarks relating to a shipment.") @JsonDocExample("Extra charge due to special handling requirements.") public Optional<String> otherServiceInformation = Optional.empty(); public abstract Optional<IATAAirportCode> airportOfEvent(); public abstract Optional<FlightIdentity> flight(); @Override public String toString() { return DefaultObjectMapperBuilder.globalMapper().writeValueAsString(this); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/FlightHistory.java
package aero.champ.cargojson.flightstatus; import aero.champ.cargojson.common.AirWaybillNumber; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.jackson.DefaultObjectMapperBuilder; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("A Flight History indicates latest status, or statuses, in the movement of the nominated consignment.") public class FlightHistory implements Serializable { private static final long serialVersionUID = 1l; @JsonProperty(required = true) @JsonPropertyDescription("Contains the air waybill number.") public AirWaybillNumber airWaybillNumber; @JsonProperty(required = true) @JsonPropertyDescription("Array of consignment details.") public List<SplitConsignment> consignments = new ArrayList<>(); @JsonPropertyDescription("Other service information: Remarks relating to a shipment.") @JsonDocExample("Extra charge due to special handling requirements.") public Optional<String> otherServiceInformation = Optional.empty(); private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException { out.writeUTF(DefaultObjectMapperBuilder.globalMapper().writeValueAsString(this)); } private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException { String json = stream.readUTF(); FlightHistory msg = DefaultObjectMapperBuilder.globalMapper().readValue(json,FlightHistory.class); this.airWaybillNumber = msg.airWaybillNumber; this.consignments = msg.consignments; this.otherServiceInformation = msg.otherServiceInformation; } public List<FlightStatus> convertToStatuses() { return consignments.stream().flatMap(c->{ return c.events.stream().map(evt->{ FlightStatus status = new FlightStatus(); status.events.add(evt); status.airWaybillNumber = airWaybillNumber; status.otherCustomsSecurityAndRegulatoryInformation = c.otherCustomsSecurityAndRegulatoryInformation; status.totalNumberOfPieces = c.totalNumberOfPieces; status.quantity = c.quantity; status.originAndDestination = c.originAndDestination; status.otherServiceInformation = evt.otherServiceInformation; return status; }); }).sorted((s1,s2)-> s1.events.get(0).timeOfEvent.compareTo(s2.events.get(0).timeOfEvent) ).collect(Collectors.toList()); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/FlightHistoryMessage.java
package aero.champ.cargojson.flightstatus; import aero.champ.cargojson.common.Message; import aero.champ.cargojson.docgen.annotations.JsonDocHint; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Cargo Canonical message containing a FlightHistory as payload.") @JsonDocHint(toplevel = true) public class FlightHistoryMessage extends Message<FlightHistory> { }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/FlightStatus.java
package aero.champ.cargojson.flightstatus; import aero.champ.cargojson.common.AirWaybillNumber; import aero.champ.cargojson.common.OriginAndDestination; import aero.champ.cargojson.common.Quantity; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.events.OtherCustomsSecurityAndRegulatoryInformation; import aero.champ.cargojson.jackson.DefaultObjectMapperBuilder; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("A Flight Status indicates a status in the movement of the nominated consignment.") public class FlightStatus implements Serializable { private static final long serialVersionUID = 1l; @JsonProperty(required = true) @JsonPropertyDescription("Contains the air waybill number.") public AirWaybillNumber airWaybillNumber; @JsonPropertyDescription("Origin and destination airports of the consigment.") public Optional<OriginAndDestination> originAndDestination = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("Quantity details of the consigment.") public Quantity quantity; @JsonProperty(required = true) @JsonPropertyDescription("Total number of pieces of the consignment.") @JsonDocExample("20") public BigInteger totalNumberOfPieces; @JsonPropertyDescription("Array of flight events related to the flight status. Will often be only one event.") public List<FlightEvent> events = new ArrayList<>(); @JsonPropertyDescription("Other customs, security and regulatory information.") public Optional<OtherCustomsSecurityAndRegulatoryInformation> otherCustomsSecurityAndRegulatoryInformation = Optional.empty(); @JsonPropertyDescription("Other service information: Remarks relating to a shipment.") @JsonDocExample("Extra charge due to special handling requirements.") public Optional<String> otherServiceInformation = Optional.empty(); private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException { out.writeUTF(DefaultObjectMapperBuilder.globalMapper().writeValueAsString(this)); } private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException { String json = stream.readUTF(); FlightStatus msg = DefaultObjectMapperBuilder.globalMapper().readValue(json,FlightStatus.class); this.airWaybillNumber = msg.airWaybillNumber; this.originAndDestination = msg.originAndDestination; this.quantity = msg.quantity; this.totalNumberOfPieces = msg.totalNumberOfPieces; this.events = msg.events; this.otherCustomsSecurityAndRegulatoryInformation = msg.otherCustomsSecurityAndRegulatoryInformation; this.otherServiceInformation = msg.otherServiceInformation; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/FlightStatusGrouping.java
package aero.champ.cargojson.flightstatus; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.flightstatus.events.*; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; public class FlightStatusGrouping { public static class Station { public final IATAAirportCode location; public final List<Station> nextStations = new ArrayList<>(); public final List<FlightStatus> associatedStatuses = new ArrayList<>(); public Station(IATAAirportCode location) { this.location = location; } } public FlightStatusGrouping(IATAAirportCode firstStation, Collection<FlightStatus> statuses) { this.firstStation = groupStatuses(firstStation, statuses); } public FlightStatusGrouping(Collection<FlightStatus> statuses) { this(statuses.stream().filter(s->!s.events.isEmpty() && s.events.stream().allMatch(f->f.timeOfEvent != null)).sorted((s1,s2)-> getTimeOfEvent(s2).compareTo(getTimeOfEvent(s1)) ).filter(s->s.originAndDestination.isPresent()).findFirst().map(od->od.originAndDestination.get().origin).orElse(new IATAAirportCode("XXX")), statuses.stream().filter(s->!s.events.isEmpty() && s.events.stream().allMatch(f->f.timeOfEvent != null)).collect(Collectors.toList())); } private static LocalDateTime getTimeOfEvent(FlightStatus s1) { return s1.events.stream().min(Comparator.comparing(f->f.timeOfEvent)).get().timeOfEvent; } public final Station firstStation; private Station groupStatuses(IATAAirportCode firstStation, Collection<FlightStatus> statuses) { HashMap<IATAAirportCode, Station> statusByHop = splitHops(statuses); Station ret = statusByHop.get(firstStation); if (ret != null) return ret; IATAAirportCode firstHop = guessFirstHop(statusByHop); return statusByHop.get(firstHop); } private IATAAirportCode guessFirstHop(HashMap<IATAAirportCode, Station> statuses) { HashSet<IATAAirportCode> stationList = new HashSet<>(statuses.keySet()); statuses.values().forEach(s->{ s.associatedStatuses.forEach(ss->{ ss.events.forEach(e->{ e.narrow(Arrived.class).ifPresent(c->stationList.remove(c.destination)); e.narrow(Departed.class).ifPresent(c->stationList.remove(c.destination)); e.narrow(Booked.class).ifPresent(c->stationList.remove(c.destination)); }); }); }); if (stationList.isEmpty()) { return statuses.keySet().iterator().next(); } return stationList.iterator().next(); } private HashMap<IATAAirportCode, Station> splitHops(Collection<FlightStatus> statuses) { HashMap<IATAAirportCode,Station> statusByHop = new HashMap<>(); statuses.forEach(s->{ IATAAirportCode happenedWhere = computeLocation(s); statusByHop.computeIfAbsent(happenedWhere,k->new Station(happenedWhere)).associatedStatuses.add(s); }); for (Station station : statusByHop.values()) { Collection<IATAAirportCode> linkedStations = findLinkFor(station.location,statuses); statusByHop.entrySet().stream().filter(e->linkedStations.contains(e.getKey())).map(e->e.getValue()).forEach(station.nextStations::add); } return statusByHop; } private Collection<IATAAirportCode> findLinkFor(IATAAirportCode location, Collection<FlightStatus> statuses) { Set<IATAAirportCode> ret = new HashSet<>(); statuses.forEach(s->{ s.events.forEach(e->{ e.narrow(Departed.class).filter(d->d.origin.equals(location)).map(d->d.destination).ifPresent(ret::add); e.narrow(Booked.class).filter(d->d.origin.equals(location)).map(d->d.destination).ifPresent(ret::add); e.narrow(FreightPrepared.class).filter(d->d.origin.equals(location)).map(d->d.destination).ifPresent(ret::add); e.narrow(Manifested.class).filter(d->d.origin.equals(location)).map(d->d.destination).ifPresent(ret::add); e.narrow(ReportedToCustoms.class).filter(d->d.origin.equals(Optional.of(location))).flatMap(d->d.destination).ifPresent(ret::add); e.narrow(InFlight.class).filter(d->d.origin.equals(location)).map(d->d.destination).ifPresent(ret::add); }); }); return ret; } private IATAAirportCode computeLocation(FlightStatus s) { return s.events.stream().map(e->e.airportOfEvent()).filter(Optional::isPresent).map(Optional::get).findFirst().orElse(new IATAAirportCode("XXX")); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/FlightStatusMessage.java
package aero.champ.cargojson.flightstatus; import aero.champ.cargojson.common.Message; import aero.champ.cargojson.docgen.annotations.JsonDocHint; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Cargo Canonical message containing a FlightStatus as payload.") @JsonDocHint(toplevel = true) public class FlightStatusMessage extends Message<FlightStatus> { }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/FlightStatusRequest.java
package aero.champ.cargojson.flightstatus; import aero.champ.cargojson.common.AirWaybillNumber; import aero.champ.cargojson.common.FlightDetails; import aero.champ.cargojson.common.OriginAndDestination; import aero.champ.cargojson.common.Quantity; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.List; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("A request for the current status of a nominated consignment.") public class FlightStatusRequest { @JsonProperty(required = true) @JsonPropertyDescription("Contains the air waybill number.") public AirWaybillNumber airWaybillNumber; @JsonPropertyDescription("Origin and destination airports of the consigment.") public Optional<OriginAndDestination> originAndDestination = Optional.empty(); @JsonPropertyDescription("Quantity details of the consigment.") public Optional<Quantity> quantity= Optional.empty(); @JsonPropertyDescription("Description of the goods for manifest purposes.") @JsonDocExample("Black hats and sunglasses.") public Optional<String> natureOfGoods = Optional.empty(); @JsonPropertyDescription("Array of flight details for the regarded consignment.") public Optional<List<FlightDetails>> flightDetailsList = Optional.empty(); @JsonPropertyDescription("Other service information: Remarks relating to a shipment.") @JsonDocExample("Extra charge due to special handling requirements.") public Optional<String> otherServiceInformation = Optional.empty(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/FlightStatusRequestMessage.java
package aero.champ.cargojson.flightstatus; import aero.champ.cargojson.common.Message; import aero.champ.cargojson.docgen.annotations.JsonDocHint; import com.fasterxml.jackson.annotation.JsonClassDescription; @JsonClassDescription("Cargo Canonical message containing a FlightStatusRequest as payload.") @JsonDocHint(toplevel = true) public class FlightStatusRequestMessage extends Message<FlightStatusRequest> { }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/SplitConsignment.java
package aero.champ.cargojson.flightstatus; import aero.champ.cargojson.common.OriginAndDestination; import aero.champ.cargojson.common.Quantity; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.events.OtherCustomsSecurityAndRegulatoryInformation; import aero.champ.cargojson.validation.ValidationContext; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Split consignment: A split consigment describes one of potential many " + "consignments belonging to the same air waybill.") public class SplitConsignment { @JsonPropertyDescription("Origin and destination airports of the consigment.") public Optional<OriginAndDestination> originAndDestination = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("Quantity details of the consigment.") public Quantity quantity; @JsonProperty(required = true) @JsonPropertyDescription("Total number of pieces of the consignment.") @JsonDocExample("20") public BigInteger totalNumberOfPieces; @JsonPropertyDescription("Array of flight events reported so far.") public List<FlightEvent> events = new ArrayList<>(); @JsonPropertyDescription("Other customs, security and regulatory information.") public Optional<OtherCustomsSecurityAndRegulatoryInformation> otherCustomsSecurityAndRegulatoryInformation = Optional.empty(); @JsonPropertyDescription("Other service information: Remarks relating to a shipment.") @JsonDocExample("Extra charge due to special handling requirements.") public Optional<String> otherServiceInformation = Optional.empty(); public void validateCargoImp(ValidationContext validationContext) { validationContext.withContext("events").validate(ctx->{ for (int i = 0; i < events.size(); ++i) { FlightEvent sd = events.get(i); validationContext.withContext(String.valueOf(i)).validate(sd::validateCargoImp); } }); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/AcceptedByCustoms.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDate; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment was reported to customs.\nConforms to CIMP FSU status 'CRC'.") public class AcceptedByCustoms extends FlightEvent { public AcceptedByCustoms(){} @JsonPropertyDescription("The flight the consignment is loaded on.") public FlightIdentity flight; @JsonPropertyDescription("The scheduled arrival date of the flight.") public LocalDate dateOfScheduledArrival; @JsonPropertyDescription("The airport of loading.") public IATAAirportCode airportOfLoading; @JsonPropertyDescription("The destination airport of the flight.") public IATAAirportCode airportOfUnloading; @JsonPropertyDescription("The airport of first entry.") public IATAAirportCode airportOfFirstEntryPoint; @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(airportOfUnloading); } @Override public Optional<FlightIdentity> flight() { return Optional.of(flight); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/ArrivalDocumentationDelivered.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.*; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment arrival documents have been delivered to the consignee or agent.\n"+ "Conforms to CIMP FSU status 'AWD'.") @JsonIgnoreProperties("quantity") public class ArrivalDocumentationDelivered extends FlightEvent { public ArrivalDocumentationDelivered(){} @JsonProperty(required = true) @JsonPropertyDescription("Airport where the consignment was delivered.") public IATAAirportCode airportOfDelivery; @JsonPropertyDescription("The name of the individual or company to whom the documents have been delivered.") @JsonDocExample("K. Wilson, Supersonic Shipping Co.") public Optional<String> deliveryToName = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(airportOfDelivery); } @Override public Optional<FlightIdentity> flight() { return Optional.empty(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/ArrivalDocumentationReceived.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.*; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment arrival documents have been received by the consignee or agent.\n"+ "Conforms to CIMP FSU status 'AWR'.") @JsonIgnoreProperties("quantity") public class ArrivalDocumentationReceived extends FlightEvent { public ArrivalDocumentationReceived(){} @JsonPropertyDescription("The flight related to the arrival documents.") public Optional<FlightIdentity> flight = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("The scheduled arrival date of the flight.") public LocalDate dateOfScheduledArrival; @JsonPropertyDescription("The actual arrival time of the flight.") public Optional<LocalDateTime> actualTimeOfArrival = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("The destination airport of the flight.") public IATAAirportCode destination; @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(destination); } @Override public Optional<FlightIdentity> flight() { return flight; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/Arrived.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDate; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment is arrived.\nConforms to CIMP FSU status 'ARR'.") public class Arrived extends FlightEvent { public Arrived(){} @JsonPropertyDescription("The flight the consignment is or was loaded on.") public Optional<FlightIdentity> flight = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("Date of scheduled arrival of the flight.") public LocalDate dateOfScheduledArrival; @JsonProperty(required = true) @JsonPropertyDescription("The destination airport of the flight.") public IATAAirportCode destination; @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(destination); } @Override public Optional<FlightIdentity> flight() { return flight; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/Booked.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.DensityGroup; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.common.Volume; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.*; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment was booked on a specific flight.\nConforms to CIMP FSU status 'BKD'.") @JsonIgnoreProperties("quantity") public class Booked extends FlightEvent { public Booked(){} @JsonPropertyDescription("The flight the consignment was booked on.") public Optional<FlightIdentity> flight = Optional.empty(); @JsonPropertyDescription("The departure date of the flight the consignment was booked on.") public Optional<LocalDate> dateOfScheduledDeparture = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("The origin airport of the flight.") public IATAAirportCode origin; @JsonProperty(required = true) @JsonPropertyDescription("The destination airport of the flight.") public IATAAirportCode destination; @JsonPropertyDescription("The scheduled departure date and time of the flight.") public Optional<LocalDateTime> timeOfScheduledDeparture = Optional.empty(); @JsonPropertyDescription("The estimated departure date and time of the flight.") public Optional<LocalDateTime> estimatedTimeOfDeparture = Optional.empty(); @JsonPropertyDescription("The scheduled arrival date and time of the flight.") public Optional<LocalDateTime> timeOfScheduledArrival = Optional.empty(); @JsonPropertyDescription("The estimated arrival date and time of the flight.") public Optional<LocalDateTime> estimatedTimeOfArrival = Optional.empty(); @JsonPropertyDescription("Volume data of the consignment.") public Optional<Volume> volume = Optional.empty(); @JsonPropertyDescription("Density group - usually given if no volume data is specified.") public Optional<DensityGroup> densityGroup = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(origin); } @Override public Optional<FlightIdentity> flight() { return flight; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/ConsigneeNotified.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment has arrived at destination and that the consignee or agent has been notified.\n"+ "Conforms to CIMP FSU status 'NFD'.") public class ConsigneeNotified extends FlightEvent { public ConsigneeNotified(){} @JsonProperty(required = true) @JsonPropertyDescription("The airport of the notification.") public IATAAirportCode airportOfNotification; @JsonPropertyDescription("The name of the individual or company that has been notified.") @JsonDocExample("K. Wilson, Supersonic Shipping Co.") public Optional<String> notificationToName = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(airportOfNotification); } @Override public Optional<FlightIdentity> flight() { return Optional.empty(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/CustomsCleared.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment was cleared by customs.\nConforms to CIMP FSU status 'CCD'.") public class CustomsCleared extends FlightEvent { public CustomsCleared(){} @JsonProperty(required = true) @JsonPropertyDescription("The airport where the consignment was cleared by customs.") public IATAAirportCode airportOfClearance; @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(airportOfClearance); } @Override public Optional<FlightIdentity> flight() { return Optional.empty(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/Delivered.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.*; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment was delivered to the consignee or agent.\nConforms to CIMP FSU status 'DLV'.") @JsonIgnoreProperties("quantity") public class Delivered extends FlightEvent { public Delivered(){} @JsonProperty(required = true) @JsonPropertyDescription("The airport of the delivery.") public IATAAirportCode airportOfDelivery; @JsonPropertyDescription("The name of the individual or company the consignment has been delivered to.") @JsonDocExample("K. Wilson, Supersonic Shipping Co.") public Optional<String> deliveryToName = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(airportOfDelivery); } @Override public Optional<FlightIdentity> flight() { return Optional.empty(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/DeliveredAtDoor.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment was delivered at the consignee's door.\nConforms to CIMP FSU status 'DDL'.") public class DeliveredAtDoor extends FlightEvent { public DeliveredAtDoor(){} @JsonProperty(required = true) @JsonPropertyDescription("The airport where the consignment was delivered.") public IATAAirportCode airportOfDelivery; @JsonPropertyDescription("The name of the individual or company the consignment has been delivered to.") @JsonDocExample("K. Wilson, Supersonic Shipping Co.") public Optional<String> deliveryToName = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(airportOfDelivery); } @Override public Optional<FlightIdentity> flight() { return Optional.empty(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/Departed.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the flight the consignment is loaded on has departed.\nConforms to CIMP FSU status 'DEP'.") public class Departed extends FlightEvent { public Departed(){} @JsonPropertyDescription("The flight the consignment is loaded on.") public Optional<FlightIdentity> flight = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("The departure date of the flight.") public LocalDate dateOfScheduledDeparture; @JsonProperty(required = true) @JsonPropertyDescription("The origin airport of the flight.") public IATAAirportCode origin; @JsonProperty(required = true) @JsonPropertyDescription("The destination airport of the flight.") public IATAAirportCode destination; @JsonPropertyDescription("The estimated arrival date and time of the flight.") public Optional<LocalDateTime> estimatedTimeOfArrival = Optional.empty(); @JsonPropertyDescription("The scheduled arrival date and time of the flight.") public Optional<LocalDateTime> timeOfScheduledArrival = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(origin); } @Override public Optional<FlightIdentity> flight() { return flight; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/Discrepancy.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.DiscrepancyCode; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports a consignment with a discrepancy.\nConforms to CIMP FSU status 'DIS'.") public class Discrepancy extends FlightEvent { public Discrepancy(){} @JsonPropertyDescription("The flight the discrepancy is related to.") public Optional<FlightIdentity> flight = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("The airport the discrepancy is related to.") public IATAAirportCode airportOfDiscrepancy; @JsonProperty(required = true) @JsonPropertyDescription("Coded representation of the discrepancy.") public DiscrepancyCode discrepancyCode; @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(airportOfDiscrepancy); } @Override public Optional<FlightIdentity> flight() { return flight; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/FreightOnHand.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.DensityGroup; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.common.Volume; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the freight is on hand.\nConforms to CIMP FSU status 'FOH'.") public class FreightOnHand extends FlightEvent { public FreightOnHand(){} @JsonProperty(required = true) @JsonPropertyDescription("The airport where the consignment was received.") public IATAAirportCode airportOfReceipt; @JsonPropertyDescription("The name of the individual or company the freight has been received from.") @JsonDocExample("K. Wilson, Supersonic Shipping Co.") public Optional<String> receivedFromName = Optional.empty(); @JsonPropertyDescription("The volume of the freight.") public Optional<Volume> volume = Optional.empty(); @JsonPropertyDescription("The density group of the freight.") public Optional<DensityGroup> densityGroup = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(airportOfReceipt); } @Override public Optional<FlightIdentity> flight() { return Optional.empty(); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/FreightPrepared.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment was prepared for a specific flight.\nConforms to CIMP FSU status 'PRE'.") public class FreightPrepared extends FlightEvent { public FreightPrepared(){} @JsonPropertyDescription("The flight the consignment was prepared for.") public Optional<FlightIdentity> flight = Optional.empty(); @JsonPropertyDescription("The departure date of the flight the consignment was prepared for.") public Optional<LocalDate> dateOfScheduledDeparture = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("The origin airport of the flight.") public IATAAirportCode origin; @JsonProperty(required = true) @JsonPropertyDescription("The destination airport of the flight.") public IATAAirportCode destination; @JsonPropertyDescription("The scheduled departure date and time of the flight.") public Optional<LocalDateTime> timeOfScheduledDeparture = Optional.empty(); @JsonPropertyDescription("The estimated departure date and time of the flight.") public Optional<LocalDateTime> estimatedTimeOfDeparture = Optional.empty(); @JsonPropertyDescription("The scheduled arrival date and time of the flight.") public Optional<LocalDateTime> timeOfScheduledArrival = Optional.empty(); @JsonPropertyDescription("The estimated arrival date and time of the flight.") public Optional<LocalDateTime> estimatedTimeOfArrival = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(origin); } @Override public Optional<FlightIdentity> flight() { return flight; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/InFlight.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDateTime; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event expresses that the consignment is or was airborne at the reported event time. " + "This is live information gathered from flight tracking systems. All dates and times are based on UTC timezone.") public class InFlight extends FlightEvent { public InFlight(){} @JsonProperty(required = true) @JsonPropertyDescription("The airborne flight.") public FlightIdentity flight; @JsonProperty(required = true) @JsonPropertyDescription("Origin airport of the flight.") public IATAAirportCode origin; @JsonProperty(required = true) @JsonPropertyDescription("Destination airport of the flight.") public IATAAirportCode destination; @JsonPropertyDescription("The scheduled departure date and time of the flight.") public Optional<LocalDateTime> scheduledTimeOfDeparture = Optional.empty(); @JsonPropertyDescription("The scheduled arrival date and time of the flight.") public Optional<LocalDateTime> scheduledTimeOfArrival = Optional.empty(); @JsonPropertyDescription("The actual departure date and time of the flight.") public Optional<LocalDateTime> actualTimeOfDeparture = Optional.empty(); @JsonPropertyDescription("The estimated arrival date and time of the flight.") public Optional<LocalDateTime> estimatedTimeOfArrival = Optional.empty(); @JsonPropertyDescription("The actual arrival date and time of the flight.") public Optional<LocalDateTime> actualTimeOfArrival = Optional.empty(); @JsonPropertyDescription("The planned flight time of the flight in minutes.") @JsonDocExample("320") public Optional<Integer> plannedflightTime = Optional.empty(); @JsonPropertyDescription("The estimated difference between scheduled and actual time of arrival of the flight in minutes. " + "In other words: the delay.") @JsonDocExample("25") public Optional<Integer> estimatedDiffToSchedule = Optional.empty(); @JsonPropertyDescription("Current longitude of the airborne vehicle.") @JsonDocExample("2.3161") public double ecefLongitude; @JsonPropertyDescription("Current latitude of the airborne vehicle.") @JsonDocExample("48.7199") public double ecefLatitude; @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.empty(); } @Override public Optional<FlightIdentity> flight() { return Optional.of(flight); } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/Manifested.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment was manifested on a specific flight.\nConforms to CIMP FSU status 'MAN'.") public class Manifested extends FlightEvent { public Manifested(){} @JsonPropertyDescription("The flight the consignment was manifested on.") public Optional<FlightIdentity> flight = Optional.empty(); @JsonPropertyDescription("The departure date of the flight the consignment was manifested on.") public Optional<LocalDate> dateOfScheduledDeparture = Optional.empty(); @JsonProperty(required = true) @JsonPropertyDescription("The origin airport of the flight.") public IATAAirportCode origin; @JsonProperty(required = true) @JsonPropertyDescription("The destination airport of the flight.") public IATAAirportCode destination; @JsonPropertyDescription("The scheduled departure date and time of the flight.") public Optional<LocalDateTime> timeOfScheduledDeparture = Optional.empty(); @JsonPropertyDescription("The estimated departure date and time of the flight.") public Optional<LocalDateTime> estimatedTimeOfDeparture = Optional.empty(); @JsonPropertyDescription("The scheduled arrival date and time of the flight.") public Optional<LocalDateTime> timeOfScheduledArrival = Optional.empty(); @JsonPropertyDescription("The estimated arrival date and time of the flight.") public Optional<LocalDateTime> estimatedTimeOfArrival = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(origin); } @Override public Optional<FlightIdentity> flight() { return flight; } }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/OtherCustomsSecurityAndRegulatoryInformation.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.ULD; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.ArrayList; import java.util.List; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("Customs, security and regulatory control information in conjunction with a list of ULDs.") public class OtherCustomsSecurityAndRegulatoryInformation { public OtherCustomsSecurityAndRegulatoryInformation(){} @JsonProperty(required = true) @JsonPropertyDescription("Array of other customs, security and regulatory control information.") public List<aero.champ.cargojson.common.OCI> oci = new ArrayList<>(); @JsonPropertyDescription("Array of Unit Load Device (ULD) data.") public List<ULD> uld = new ArrayList<>(); }
0
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus
java-sources/aero/champ/cargojson/1.0/aero/champ/cargojson/flightstatus/events/ReceivedFromCarrier.java
package aero.champ.cargojson.flightstatus.events; import aero.champ.cargojson.common.FlightIdentity; import aero.champ.cargojson.common.IATAAirportCode; import aero.champ.cargojson.common.IATACarrierCode; import aero.champ.cargojson.docgen.annotations.JsonDocExample; import aero.champ.cargojson.flightstatus.FlightEvent; import com.fasterxml.jackson.annotation.JsonClassDescription; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonClassDescription("This event reports that the consignment was received from another airline or carrier.\nConforms to CIMP FSU status 'RCT'.") public class ReceivedFromCarrier extends FlightEvent { public ReceivedFromCarrier(){} @JsonProperty(required = true) @JsonPropertyDescription("The carrier transferring the consignment.") public IATACarrierCode transferringCarrier; @JsonProperty(required = true) @JsonPropertyDescription("Airport where the transfer takes place.") public IATAAirportCode airportOfTransfer; @JsonPropertyDescription("The carrier receiving the consignment.") public Optional<IATACarrierCode> receivingCarrier = Optional.empty(); @JsonPropertyDescription("Identification of individual or company that received the consignment.") @JsonDocExample("Ace Shipping Co.") public Optional<String> receivedFromName = Optional.empty(); @Override public Optional<IATAAirportCode> airportOfEvent() { return Optional.of(airportOfTransfer); } @Override public Optional<FlightIdentity> flight() { return Optional.empty(); } }