Example usage for java.lang Integer toString

List of usage examples for java.lang Integer toString

Introduction

In this page you can find the example usage for java.lang Integer toString.

Prototype

public String toString() 

Source Link

Document

Returns a String object representing this Integer 's value.

Usage

From source file:org.sakaiproject.metaobj.utils.ioc.ApplicationContextFactory.java

public String[] getConfigLocations(Properties props) throws IOException {
    SortedMap configFiles = new TreeMap();
    for (Enumeration e = props.keys(); e.hasMoreElements();) {
        Integer key = new Integer((String) e.nextElement());
        String curFile = props.getProperty(key.toString());
        curFile = (!curFile.startsWith("/")) ? "/" + curFile : curFile;
        configFiles.put(key, curFile);//from   w  w  w. j a  v a  2 s . co m
        logger.info("registering '" + curFile + "' in position " + key + " as spring bean definition file");
    }
    return convertToArray(configFiles.values());
}

From source file:org.ala.hbase.InfosourceUidLoader.java

private Map<String, String> getUidInfosourceIdMap() {
    Map<String, String> uidInfosourceIDMap = new HashMap<String, String>();

    List<Integer> infosourceIdList = infosourceDao.getIdsforAll();

    for (Integer infosourceId : infosourceIdList) {
        String uid = infosourceDao.getUidByInfosourceId(infosourceId.toString());
        uidInfosourceIDMap.put(infosourceId.toString(), uid);
    }//from   w  ww.j a  v  a2  s.c om

    return uidInfosourceIDMap;
}

From source file:cn.edu.xmu.comm.action.json.TempParkingBillAddAction.java

public String execute() {
    try {//from w  ww .j a v a  2 s .  c o m
        license = URLDecoder.decode(license, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    data = new HashMap<String, Object>();
    Boolean hasFreeParkPlace = parkingService.hasFreeTempParkPlace();
    Boolean hasOwner = propertyService.hasOwner(ownerId);
    data.put("hasFreeParkPlace", hasFreeParkPlace ? "true" : "false");
    data.put("hasOwner", hasOwner ? "true" : "false");
    if (hasFreeParkPlace && hasOwner) {
        Integer parkBillId = parkingService.addParkBill(ownerId, license).getId();
        data.put("parkBillId", parkBillId.toString());
    }
    return SUCCESS;
}

From source file:org.openlmis.upload.parser.CSVParser.java

private void createHeaderException(String error, String[] headers, SuperCsvException exception) {
    CsvContext csvContext = exception.getCsvContext();
    String header = headers[csvContext.getColumnNumber() - 1];
    Integer rowNum = csvContext.getRowNumber() - 1;
    throw new UploadException(error, header, "of Record No. ", rowNum.toString());
}

From source file:hello.processors.MulProcessor.java

/**
 * When you receive a message, print it out, then shut down the application.
 * Finally, clean up any ActiveMQ server stuff.
 *//*from  ww w.  j av  a2 s .  co m*/
@JmsListener(destination = "mul_queue", containerFactory = "queueJmsContainerFactory")
public void receiveMessage(String message) {
    System.out.println("Processing : " + message);

    JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class);

    String[] split = message.split("\\*");
    try {

        Integer a = Integer.parseInt(split[0]);
        Integer b = Integer.parseInt(split[1]);

        Integer result = a * b;
        jmsTemplate.convertAndSend(new ActiveMQTopic("mul_response_topic"),
                message + " = " + result.toString());

    } catch (NumberFormatException e) {
        jmsTemplate.convertAndSend(new ActiveMQTopic("mul_response_topic"), message);
    }
}

From source file:hello.processors.SubProcessor.java

/**
 * When you receive a message, print it out, then shut down the application.
 * Finally, clean up any ActiveMQ server stuff.
 *//*from www .j  a va 2  s .  c o m*/
@JmsListener(destination = "sub_queue", containerFactory = "queueJmsContainerFactory")
public void receiveMessage(String message) {
    System.out.println("Processing : " + message);

    JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class);

    String[] split = message.split("-");
    try {

        Integer a = Integer.parseInt(split[0]);
        Integer b = Integer.parseInt(split[1]);

        Integer result = a - b;
        jmsTemplate.convertAndSend(new ActiveMQTopic("sub_response_topic"),
                message + " = " + result.toString());

    } catch (NumberFormatException e) {
        jmsTemplate.convertAndSend(new ActiveMQTopic("sub_response_topic"), "Cannot parse request: " + message);
    }
}

From source file:com.eucalyptus.webui.server.ConfigurationWebBackend.java

private static void serializeStorageConfiguration(String type, String name, String partition, String host,
        Integer port, List<ComponentProperty> properties, String state, SearchResultRow result) {
    // Common fields
    result.addField(makeConfigId(name, type));
    result.addField(name);//from  w ww . j  a  v  a2  s .co m
    result.addField(partition);
    result.addField(type);
    result.addField(host);
    result.addField(port == null ? null : port.toString());
    result.addField(state);
    // Dynamic fields
    serializeComponentProperties(properties, result);
}

From source file:org.openlmis.upload.parser.CSVParser.java

private void createDataException(String error, String[] headers, SuperCsvException exception) {
    CsvContext csvContext = exception.getCsvContext();
    Integer rowNum = csvContext.getRowNumber() - 1;
    throw new UploadException(error, headers.toString(), "in Record No. ", rowNum.toString(),
            csvContext.getRowSource().toString());
}

From source file:edu.harvard.mcz.imagecapture.MCZENTBarcode.java

public String makeFromNumber(Integer aNumber) {
    String result = null;/*  www .j  a v a2  s  . c o  m*/
    if (aNumber != null) {
        if (aNumber.toString().length() <= DIGITS) {
            if (aNumber >= 0) {
                String digits = Integer.valueOf(DIGITS).toString();
                result = PREFIX + String.format("%0" + digits + "d", aNumber);
            }
        }
    }
    return result;
}

From source file:io.pivotal.strepsirrhini.chaosloris.destroyer.CloudFoundryPlatform.java

@Override
public Mono<Void> terminateInstance(Application application, Integer index) {
    return requestTerminateInstance(this.cloudFoundryClient, application.getApplicationId().toString(),
            index.toString()).doOnSubscribe(s -> this.logger.info("Terminate {}/{}", application, index))
                    .doOnSuccess(v -> this.logger.debug("Terminated {}/{}", application, index));
}