All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.almis.awe.test.wrappers.Casa Maven / Gradle / Ivy

There is a newer version: 0.0.13
Show newest version
package com.almis.awe.test.wrappers;

import com.almis.awe.exception.AWException;
import com.almis.awe.model.dto.DataList;
import com.almis.awe.model.dto.RequestWrapper;
import com.almis.awe.model.dto.ResponseWrapper;
import com.almis.awe.model.dto.ServiceData;
import com.almis.awe.service.data.builder.DataListBuilder;
import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * Test wrapper for JMS sending
 * 
 * @author pgarcia and pvidal
 */
@XStreamAlias("Casa")
public class Casa implements RequestWrapper, ResponseWrapper {

  @XStreamAlias("Ventanas")
  Integer ventanas;

  @XStreamAlias("Puertas")
  Integer puertas;

  @Override
  public void setParameters(Map parameterMap) {
    ventanas = (Integer) parameterMap.get("CrtVen");
    puertas = (Integer) parameterMap.get("CrtPue");
  }

  @Override
  public ServiceData toServiceData() throws AWException {
    List listaVentanas = Arrays.asList(new Integer[]{ventanas});
    List listaPuertas = Arrays.asList(new Integer[]{puertas});
    DataList datalist = new DataListBuilder()
        .addColumn("OutFld1", listaVentanas, "INTEGER")
        .addColumn("OutFld2", listaPuertas, "INTEGER")
        .build();
    return new ServiceData()
            .setDataList(datalist);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy