Examples of PriceInfo


Examples of org.switchyard.quickstarts.camel.sap.binding.bean.PriceInfo

        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);
                }
            }
View Full Code Here

Examples of ru.snake.amazonwatcher.model.PriceInfo

  public static void updateProductPrice(AbstractProductModel model, int index) {
    ProductInfo pi = model.get(index);
    SiteParser parser = ParserFactory.createParser(pi.getHost());

    if (parser != null) {
      PriceInfo newPrice;

      parser.parseUrl(pi.getUrl());

      newPrice = parser.getPrice();

      if (newPrice.getPrice() > 0.01f
          && Math.abs(newPrice.getPrice() - pi.getPrice()) > 0.01f) {
        try {
          new PriceChangedDialog(pi, newPrice);
        } catch (Exception e) {
        }
      }
View Full Code Here

Examples of ru.snake.amazonwatcher.model.PriceInfo

          SiteParser parser = ParserFactory.createParser(pi.getHost());

          setStatus(pi.getName());

          if (parser != null) {
            PriceInfo newPrice;

            parser.parseUrl(pi.getUrl());
            newPrice = parser.getPrice();

            pi.setPriceInfo(newPrice);
View Full Code Here

Examples of ru.snake.amazonwatcher.model.PriceInfo

  protected static final String PRICE_CURR = "EUR";

  public AmazonParser() {
    super();

    price = new PriceInfo(PRICE_CURR);
  }
View Full Code Here

Examples of ru.snake.amazonwatcher.model.PriceInfo

      if (parts.length == 1) {
        return parts[0];
      }

      if (parts.length == 2) {
        price = new PriceInfo(parts[0]);

        return parts[1];
      }
    }
View Full Code Here

Examples of ru.snake.amazonwatcher.model.PriceInfo

  protected static final String PRICE_CURR = "GBP";

  public GameCoParser() {
    super();

    price = new PriceInfo(PRICE_CURR);
  }
View Full Code Here

Examples of ru.snake.amazonwatcher.model.PriceInfo

  protected String parseDocument(Document document) {
    Element element = document.select("div.our-price").first();
    Element currency = document.select("div.our-price > meta").first();

    if (currency != null) {
      price = new PriceInfo(currency.attr("content"));
    }

    if (element != null) {
      return element.text().trim();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.