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:com.greenline.hrs.admin.user.service.ManUserService.java

/**
 * /*from   www.  ja  va2 s . c o m*/
 *
 * @param uid
 * @return ?????null.
 */
public UserAuthInfo getUserAuthInfo(long uid) {
    UserAuthInfo userAuthInfo = new UserAuthInfo(String.valueOf(uid));
    Set<Integer> groupIds = manUserGroupBiz.getGroupIdsByUid(uid);
    Set<Integer> roleIds = manGroupRoleBiz.getRoleIdsByGroupIds(groupIds);
    roleIds.addAll(manUserRoleBiz.getRoleIdsByUid(uid));
    if (!roleIds.isEmpty()) {
        for (Integer roleId : roleIds) {
            userAuthInfo.addRole(roleId.toString());
        }
        Set<Integer> permissionIds = manRoleResourceBiz.getResourceIdsByRoleIds(roleIds);
        Set<String> permissions = manResourceBiz.getPermissionByIds(permissionIds);
        userAuthInfo.setPermissions(permissions);
    }

    return userAuthInfo;
}

From source file:org.atomsphere.management.web.properties.WebSystemPropertiesService.java

public Integer getInteger(String key, Integer defaultValue) {
    String value = get(key, defaultValue != null ? defaultValue.toString() : null);
    if (StringUtils.isNumeric(value) && StringUtils.isNotEmpty(value)) {
        return Integer.valueOf(value);
    }/* w  w  w. ja  v a  2s .  c  o m*/

    return defaultValue;
}

From source file:com.github.nbyl.xfdcontrol.plugins.notification.blink1.Blink1ToolCommand.java

public Blink1ToolCommand setBlinkCount(Integer blinkCount) {
    this.commandLine.addArgument("--blink");
    this.commandLine.addArgument(blinkCount.toString());
    return this;
}

From source file:gov.nih.nci.cabig.ctms.editors.DaoBasedEditor.java

@Override
public String getAsText() {
    DomainObject domainObj = (DomainObject) getValue();
    if (domainObj == null) {
        return null;
    } else {/*from   w  w  w  . j ava2  s.c  om*/
        Integer id = domainObj.getId();
        return id == null ? null : id.toString();
    }
}

From source file:org.codehaus.groovy.grails.plugins.springsecurity.bcrypt.BCryptPasswordEncoder.java

/**
 * Hash the supplied password using jBCrypt.
 *
 * @param rawPass <p>the user supplied plain text password</p>
 * @param salt <p>ignored, uses a random salt instead</p>
 * @return the hashed password/*w w  w.java  2  s.c o m*/
 * @throws DataAccessException
 */
public String encodePassword(String rawPass, Object salt) throws DataAccessException {
    Integer logRounds = BCryptUtils.getLogRounds();
    logger.debug("Encoding password. (log rounds: " + logRounds.toString() + ")");
    return BCrypt.hashpw(rawPass, BCrypt.gensalt(logRounds));
}

From source file:com.git.ifly6.nsapi.builders.NSNationQueryBuilder.java

/** Returns the relevant NS API <code>String</code> that can be used to create the relevant URL which can then call
 * the document desired.//from   w w  w . jav a 2 s. com
 * @see java.lang.Object#toString() */
@Override
public String toString() {

    for (NSNationShard shard : queryShards) {
        builder.append(shard.toString() + "+");
    }

    if (censusShards.size() > 0) {

        List<Integer> cScores = new ArrayList<>(censusShards.size());
        for (Pair<NSNationShard, Integer> pair : censusShards) {
            cScores.add(pair.getRight());
        }

        builder.append("census;mode=score;scale=");

        for (Integer cScore : cScores) {
            builder.append(cScore.toString() + "+");
        }

    }

    String output = builder.toString();
    return output.endsWith("+") ? output.substring(0, output.length() - 1) : output;

}

From source file:nc.noumea.mairie.appock.core.impl.ConfigServiceImplTest.java

@Test
public void testGetValeurInt() {
    Integer valeurInt = 12;
    createAndSaveConfig("TEST_INT", valeurInt.toString());
    Assert.assertEquals(configService.getValeurInt("TEST_INT", true), valeurInt);
}

From source file:apps.provisioning.CommandsTest.java

@Test
public void testPortArg() {
    Integer expectedPort = new Integer(8081);
    String[] args = { "-port", expectedPort.toString() };
    createCommands(args);//from  www .ja  v a  2s. com

    Assert.assertNotNull(commands);
    Assert.assertTrue(commands.hasCommand(Commands.PORT_COMMAND_OPTION));
    Assert.assertEquals(expectedPort, commands.getCommandIntValue(Commands.PORT_COMMAND_OPTION));
}

From source file:com.opengamma.analytics.financial.curve.CurveConstructionXCcyTest.java

@SuppressWarnings("rawtypes")
private static DoubleTimeSeries[] getTSSwapFixedON(Boolean withToday, Integer unit) {
    switch (unit) {
    case 0://  w w w  .j  a  va2 s. co m
        return withToday ? TS_FIXED_OIS_USD_WITH_TODAY : TS_FIXED_OIS_USD_WITHOUT_TODAY;
    default:
        throw new IllegalArgumentException(unit.toString());
    }
}

From source file:com.netscape.certsrv.key.KeyGenerationRequest.java

/**
 * @param keySize the key size to set
 */
public void setKeySize(Integer keySize) {
    attributes.put(KEY_SIZE, keySize.toString());
}