Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  
  package org.jibx.schema.org.opentravel._2012B.cruise;
  
  import java.util.List;
The Fare Availability Response message contains fares availability for a given sailing with a specific Mode of Transportation/GatewayCity pair and currency. For each fare the following information may be returned: Fare Code; Status code; First and second dining services status; Fare indicator; Alternate available modes of transportation; Alternate available currencies; Cruise package information; and Group Code. This message does not return fare amounts. Fare availability returns the different fare codes that the cruise line uses to group categories. Examples of fare codes are "best fare" or "past passenger fare." 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_CruiseFareAvailRS">
   <xs:complexType>
     <xs:choice>
       <xs:sequence>
         <xs:element type="ns:SuccessType" name="Success"/>
         <xs:element type="ns:WarningsType" name="Warnings" minOccurs="0"/>
         <xs:element type="ns:SailingType" name="SailingInfo" minOccurs="0"/>
         <xs:element name="AlternateCurrencyList" minOccurs="0" maxOccurs="5">
           <xs:complexType>
             <xs:attributeGroup ref="ns:CurrencyCodeGroup"/>
           </xs:complexType>
         </xs:element>
         <xs:element name="FareCodeOptions" minOccurs="0">
           <!-- Reference to inner class FareCodeOptions -->
         </xs:element>
         <xs:element ref="ns:TPA_Extensions" minOccurs="0"/>
       </xs:sequence>
       <xs:element type="ns:ErrorsType" name="Errors"/>
     </xs:choice>
     <xs:attributeGroup ref="ns:OTA_PayloadStdAttributes"/>
     <xs:attributeGroup ref="ns:ResponseGroup"/>
   </xs:complexType>
 </xs:element>
 
 
 public class FareAvailRS
 {
     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 Sailing sailingInfo;
     private FareCodeOptions fareCodeOptions;
     private TPAExtensions TPAExtensions;
     private Errors errors;
     private ResponseGroup responseGroup;
 
     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 'SailingInfo' element value. Specifies the selected sailing information.

Returns:
value
    public Sailing getSailingInfo() {
        return ;
    }

    
Set the 'SailingInfo' element value. Specifies the selected sailing information.

Parameters:
sailingInfo
    public void setSailingInfo(Sailing sailingInfo) {
        this. = sailingInfo;
    }

    
Get the list of 'AlternateCurrencyList' element items. Other available currencies for this sailing.

Returns:
list
        return ;
    }

    
Set the list of 'AlternateCurrencyList' element items. Other available currencies for this sailing.

Parameters:
list
    public void setAlternateCurrencyList(List<CurrencyCodeGrouplist) {
         = list;
    }

    
Get the number of 'AlternateCurrencyList' element items.

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

    
Add a 'AlternateCurrencyList' element item.

Parameters:
item
    public void addAlternateCurrency(CurrencyCodeGroup item) {
        .add(item);
    }

    
Get 'AlternateCurrencyList' element item by position.

Parameters:
index
Returns:
item
    public CurrencyCodeGroup getAlternateCurrency(int index) {
        return .get(index);
    }

    
Remove all 'AlternateCurrencyList' element items.
    public void clearAlternateCurrencyList() {
        .clear();
    }

    
Get the 'FareCodeOptions' element value.

Returns:
value
        return ;
    }

    
Set the 'FareCodeOptions' element value.

Parameters:
fareCodeOptions
    public void setFareCodeOptions(FareCodeOptions fareCodeOptions) {
        this. = fareCodeOptions;
    }

    
Get the 'TPA_Extensions' element value.

Returns:
value
    public TPAExtensions getTPAExtensions() {
        return ;
    }

    
Set the 'TPA_Extensions' element value.

Parameters:
TPAExtensions
    public void setTPAExtensions(TPAExtensions TPAExtensions) {
        this. = TPAExtensions;
    }

    
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. The standard attributes that appear on the root element for all OpenTravel Messages.

Returns:
value
        return ;
    }

    
Set the 'OTA_PayloadStdAttributes' attributeGroup value. The standard attributes that appear on the root element for all OpenTravel Messages.

Parameters:
OTAPayloadStdAttributes
    public void setOTAPayloadStdAttributes(
            OTAPayloadStdAttributes OTAPayloadStdAttributes) {
        this. = OTAPayloadStdAttributes;
    }

    
Get the 'ResponseGroup' attributeGroup value. Indicates that additional records are available and provides the echo token to be used to retrieve those records.

Returns:
value
    public ResponseGroup getResponseGroup() {
        return ;
    }

    
Set the 'ResponseGroup' attributeGroup value. Indicates that additional records are available and provides the echo token to be used to retrieve those records.

Parameters:
responseGroup
    public void setResponseGroup(ResponseGroup responseGroup) {
        this. = responseGroup;
    }
    
Specifies the different fare options available for the selected sailing. 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="FareCodeOptions" minOccurs="0">
   <xs:complexType>
     <xs:sequence>
       <xs:element type="ns:FareCodeOptionType" name="FareCodeOption" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
    public static class FareCodeOptions
    {
        private List<FareCodeOptionfareCodeOptionList = new ArrayList<FareCodeOption>();

        
Get the list of 'FareCodeOption' element items. Specifies the fare information available for the selected sailing.

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

        
Set the list of 'FareCodeOption' element items. Specifies the fare information available for the selected sailing.

Parameters:
list
        public void setFareCodeOptionList(List<FareCodeOptionlist) {
             = list;
        }

        
Get the number of 'FareCodeOption' element items.

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

        
Add a 'FareCodeOption' element item.

Parameters:
item
        public void addFareCodeOption(FareCodeOption item) {
            .add(item);
        }

        
Get 'FareCodeOption' element item by position.

Parameters:
index
Returns:
item
        public FareCodeOption getFareCodeOption(int index) {
            return .get(index);
        }

        
Remove all 'FareCodeOption' element items.
        public void clearFareCodeOptionList() {
            .clear();
        }
    }
New to GrepCode? Check out our FAQ X