Example usage for org.apache.commons.lang.builder ToStringStyle SHORT_PREFIX_STYLE

List of usage examples for org.apache.commons.lang.builder ToStringStyle SHORT_PREFIX_STYLE

Introduction

In this page you can find the example usage for org.apache.commons.lang.builder ToStringStyle SHORT_PREFIX_STYLE.

Prototype

ToStringStyle SHORT_PREFIX_STYLE

To view the source code for org.apache.commons.lang.builder ToStringStyle SHORT_PREFIX_STYLE.

Click Source Link

Document

The short prefix toString style.

Usage

From source file:org.marketcetera.core.position.impl.PositionMetricsImpl.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
            .append("incomingPosition", mIncomingPosition) //$NON-NLS-1$
            .append("position", mPosition) //$NON-NLS-1$
            .append("positionPL", mPositionPL) //$NON-NLS-1$
            .append("tradingPL", mTradingPL) //$NON-NLS-1$
            .append("realizedPL", mRealizedPL) //$NON-NLS-1$
            .append("unrealizedPL", mUnrealizedPL) //$NON-NLS-1$
            .append("totalPL", mTotalPL) //$NON-NLS-1$
            .toString();//w ww  .  j  a  v a  2 s  .c  om
}

From source file:org.marketcetera.core.position.impl.PositionRowImpl.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).appendToString(mInstrument.toString())
            .append("underlying", mUnderlying) //$NON-NLS-1$
            .append("account", mAccount) //$NON-NLS-1$
            .append("traderId", mTraderId) //$NON-NLS-1$
            .append("grouping", mGrouping) //$NON-NLS-1$
            .toString();//w ww .j a v  a 2  s  . co  m
}

From source file:org.marketcetera.trade.Equity.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("symbol", mSymbol) //$NON-NLS-1$
            .toString();/*from ww w.  j a  va 2  s  . com*/
}

From source file:org.marketcetera.trade.Option.java

@Override
public String toString() {
    ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
            .append("symbol", mSymbol) //$NON-NLS-1$
            .append("type", mType) //$NON-NLS-1$
            .append("expiry", mExpiry) //$NON-NLS-1$
            .append("strikePrice", mStrikePrice); //$NON-NLS-1$
    if (mAugmentedExpiry != null) {
        builder.append("augmentedExpiry", mAugmentedExpiry); //$NON-NLS-1$
    }/*from  w w  w . j  a  va2s.  c o  m*/
    return builder.toString();
}

From source file:org.mule.module.gcm.CcsConnector.java

/**
 * Connect and authenticate to the CSS server.
 * //from   ww w  .java2s. c o m
 * @param projectId The project ID (aka sender ID).
 * @throws ConnectionException throw in case connecting to the CCS server fails.
 */
@Connect
public void connect(@ConnectionKey final String projectId) throws ConnectionException {
    this.projectId = projectId;

    try {
        final ConnectionConfiguration config = new ConnectionConfiguration("gcm.googleapis.com", 5235);
        config.setCompressionEnabled(true);
        config.setSASLAuthenticationEnabled(true);
        config.setSocketFactory(SSLSocketFactory.getDefault());
        xmppConnection = new XMPPConnection(config);
        xmppConnection.connect();

        if (!xmppConnection.isConnected()) {
            throw new ConnectionException(ConnectionExceptionCode.CANNOT_REACH, null,
                    "XMPP connection failed to: "
                            + ToStringBuilder.reflectionToString(config, ToStringStyle.SHORT_PREFIX_STYLE));
        }
    } catch (final XMPPException xmppe) {
        throw new ConnectionException(ConnectionExceptionCode.CANNOT_REACH, null, xmppe.getMessage(), xmppe);
    }

    try {
        xmppConnection.login(getLoginUser(), getApiKey());
        xmppConnection.getChatManager().addChatListener(new ChatManagerListener() {
            @Override
            public void chatCreated(final Chat chat, final boolean createdLocally) {
                if (!createdLocally) {
                    CcsConnector.this.chat = chat;
                    chat.addMessageListener(new MessageListener() {
                        @Override
                        public void processMessage(final Chat chat, final Message message) {
                            try {
                                handleInboundMessage(message);
                            } catch (final Exception e) {
                                logger.error("Failed to handle inbound message: " + message, e);
                            }
                        }
                    });
                }
            }
        });
    } catch (final XMPPException xmppe) {
        throw new ConnectionException(ConnectionExceptionCode.INCORRECT_CREDENTIALS, null, xmppe.getMessage(),
                xmppe);
    }
}

From source file:org.mule.module.redis.RedisModule.java

@PostConstruct
public void initializeJedis() {
    jedisPool = new JedisPool(poolConfig, host, port, connectionTimeout, password);

    LOGGER.info(String.format(/*from   w  w  w .j a v  a  2 s  . c om*/
            "Redis connector ready, host: %s, port: %d, timeout: %d, password: %s, pool config: %s", host, port,
            connectionTimeout, StringUtils.repeat("*", StringUtils.length(password)),
            ToStringBuilder.reflectionToString(poolConfig, ToStringStyle.SHORT_PREFIX_STYLE)));
}

From source file:org.netxilia.api.impl.model.Workbook.java

@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) //
            .append("workbook", id) //
            .append("name", name) //
            .append("sheetsSize", sheetsByName.size()) //
            .toString();/*from   www .  j a v  a2s  .  c  o  m*/
}

From source file:org.nuxeo.connect.update.task.update.RollbackOptions.java

/**
 * @since 5.7
 */
@Override
public String toString() {
    return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}

From source file:org.nuxeo.launcher.info.CommandInfo.java

/**
 * Log content of the command info/*from  ww  w.  j av a 2s .com*/
 *
 * @since 5.7
 */
public void log(boolean debug) {
    StringBuilder sb = new StringBuilder();
    if (pending) {
        sb.append("* Pending action: " + name);
    } else {
        sb.append("* " + name);
    }
    if (id != null) {
        sb.append(" [" + id + "]");
    }
    if (param != null) {
        sb.append(" (" + param + ")");
    }
    for (PackageInfo packageInfo : packages) {
        sb.append("\n\t" + new ReflectionToStringBuilder(packageInfo, ToStringStyle.SHORT_PREFIX_STYLE)
                .setExcludeFieldNames(new String[] { "description" }).toString());
    }
    if (exitCode != 0 || debug) {
        if (exitCode != 0) {
            log.error(sb.toString());
        } else {
            log.info(sb.toString());
        }
        for (MessageInfo messageInfo : messages) {
            messageInfo.log();
        }
    }
}

From source file:org.openhab.action.openwebif.internal.impl.config.OpenWebIfConfig.java

/**
 * {@inheritDoc}/*from   ww w .j ava2s  .c o m*/
 */
@Override
public String toString() {
    return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("name", name).append("host", host)
            .append("port", port).append("https", https).append("user", user)
            .append("password", password == null ? "no" : "yes").toString();
}