Example usage for org.apache.commons.lang StringUtils EMPTY

List of usage examples for org.apache.commons.lang StringUtils EMPTY

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils EMPTY.

Prototype

String EMPTY

To view the source code for org.apache.commons.lang StringUtils EMPTY.

Click Source Link

Document

The empty String "".

Usage

From source file:com.chadekin.jadys.commons.expression.SqlValueFormatterFactoryTest.java

@Test
public void shouldNotFormatNullValue() {
    // Arrange/*from   w  w w .j  a  v a  2 s  . com*/
    Object value = null;

    // Act
    String result = SqlValueFormatterFactory.format(value).build();

    // Assert
    assertThat(result, is(StringUtils.EMPTY));
}

From source file:com.microsoft.alm.plugin.idea.common.extensions.VcsWorkItemContentProvider.java

@Override
public JComponent initContent() {
    if (controller != null) {
        return controller.getPanel();
    } else {/*from   w ww.jav  a  2 s .  c om*/
        return new JLabel(TfPluginBundle.message(TfPluginBundle.KEY_VCS_WIT_UNEXPECTED_ERRORS,
                t != null ? t.getMessage() : StringUtils.EMPTY), AllIcons.General.Warning, 0);
    }
}

From source file:com.amalto.core.history.accessor.record.SimpleValue.java

@Override
public String get(DataRecord record, PathElement element) {
    if (record == null || element.field instanceof ContainedTypeFieldMetadata) {
        return StringUtils.EMPTY;
    }/*from www . j a  v a2  s .c  o m*/
    if (element.field instanceof ReferenceFieldMetadata) {
        DataRecord referencedRecord = (DataRecord) record.get(element.field);
        if (referencedRecord == null) {
            return StringUtils.EMPTY;
        }
        StringBuilder builder = new StringBuilder();
        for (FieldMetadata keyField : ((ReferenceFieldMetadata) element.field).getReferencedType()
                .getKeyFields()) {
            builder.append('[').append(referencedRecord.get(keyField)).append(']');
        }
        return builder.toString();
    } else {
        Object o = record.get(element.field);
        return String.valueOf(StorageMetadataUtils.toString(o, element.field));
    }
}

From source file:com.abiquo.api.tracer.hierarchy.AbstractHierarchyProcessor.java

@Override
public void process(final String uri, final Map<String, String> resourceData) {
    String resourcePrefix = getIdentifierPrefix();
    String resourceId = getIdentifier(uri);

    // If the resource prefix is not found, ignore this processor
    if (resourceId != null && !resourceId.isEmpty() && StringUtils.isNumeric(resourceId)) {
        String resourceName = getResourceName(resourceId);

        if (resourceName == null || StringUtils.isBlank(resourceName)) {
            resourceName = StringUtils.EMPTY;
        }//  w w  w .j  a  v  a  2s . c  o  m

        resourceData.put(resourcePrefix, resourceId + "|" + resourceName);
    }
}

From source file:com.amalto.core.save.AutoCommitSaverContext.java

@Override
public String getPartialUpdatePivot() {
    return StringUtils.EMPTY;
}

From source file:com.amalto.core.load.context.DefaultMetadata.java

public String getDMR() {
    return StringUtils.EMPTY;
}

From source file:com.hybris.backoffice.cockpitng.dataaccess.facades.DefaultPlatformObjectFacadeStrategyTest.java

@Test
public void testLoad() throws ObjectNotFoundException {
    final ModelService modelService = Mockito.mock(ModelService.class);

    final UserModel user = new UserModel();
    user.setName("Test User");

    Mockito.when(modelService.get(PK.parse("1234"))).thenReturn(user);

    final LabelService labelService = Mockito.mock(LabelService.class);
    Mockito.when(labelService.getObjectLabel(Mockito.any())).thenReturn(StringUtils.EMPTY);

    final DefaultPlatformObjectFacadeStrategy strategy = new DefaultPlatformObjectFacadeStrategy();

    strategy.setModelService(modelService);
    strategy.setLabelService(labelService);

    // Test we get the same user
    Assert.assertEquals(user, strategy.load("1234", null));

    // Test that an unknown pk will return null
    Assert.assertNull(strategy.load("9999", null));
    Assert.assertNull(strategy.load(null, null));

    try {/* w ww.  j  a  v  a 2 s  .  co m*/
        strategy.load("", null);
        Assert.fail("load method should have thrown an exception");
    } catch (final ObjectNotFoundException ex) // NOPMD
    {
        // expected behavior
    }

}

From source file:com.microsoft.alm.plugin.idea.common.setup.WindowsStartup.java

/**
 * Check if registry keys exist and if the cmd file the key contains matches the latest cmd file
 *
 * @param newCmd//from  w ww .  jav  a 2  s.  c  om
 * @return if keys exists or not
 */
protected static boolean doesKeyNeedUpdated(final File newCmd) throws IOException {
    try {
        final String existingKey = Advapi32Util.registryGetStringValue(WinReg.HKEY_CLASSES_ROOT, VSOI_KEY,
                StringUtils.EMPTY);
        final File existingCmd = new File(existingKey.replace("\"%1\"", "").trim());
        if (!existingCmd.exists()) {
            logger.debug("The registry key needs updated because the old key cmd file doesn't exist.");
            return true;
        }

        if (existingCmd.getPath().equalsIgnoreCase(newCmd.getPath())
                || FileUtils.contentEquals(existingCmd, newCmd)) {
            logger.debug("The registry key does not need updated because {}",
                    existingCmd.getPath().equalsIgnoreCase(newCmd.getPath()) ? "the file paths are the same"
                            : "the contents of the files are the same.");
            return false;
        }

        // use the newest cmd file so update if existing cmd file is older
        // TODO: version cmd file if we continually iterate on it so we chose the correct file more reliably
        logger.debug("The existing cmd file is {} old and the the cmd file is {} old",
                existingCmd.lastModified(), newCmd.lastModified());
        return existingCmd.lastModified() < newCmd.lastModified() ? true : false;
    } catch (Win32Exception e) {
        // Error occurred reading the registry (possible key doesn't exist or is empty) so update just to be safe
        logger.debug("There was an issue reading the registry so updating the key to be safe.");
        return true;
    }
}

From source file:com.greenline.guahao.web.module.home.controllers.my.reservation.OrderLimitUtil.java

public void setSignData(ModelMap model, Long cuserId) {
    SimpleDateFormat destsmf = new SimpleDateFormat("yyyyMMddHHmmss");
    String todatasign = cuserId + destsmf.format(new Date());
    // ??20// w  w w .  j  av a 2  s  .c  o m
    orderValidLimitCacheManager.setSignData(cuserId + StringUtils.EMPTY, todatasign);
    log.info("___________?:?todatasign=" + todatasign);
    String signdata = DESUtil.DESEncode(todatasign, ReservationConstants.DESC_ORDER_KEY);
    log.info("___________?:??signdata=" + signdata);
    model.put("signdata", signdata);
    // ??
    orderValidLimitCacheManager.setOrderSpeedTime(cuserId + StringUtils.EMPTY);
}

From source file:com.amalto.core.integrity.DefaultCheckDataSource.java

public String getDataModel(String clusterName, String concept, String[] ids) throws XtentisException {
    String dataModel;/*w  w  w .ja  v a2 s  .  c o  m*/
    try {
        ItemPOJOPK pk = new ItemPOJOPK(new DataClusterPOJOPK(clusterName), concept, ids);
        ItemPOJO item = Util.getItemCtrl2Local().getItem(pk);
        if (item == null) {
            String id = StringUtils.EMPTY;
            for (String currentIdValue : ids) {
                id += "[" + currentIdValue + "]"; //$NON-NLS-1$ //$NON-NLS-2$
            }

            throw new RuntimeException("Document with id '" //$NON-NLS-1$
                    + id + "' (concept name: '" //$NON-NLS-1$
                    + concept + "') has already been deleted."); //$NON-NLS-1$
        } else {

            dataModel = item.getDataModelName();
        }
    } catch (Exception e) {
        throw new XtentisException(e);
    }
    return dataModel;
}