Structure prices = (Structure) flightConnectionGetDetailResponse.get("PRICE_INFO", Structure.class);
if (prices != null) {
// Create price info object.
PriceInfo priceInfo = new PriceInfo();
// Add economy class airfare to availability if set.
BigDecimal economyClassAirfare = prices.get("PRICE_ECO1", BigDecimal.class);
if (economyClassAirfare != null) {
priceInfo.setEconomyClassAirfare(economyClassAirfare.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set economy class airfare = '{}' in seat availibility", economyClassAirfare);
}
}
// Add economy class child airfare to availability if set.
BigDecimal economyClassChildAirfare = prices.get("PRICE_ECO2", BigDecimal.class);
if (economyClassChildAirfare != null) {
priceInfo.setEconomyClassChildAirfare(economyClassChildAirfare.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set economy class child airfare = '{}' in seat availibility", economyClassChildAirfare);
}
}
// Add economy class small child airfare to availability if set.
BigDecimal economyClassSmallChildAirfare = prices.get("PRICE_ECO3", BigDecimal.class);
if (economyClassSmallChildAirfare != null) {
priceInfo.setEconomyClassSmallChildAirfare(economyClassSmallChildAirfare.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set economy class small child airfare = '{}' in seat availibility", economyClassSmallChildAirfare);
}
}
// Add business class airfare to availability if set.
BigDecimal businessClassAirfare = prices.get("PRICE_BUS1", BigDecimal.class);
if (businessClassAirfare != null) {
priceInfo.setBusinessClassAirfare(businessClassAirfare.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set business class airfare = '{}' in seat availibility", businessClassAirfare);
}
}
// Add business class child airfare to availability if set.
BigDecimal businessClassChildAirfare = prices.get("PRICE_BUS2", BigDecimal.class);
if (businessClassChildAirfare != null) {
priceInfo.setBusinessClassChildAirfare(businessClassChildAirfare.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set business class child airfare = '{}' in seat availibility", businessClassChildAirfare);
}
}
// Add business class small child airfare to availability if set.
BigDecimal businessClassSmallChildAirfare = prices.get("PRICE_BUS3", BigDecimal.class);
if (businessClassSmallChildAirfare != null) {
priceInfo.setBusinessClassSmallChildAirfare(businessClassSmallChildAirfare.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set business class small child airfare = '{}' in seat availibility", businessClassSmallChildAirfare);
}
}
// Add first class airfare to availability if set.
BigDecimal firstClassAirfare = prices.get("PRICE_FST1", BigDecimal.class);
if (firstClassAirfare != null) {
priceInfo.setBusinessClassAirfare(firstClassAirfare.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set first class airfare = '{}' in seat availibility", firstClassAirfare);
}
}
// Add first class child airfare to availability if set.
BigDecimal firstClassChildAirfare = prices.get("PRICE_FST2", BigDecimal.class);
if (firstClassChildAirfare != null) {
priceInfo.setBusinessClassChildAirfare(firstClassChildAirfare.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set first class child airfare = '{}' in seat availibility", firstClassChildAirfare);
}
}
// Add first class child airfare to availability if set.
BigDecimal firstClassSmallChildAirfare = prices.get("PRICE_FST3", BigDecimal.class);
if (firstClassSmallChildAirfare != null) {
priceInfo.setBusinessClassSmallChildAirfare(firstClassSmallChildAirfare.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set first class small child airfare = '{}' in seat availibility", firstClassSmallChildAirfare);
}
}
// Add first class small child airfare to availability if set.
BigDecimal flightTaxes = prices.get("TAX", BigDecimal.class);
if (flightTaxes != null) {
priceInfo.setFlightTaxes(flightTaxes.toString());
if (LOG.isDebugEnabled()) {
LOG.debug("Set flight taxes = '{}' in seat availibility", flightTaxes);
}
}
// Add currency type to availability if set.
String currency = prices.get("CURR", String.class);
if (currency != null) {
priceInfo.setCurrency(currency);
if (LOG.isDebugEnabled()) {
LOG.debug("Set local currency = '{}' in seat availibility", currency);
}
}
// Add currency code to availability if set.
String currencyIso = prices.get("CURR_ISO", String.class);
if (currencyIso != null) {
priceInfo.setCurrencyIso(currencyIso);
if (LOG.isDebugEnabled()) {
LOG.debug("Set local currency iso code = '{}' in seat availibility", currencyIso);
}
}