Example usage for org.apache.commons.lang ArrayUtils toString

List of usage examples for org.apache.commons.lang ArrayUtils toString

Introduction

In this page you can find the example usage for org.apache.commons.lang ArrayUtils toString.

Prototype

public static String toString(Object array) 

Source Link

Document

Outputs an array as a String, treating null as an empty array.

Usage

From source file:org.acoustid.util.FingerprintDecompressorTest.java

public void testOneItemOneBitExcept2() throws IOException, IncompatibleFingerprintVersion {
    int[] expected = { 1 << 8 };
    byte[] data = { 0, 0, 0, 1, 7, 2 };
    assertEquals(ArrayUtils.toString(expected), ArrayUtils.toString(FingerprintDecompressor.decompress(data)));
}

From source file:org.acoustid.util.FingerprintDecompressorTest.java

public void testTwoItems() throws IOException, IncompatibleFingerprintVersion {
    int[] expected = { 1, 0 };
    byte[] data = { 0, 0, 0, 2, 65, 0 };
    assertEquals(ArrayUtils.toString(expected), ArrayUtils.toString(FingerprintDecompressor.decompress(data)));
}

From source file:org.acoustid.util.FingerprintDecompressorTest.java

public void testTwoItemsNoChange() throws IOException, IncompatibleFingerprintVersion {
    int[] expected = { 1, 1 };
    byte[] data = { 0, 0, 0, 2, 1, 0 };
    assertEquals(ArrayUtils.toString(expected), ArrayUtils.toString(FingerprintDecompressor.decompress(data)));
}

From source file:org.acoustid.util.FingerprintDecompressorTest.java

public void testDecompressCompressed() throws IOException, IncompatibleFingerprintVersion {
    int[] fingerprint = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
    byte[] data = FingerprintCompressor.compress(fingerprint);
    assertEquals(ArrayUtils.toString(fingerprint),
            ArrayUtils.toString(FingerprintDecompressor.decompress(data)));
}

From source file:org.apache.atlas.security.InMemoryJAASConfiguration.java

@Override
public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
    if (LOG.isDebugEnabled()) {
        LOG.debug("==> InMemoryJAASConfiguration.getAppConfigurationEntry({})", name);
    }/*from   ww  w  .j  a  v  a  2s  .  c  o m*/

    AppConfigurationEntry[] ret = null;
    List<AppConfigurationEntry> retList = null;
    String redirectedName = getConfigSectionRedirect(name);

    if (redirectedName != null) {
        retList = applicationConfigEntryMap.get(redirectedName);

        if (LOG.isDebugEnabled()) {
            LOG.debug("Redirected jaasConfigSection ({} -> {}): ", name, redirectedName, retList);
        }
    }

    if (retList == null || retList.size() == 0) {
        retList = applicationConfigEntryMap.get(name);
    }

    if (retList == null || retList.size() == 0) {
        if (parent != null) {
            ret = parent.getAppConfigurationEntry(name);
        }
    } else {
        int sz = retList.size();
        ret = new AppConfigurationEntry[sz];
        ret = retList.toArray(ret);
    }

    if (LOG.isDebugEnabled()) {
        LOG.debug("<== InMemoryJAASConfiguration.getAppConfigurationEntry({}): {}", name,
                ArrayUtils.toString(ret));
    }

    return ret;
}

From source file:org.apache.hadoop.hbase.regionserver.CompleteIndex.java

public String probeToString(byte[] bytes) {
    return ArrayUtils.toString(keyStore.fromBytes(bytes));
}

From source file:org.apache.hadoop.hbase.regionserver.EmptyIndex.java

/**
 * {@inheritDoc}
 */
@Override
public String probeToString(byte[] bytes) {
    return ArrayUtils.toString(keyStore.fromBytes(bytes));
}

From source file:org.apache.hadoop.hive.io.HdfsUtils.java

private static void run(FsShell shell, String[] command) throws Exception {
    LOG.debug(ArrayUtils.toString(command));
    int retval = shell.run(command);
    LOG.debug("Return value is :" + retval);
}

From source file:org.apache.hadoop.hive.metastore.ObjectStore.java

private String generateConstraintName(String... parameters) throws MetaException {
    int hashcode = ArrayUtils.toString(parameters).hashCode();
    int counter = 0;
    final int MAX_RETRIES = 10;
    while (counter < MAX_RETRIES) {
        String currName = (parameters.length == 0 ? "constraint_" : parameters[parameters.length - 1]) + "_"
                + hashcode + "_" + System.currentTimeMillis() + "_" + (counter++);
        if (!constraintNameAlreadyExists(currName)) {
            return currName;
        }//  ww w .jav  a 2 s . c  o m
    }
    throw new MetaException(
            "Error while trying to generate the constraint name for " + ArrayUtils.toString(parameters));
}

From source file:org.apache.hadoop.hive.shims.Hadoop20Shims.java

protected void run(FsShell shell, String[] command) throws Exception {
    LOG.debug(ArrayUtils.toString(command));
    shell.run(command);
}