Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  
  package org.jibx.schema.org.opentravel._2012B.air;
  
  import java.util.List;
The AirDetails Response message provides additional flight details for each leg of a flight (e.g. journey time, meal service). Types of information in the response include: Marketing Airline; Board and Off points for each flight leg; Operating Airline; Equipment; and Meal service for each cabin type. Schema fragment(s) for this class:
 <xs:element xmlns:ns="http://www.opentravel.org/OTA/2003/05/common" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="OTA_AirDetailsRS">
   <xs:complexType>
     <xs:choice>
       <xs:sequence>
         <xs:element type="ns:SuccessType" name="Success"/>
         <xs:element type="ns:WarningsType" name="Warnings" minOccurs="0"/>
         <xs:element name="FlightDetails" minOccurs="0" maxOccurs="150">
           <!-- Reference to inner class FlightDetails -->
         </xs:element>
       </xs:sequence>
       <xs:element type="ns:ErrorsType" name="Errors"/>
     </xs:choice>
     <xs:attributeGroup ref="ns:OTA_PayloadStdAttributes"/>
   </xs:complexType>
 </xs:element>
 
 
 public class DetailsRS
 {
     private int choiceSelect = -1;
     private static final int SUCCESS_CHOICE = 0;
     private static final int ERRORS_CHOICE = 1;
     private Success success;
     private Warnings warnings;
     private List<FlightDetailsflightDetailList = new ArrayList<FlightDetails>();
     private Errors errors;
 
     private void setChoiceSelect(int choice) {
         if ( == -1) {
              = choice;
         } else if ( != choice) {
             throw new IllegalStateException(
                     "Need to call clearChoiceSelect() before changing existing choice");
         }
     }

    
Clear the choice selection.
 
     public void clearChoiceSelect() {
          = -1;
     }

    
Check if Success is current selection for choice.

Returns:
true if selection, false if not
 
     public boolean ifSuccess() {
         return  == ;
     }

    
Get the 'Success' element value. Standard way to indicate successful processing of an OpenTravel message. Returning an empty element of this type indicates success.

Returns:
value
 
     public Success getSuccess() {
         return ;
     }

    
Set the 'Success' element value. Standard way to indicate successful processing of an OpenTravel message. Returning an empty element of this type indicates success.

Parameters:
success
 
     public void setSuccess(Success success) {
         setChoiceSelect();
         this. = success;
     }

    
Get the 'Warnings' element value. Standard way to indicate successful processing of an OpenTravel message, but one in which warnings are generated.

Returns:
value
    public Warnings getWarnings() {
        return ;
    }

    
Set the 'Warnings' element value. Standard way to indicate successful processing of an OpenTravel message, but one in which warnings are generated.

Parameters:
warnings
    public void setWarnings(Warnings warnings) {
        this. = warnings;
    }

    
Get the list of 'FlightDetails' element items.

Returns:
list
        return ;
    }

    
Set the list of 'FlightDetails' element items.

Parameters:
list
    public void setFlightDetailList(List<FlightDetailslist) {
         = list;
    }

    
Get the number of 'FlightDetails' element items.

Returns:
count
    public int sizeFlightDetailList() {
        return .size();
    }

    
Add a 'FlightDetails' element item.

Parameters:
item
    public void addFlightDetail(FlightDetails item) {
        .add(item);
    }

    
Get 'FlightDetails' element item by position.

Parameters:
index
Returns:
item
    public FlightDetails getFlightDetail(int index) {
        return .get(index);
    }

    
Remove all 'FlightDetails' element items.
    public void clearFlightDetailList() {
        .clear();
    }

    
Check if Errors is current selection for choice.

Returns:
true if selection, false if not
    public boolean ifErrors() {
        return  == ;
    }

    
Get the 'Errors' element value. A collection of errors that occurred during the processing of a message.

Returns:
value
    public Errors getErrors() {
        return ;
    }

    
Set the 'Errors' element value. A collection of errors that occurred during the processing of a message.

Parameters:
errors
    public void setErrors(Errors errors) {
        this. = errors;
    }

    
Get the 'OTA_PayloadStdAttributes' attributeGroup value.

Returns:
value
        return ;
    }

    
Set the 'OTA_PayloadStdAttributes' attributeGroup value.

Parameters:
OTAPayloadStdAttributes
    public void setOTAPayloadStdAttributes(
            OTAPayloadStdAttributes OTAPayloadStdAttributes) {
        this. = OTAPayloadStdAttributes;
    }
    
Construct to describe details for a specific flight. Schema fragment(s) for this class:
 <xs:element xmlns:ns="http://www.opentravel.org/OTA/2003/05/common" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="FlightDetails" minOccurs="0" maxOccurs="150">
   <xs:complexType>
     <xs:sequence>
       <xs:element name="FlightLegDetails" maxOccurs="10">
         <!-- Reference to inner class FlightLegDetails -->
       </xs:element>
     </xs:sequence>
     <xs:attributeGroup ref="ns:AirDetailsRSAttributes"/>
     <xs:attribute type="xs:string" use="optional" name="CabinQty"/>
   </xs:complexType>
 </xs:element>
 
    public static class FlightDetails
    {
        private String cabinQty;

        
Get the list of 'FlightLegDetails' element items.

Returns:
list
        public List<FlightLegDetailsgetFlightLegDetailList() {
            return ;
        }

        
Set the list of 'FlightLegDetails' element items.

Parameters:
list
        public void setFlightLegDetailList(List<FlightLegDetailslist) {
             = list;
        }

        
Get the number of 'FlightLegDetails' element items.

Returns:
count
        public int sizeFlightLegDetailList() {
            return .size();
        }

        
Add a 'FlightLegDetails' element item.

Parameters:
item
        public void addFlightLegDetail(FlightLegDetails item) {
            .add(item);
        }

        
Get 'FlightLegDetails' element item by position.

Parameters:
index
Returns:
item
        public FlightLegDetails getFlightLegDetail(int index) {
            return .get(index);
        }

        
Remove all 'FlightLegDetails' element items.
        public void clearFlightLegDetailList() {
            .clear();
        }

        
Get the 'AirDetailsRSAttributes' attributeGroup value.

Returns:
value
            return ;
        }

        
Set the 'AirDetailsRSAttributes' attributeGroup value.

Parameters:
airDetailsRSAttributes
        public void setAirDetailsRSAttributes(
                AirDetailsRSAttributes airDetailsRSAttributes) {
            this. = airDetailsRSAttributes;
        }

        
Get the 'CabinQty' attribute value. The total quantity of cabins for the departure Airport/City equipment type. This is typically used in conjunction with the FlightLoadInfo information in the FlightLegDetails element.

Returns:
value
        public String getCabinQty() {
            return ;
        }

        
Set the 'CabinQty' attribute value. The total quantity of cabins for the departure Airport/City equipment type. This is typically used in conjunction with the FlightLoadInfo information in the FlightLegDetails element.

Parameters:
cabinQty
        public void setCabinQty(String cabinQty) {
            this. = cabinQty;
        }
        
Construct for holding flight leg information. Schema fragment(s) for this class:
 <xs:element xmlns:ns="http://www.opentravel.org/OTA/2003/05/common" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="FlightLegDetails" maxOccurs="10">
   <xs:complexType>
     <xs:sequence>
       <xs:element name="DepartureAirport" minOccurs="0">
         <xs:complexType>
           <xs:attributeGroup ref="ns:AirportLocationGroup"/>
         </xs:complexType>
       </xs:element>
       <xs:element name="ArrivalAirport" minOccurs="0">
         <xs:complexType>
           <xs:attributeGroup ref="ns:AirportLocationGroup"/>
         </xs:complexType>
       </xs:element>
       <xs:element type="ns:CompanyNameType" name="MarketingAirline" minOccurs="0"/>
       <xs:element type="ns:OperatingAirlineType" name="OperatingAirline" minOccurs="0"/>
       <xs:element type="ns:EquipmentType" name="Equipment" minOccurs="0"/>
       <xs:element type="ns:FreeTextType" name="Comment" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element type="ns:CabinAvailabilityType" name="MarketingCabinAvailability" minOccurs="0" maxOccurs="9"/>
       <xs:element type="ns:WarningsType" name="Warnings" minOccurs="0"/>
     </xs:sequence>
     <xs:attribute type="xs:int" use="required" name="SequenceNumber"/>
     <xs:attribute type="xs:string" use="required" name="FlightNumber"/>
     <xs:attribute type="xs:string" use="optional" name="JourneyDuration"/>
     <xs:attribute type="xs:string" use="optional" name="GroundDuration"/>
     <xs:attributeGroup ref="ns:SmokingIndicatorGroup"/>
     <xs:attribute type="xs:float" use="optional" name="OnTimeRate"/>
     <xs:attribute type="ns:TicketType" name="Ticket"/>
     <xs:attribute type="xs:dateTime" use="optional" name="DepartureDateTime"/>
     <xs:attribute type="xs:dateTime" use="optional" name="ArrivalDateTime"/>
     <xs:attribute type="ns:DayOfWeekType" use="optional" name="DepartureDayOfWeek"/>
     <xs:attribute type="xs:string" use="optional" name="LegDistance"/>
     <xs:attribute use="optional" name="DateChangeNbr">
       <xs:simpleType>
         <!-- Reference to inner class DateChangeNbr -->
       </xs:simpleType>
     </xs:attribute>
   </xs:complexType>
 </xs:element>
 
 <xs:attributeGroup xmlns:ns="http://www.opentravel.org/OTA/2003/05/common" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="SmokingIndicatorGroup">
   <xs:attribute type="xs:boolean" use="optional" name="SmokingAllowed"/>
 </xs:attributeGroup>
 
        public static class FlightLegDetails
        {
            private AirportLocationGroup departureAirport;
            private AirportLocationGroup arrivalAirport;
            private CompanyName marketingAirline;
            private OperatingAirline operatingAirline;
            private Equipment equipment;
            private List<FreeTextcommentList = new ArrayList<FreeText>();
            private Warnings warnings;
            private Integer sequenceNumber;
            private String flightNumber;
            private String journeyDuration;
            private String groundDuration;
            private Boolean smokingAllowed;
            private Float onTimeRate;
            private Ticket ticket;
            private DateTime departureDateTime;
            private DateTime arrivalDateTime;
            private DayOfWeek departureDayOfWeek;
            private String legDistance;
            private DateChangeNbr dateChangeNbr;

            
Get the 'AirportLocationGroup' attributeGroup value. The departure airport of the flight leg.

Returns:
value
            public AirportLocationGroup getDepartureAirport() {
                return ;
            }

            
Set the 'AirportLocationGroup' attributeGroup value. The departure airport of the flight leg.

Parameters:
departureAirport
            public void setDepartureAirport(
                    AirportLocationGroup departureAirport) {
                this. = departureAirport;
            }

            
Get the 'AirportLocationGroup' attributeGroup value. The arrival airport of the flight leg.

Returns:
value
            public AirportLocationGroup getArrivalAirport() {
                return ;
            }

            
Set the 'AirportLocationGroup' attributeGroup value. The arrival airport of the flight leg.

Parameters:
arrivalAirport
            public void setArrivalAirport(AirportLocationGroup arrivalAirport) {
                this. = arrivalAirport;
            }

            
Get the 'MarketingAirline' element value. The marketing airline.

Returns:
value
            public CompanyName getMarketingAirline() {
                return ;
            }

            
Set the 'MarketingAirline' element value. The marketing airline.

Parameters:
marketingAirline
            public void setMarketingAirline(CompanyName marketingAirline) {
                this. = marketingAirline;
            }

            
Get the 'OperatingAirline' element value. The air carrier engaged directly in the operation of the flight.

Returns:
value
            public OperatingAirline getOperatingAirline() {
                return ;
            }

            
Set the 'OperatingAirline' element value. The air carrier engaged directly in the operation of the flight.

Parameters:
operatingAirline
            public void setOperatingAirline(OperatingAirline operatingAirline) {
                this. = operatingAirline;
            }

            
Get the 'Equipment' element value. The type of equipment used for the flight.

Returns:
value
            public Equipment getEquipment() {
                return ;
            }

            
Set the 'Equipment' element value. The type of equipment used for the flight.

Parameters:
equipment
            public void setEquipment(Equipment equipment) {
                this. = equipment;
            }

            
Get the list of 'Comment' element items. Any special comments on the leg, (eg. operated by XX.)

Returns:
list
            public List<FreeTextgetCommentList() {
                return ;
            }

            
Set the list of 'Comment' element items. Any special comments on the leg, (eg. operated by XX.)

Parameters:
list
            public void setCommentList(List<FreeTextlist) {
                 = list;
            }

            
Get the number of 'Comment' element items.

Returns:
count
            public int sizeCommentList() {
                return .size();
            }

            
Add a 'Comment' element item.

Parameters:
item
            public void addComment(FreeText item) {
                .add(item);
            }

            
Get 'Comment' element item by position.

Parameters:
index
Returns:
item
            public FreeText getComment(int index) {
                return .get(index);
            }

            
Remove all 'Comment' element items.
            public void clearCommentList() {
                .clear();
            }

            
Get the list of 'MarketingCabinAvailability' element items. Identifies the cabins available for the flight.

Returns:
list
            public List<CabinAvailabilitygetMarketingCabinAvailabilityList() {
                return ;
            }

            
Set the list of 'MarketingCabinAvailability' element items. Identifies the cabins available for the flight.

Parameters:
list
            public void setMarketingCabinAvailabilityList(
                    List<CabinAvailabilitylist) {
                 = list;
            }

            
Get the number of 'MarketingCabinAvailability' element items.

Returns:
count
            public int sizeMarketingCabinAvailabilityList() {
                return .size();
            }

            
Add a 'MarketingCabinAvailability' element item.

Parameters:
item
            public void addMarketingCabinAvailability(CabinAvailability item) {
                .add(item);
            }

            
Get 'MarketingCabinAvailability' element item by position.

Parameters:
index
Returns:
item
            public CabinAvailability getMarketingCabinAvailability(int index) {
                return .get(index);
            }

            
Remove all 'MarketingCabinAvailability' element items.
            public void clearMarketingCabinAvailabilityList() {
                .clear();
            }

            
Get the 'Warnings' element value. Warning information for this flight leg.

Returns:
value
            public Warnings getWarnings() {
                return ;
            }

            
Set the 'Warnings' element value. Warning information for this flight leg.

Parameters:
warnings
            public void setWarnings(Warnings warnings) {
                this. = warnings;
            }

            
Get the 'SequenceNumber' attribute value. The sequence number of the flight leg.

Returns:
value
            public Integer getSequenceNumber() {
                return ;
            }

            
Set the 'SequenceNumber' attribute value. The sequence number of the flight leg.

Parameters:
sequenceNumber
            public void setSequenceNumber(Integer sequenceNumber) {
                this. = sequenceNumber;
            }

            
Get the 'FlightNumber' attribute value. The flight number of the flight.

Returns:
value
            public String getFlightNumber() {
                return ;
            }

            
Set the 'FlightNumber' attribute value. The flight number of the flight.

Parameters:
flightNumber
            public void setFlightNumber(String flightNumber) {
                this. = flightNumber;
            }

            
Get the 'JourneyDuration' attribute value. The duration of the flight from departure location to destination location.

Returns:
value
            public String getJourneyDuration() {
                return ;
            }

            
Set the 'JourneyDuration' attribute value. The duration of the flight from departure location to destination location.

Parameters:
journeyDuration
            public void setJourneyDuration(String journeyDuration) {
                this. = journeyDuration;
            }

            
Get the 'GroundDuration' attribute value. The duration of a ground stop.

Returns:
value
            public String getGroundDuration() {
                return ;
            }

            
Set the 'GroundDuration' attribute value. The duration of a ground stop.

Parameters:
groundDuration
            public void setGroundDuration(String groundDuration) {
                this. = groundDuration;
            }

            
Get the 'SmokingAllowed' attribute value. Indicates smoking is allowed when true and is not allowed when false. <LegacyDefaultValue>false</LegacyDefaultValue>

Returns:
value
            public Boolean getSmokingAllowed() {
                return ;
            }

            
Set the 'SmokingAllowed' attribute value. Indicates smoking is allowed when true and is not allowed when false. <LegacyDefaultValue>false</LegacyDefaultValue>

Parameters:
smokingAllowed
            public void setSmokingAllowed(Boolean smokingAllowed) {
                this. = smokingAllowed;
            }

            
Get the 'OnTimeRate' attribute value. Specifies the Dept. of Transport on time rate of the flight.

Returns:
value
            public Float getOnTimeRate() {
                return ;
            }

            
Set the 'OnTimeRate' attribute value. Specifies the Dept. of Transport on time rate of the flight.

Parameters:
onTimeRate
            public void setOnTimeRate(Float onTimeRate) {
                this. = onTimeRate;
            }

            
Get the 'Ticket' attribute value. Specifies if the flight is e-ticketable or not. <LegacyDefaultValue xmlns="http://www.opentravel.org/OTA/2003/05/common">Paper</LegacyDefaultValue>

Returns:
value
            public Ticket getTicket() {
                return ;
            }

            
Set the 'Ticket' attribute value. Specifies if the flight is e-ticketable or not. <LegacyDefaultValue xmlns="http://www.opentravel.org/OTA/2003/05/common">Paper</LegacyDefaultValue>

Parameters:
ticket
            public void setTicket(Ticket ticket) {
                this. = ticket;
            }

            
Get the 'DepartureDateTime' attribute value. Scheduled flight departure date/time for flight leg.

Returns:
value
            public DateTime getDepartureDateTime() {
                return ;
            }

            
Set the 'DepartureDateTime' attribute value. Scheduled flight departure date/time for flight leg.

Parameters:
departureDateTime
            public void setDepartureDateTime(DateTime departureDateTime) {
                this. = departureDateTime;
            }

            
Get the 'ArrivalDateTime' attribute value. Scheduled flight arrival date/time for flight leg.

Returns:
value
            public DateTime getArrivalDateTime() {
                return ;
            }

            
Set the 'ArrivalDateTime' attribute value. Scheduled flight arrival date/time for flight leg.

Parameters:
arrivalDateTime
            public void setArrivalDateTime(DateTime arrivalDateTime) {
                this. = arrivalDateTime;
            }

            
Get the 'DepartureDayOfWeek' attribute value. A three letter abbreviation for the day of the week as specified in the departure date.

Returns:
value
            public DayOfWeek getDepartureDayOfWeek() {
                return ;
            }

            
Set the 'DepartureDayOfWeek' attribute value. A three letter abbreviation for the day of the week as specified in the departure date.

Parameters:
departureDayOfWeek
            public void setDepartureDayOfWeek(DayOfWeek departureDayOfWeek) {
                this. = departureDayOfWeek;
            }

            
Get the 'LegDistance' attribute value. The number of miles for this flight leg.

Returns:
value
            public String getLegDistance() {
                return ;
            }

            
Set the 'LegDistance' attribute value. The number of miles for this flight leg.

Parameters:
legDistance
            public void setLegDistance(String legDistance) {
                this. = legDistance;
            }

            
Get the 'DateChangeNbr' attribute value. When present contains the number of days by which the flight's arrival date differs from its departure date.

Returns:
value
            public DateChangeNbr getDateChangeNbr() {
                return ;
            }

            
Set the 'DateChangeNbr' attribute value. When present contains the number of days by which the flight's arrival date differs from its departure date.

Parameters:
dateChangeNbr
            public void setDateChangeNbr(DateChangeNbr dateChangeNbr) {
                this. = dateChangeNbr;
            }
            
Schema fragment(s) for this class:
 <xs:simpleType xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:restriction base="xs:string">
     <xs:enumeration value="-1"/>
     <xs:enumeration value="+1"/>
     <xs:enumeration value="+2"/>
   </xs:restriction>
 </xs:simpleType>
 
            public static enum DateChangeNbr {
                
The date of arrival is 1 day before the departure date.
                _1("-1"), 
The date of arrival is 1 day after the departure date.
                _1a("+1"), 
The date of arrival is 2 days after the departure date.
                _2("+2");
                private final String value;
                private DateChangeNbr(String value) {
                    this. = value;
                }
                public String xmlValue() {
                    return ;
                }
                public static DateChangeNbr convert(String value) {
                    for (DateChangeNbr inst : values()) {
                        if (inst.xmlValue().equals(value)) {
                            return inst;
                        }
                    }
                    return null;
                }
            }
        }
    }
New to GrepCode? Check out our FAQ X