Example usage for java.util Arrays deepToString

List of usage examples for java.util Arrays deepToString

Introduction

In this page you can find the example usage for java.util Arrays deepToString.

Prototype

public static String deepToString(Object[] a) 

Source Link

Document

Returns a string representation of the "deep contents" of the specified array.

Usage

From source file:com.celements.pagetype.service.PageTypeService.java

public List<PageTypeReference> getPageTypeRefsForCategories(Set<String> catList, boolean onlyVisible) {
    if (onlyVisible) {
        Set<PageTypeReference> visiblePTSet = new HashSet<PageTypeReference>();
        for (PageTypeReference pageTypeRef : getPageTypeRefsForCategories(catList)) {
            if (getPageTypeConfigForPageTypeRef(pageTypeRef).isVisible()) {
                visiblePTSet.add(pageTypeRef);
            }/*www  . j  av a  2 s  .c o  m*/
        }
        LOGGER.debug("getPageTypeRefsForCategories: for catList [" + Arrays.deepToString(catList.toArray())
                + "] and onlyVisible [" + onlyVisible + "] return "
                + Arrays.deepToString(visiblePTSet.toArray()));
        return new ArrayList<PageTypeReference>(visiblePTSet);
    } else {
        return new ArrayList<PageTypeReference>(getPageTypeRefsForCategories(catList));
    }
}

From source file:org.omnaest.utils.codec.EncoderAndDecoderEscaping.java

/**
 * @see EncoderAndDecoderEscaping//from   www. j  ava2s .com
 * @param escapeCharacter
 * @param encodedCharacters
 */
EncoderAndDecoderEscaping(String escapeCharacter, String[] encodedCharacters) {
    super();

    Assert.isNotNull(escapeCharacter, "escapeCharacter must not be null");
    Assert.isNotNull(encodedCharacters, "encodedCharacters must not be null");
    Assert.isFalse(Pattern.matches(".*[0-9].*", Arrays.deepToString(encodedCharacters)),
            "encodedCharacters must not contain any number");

    final Map<String, String> encodedCharacterToEscapeSequenceMap = new LinkedHashMap<String, String>();
    {
        final String format = "%0" + ((int) Math.ceil(Math.log10(encodedCharacters.length + 1))) + "d";
        int counter = 0;
        for (String encodedCharacter : ArrayUtils.addAll(new String[] { escapeCharacter }, encodedCharacters)) {
            final String escapeSequence = escapeCharacter + String.format(format, counter);
            encodedCharacterToEscapeSequenceMap.put(encodedCharacter, escapeSequence);
            counter++;
        }
    }
    this.encodedCharacterToEscapeSequenceMap = ImmutableMap
            .<String, String>copyOf(encodedCharacterToEscapeSequenceMap);
    this.escapeSequenceToEncodedCharacterMap = ImmutableMap
            .<String, String>copyOf(MapUtils.invertedBidirectionalMap(encodedCharacterToEscapeSequenceMap));
}

From source file:org.wso2.carbon.event.processor.common.storm.component.EventPublisherBolt.java

@Override
public void execute(Tuple tuple, BasicOutputCollector basicOutputCollector) {
    if (log.isDebugEnabled()) {
        log.debug(logPrefix + "Received Event: " + tuple.getSourceStreamId() + ":"
                + Arrays.deepToString(tuple.getValues().toArray()));
    }/*from w ww. j a v  a 2  s.c om*/

    this.collector = basicOutputCollector;
    if (!initialized) {
        init();
    }

    Object[] dataArray = tuple.getValues().toArray();
    long timestamp = (Long) dataArray[dataArray.length - 1];
    dataArray = ArrayUtils.remove(dataArray, dataArray.length - 1);

    StreamDefinition streamDefinition = streamIdToDefinitionMap.get(tuple.getSourceStreamId());
    if (streamDefinition != null) {
        asyncEventPublisher.sendEvent(dataArray, timestamp, tuple.getSourceStreamId());
    } else {
        log.warn(logPrefix + "Tuple received for unknown stream " + tuple.getSourceStreamId() + ". Discarding "
                + "Event: " + tuple.getSourceStreamId() + ":" + Arrays.deepToString(dataArray) + "@"
                + timestamp);
    }
    if (log.isDebugEnabled()) {
        log.debug(logPrefix + "Emitted Event: " + tuple.getSourceStreamId() + ":"
                + Arrays.deepToString(dataArray) + "@" + timestamp);
    }
}

From source file:org.wso2.carbon.event.processor.storm.internal.listener.ConsumingQueuedEventSource.java

@Override
public void consumeEvents(Object[][] events) {

    if (traceEnabled) {
        trace.info(tracerPrefix + Arrays.deepToString(events));
    }//  w  ww  .j  a  v a 2s  .  com

    for (Object[] eventData : events) {
        if (statisticsEnabled) {
            statisticsMonitor.incrementRequest();
        }
        eventQueue.offer(eventData);
    }

}

From source file:com.redblackit.web.server.EchoServletTest.java

/**
 * Constructor taking test values//from w ww.  ja va 2 s. c om
 *
 * @param requestURI
 * @param headers
 * @param body
 */
public EchoServletTest(String requestURI, String[][] headers, String body) {

    this.echoServlet = new EchoServlet();

    this.requestURI = requestURI;
    this.headersMap = new TreeMap<String, List<String>>();
    if (headers != null && headers.length > 0) {
        logger.debug("<init>:headers=" + Arrays.deepToString(headers));
        int hi = 0;
        for (String[] header : headers) {
            logger.debug("<init>:header[" + hi + "]=" + Arrays.toString(header));
            if (header != null && header.length > 0) {
                String[] values;
                if (header.length > 1) {
                    values = Arrays.copyOfRange(header, 1, header.length);
                    logger.debug("<init>:header[" + hi + "].values=" + Arrays.toString(values));
                } else {
                    values = new String[] { "" };
                    logger.debug("<init>:header[" + hi + "].values=" + Arrays.toString(values) + "(empty)");
                }
                headersMap.put(header[0], Arrays.asList(values));
            }
        }
    }

    this.body = body;
}

From source file:org.apache.rya.mongodb.document.util.DocumentVisibilityUtilTest.java

@Test
public void testGoodExpressions() throws DocumentVisibilityConversionException {
    int count = 1;
    for (final Pair<String, String> pair : INPUT_AND_EXPECTED_BOOLEAN_EXPRESSIONS) {
        final String booleanExpression = pair.getLeft();
        final String expected = pair.getRight();
        log.info("Valid Test: " + count);
        log.info("Original: " + booleanExpression);

        // Convert to multidimensional array
        final DocumentVisibility dv = new DocumentVisibility(booleanExpression);
        final Object[] multidimensionalArray = DocumentVisibilityUtil.toMultidimensionalArray(dv);
        log.info("Array   : " + Arrays.deepToString(multidimensionalArray));

        // Convert multidimensional array back to string
        final String booleanStringResult = DocumentVisibilityUtil
                .multidimensionalArrayToBooleanString(multidimensionalArray);
        log.info("Result  : " + booleanStringResult);

        // Compare results
        assertEquals(expected, booleanStringResult);
        log.info("===========================");
        count++;//from w w w.j  a  v a2  s . co m
    }
}

From source file:org.wso2.carbon.event.processor.core.internal.listener.AbstractSiddhiInputEventDispatcher.java

@Override
public void consumeEvents(Event[] events) {
    if (traceEnabled) {
        trace.info(tracerPrefix + Arrays.deepToString(events));
    }//from   ww  w .  j a v  a 2s  .c om
    for (Event event : events) {
        try {
            if (statisticsEnabled) {
                eventCounter.inc();
            }
            sendEvent(event);
        } catch (InterruptedException e) {
            log.error("Error in dispatching events " + Arrays.deepToString(events) + " to Siddhi stream :"
                    + siddhiStreamId);
        }
    }
}

From source file:org.ops4j.pax.url.commons.handler.HandlerActivator.java

/**
 * Registers Handler as a wrap: protocol stream handler service and as a configuration managed service if
 * possible.//from w  w  w .  ja  va 2s .  c  o m
 *
 * @param bundleContext the bundle context.
 *
 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
 */
public void start(final BundleContext bundleContext) {
    NullArgumentException.validateNotNull(bundleContext, "Bundle context");
    m_bundleContext = bundleContext;
    registerManagedService();
    registerHandler();
    LOG.debug("Handler for protocols " + Arrays.deepToString(m_protocols) + " started");
}

From source file:org.alfresco.util.exec.RuntimeExecBeansTest.java

public void testSplitArguments() throws Exception {
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(APP_CONTEXT_XML);
    try {/*  w w  w.ja v  a2s . c  o m*/
        RuntimeExec splitExec = (RuntimeExec) ctx.getBean("commandSplitArguments");
        assertNotNull(splitExec);
        String[] splitCommand = splitExec.getCommand();
        assertTrue("Command arguments not split into 'dir', '.' and '..' :" + Arrays.deepToString(splitCommand),
                Arrays.deepEquals(new String[] { "dir", ".", ".." }, splitCommand));
    } finally {
        ctx.close();
    }
}

From source file:org.wso2.carbon.event.processor.storm.internal.listener.ConsumingQueuedEventSource.java

@Override
public void consumeEvents(Event[] events) {
    if (traceEnabled) {
        trace.info(tracerPrefix + Arrays.deepToString(events));
    }//from   w ww.j av a 2s  . c  o m
    if (statisticsEnabled) {
        for (Object obj : events) {
            statisticsMonitor.incrementRequest();
        }
    }
    for (Event event : events) {
        eventQueue.offer(event.getData());
    }
}