Example usage for org.apache.commons.lang.builder ToStringBuilder reflectionToString

List of usage examples for org.apache.commons.lang.builder ToStringBuilder reflectionToString

Introduction

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

Prototype

public static String reflectionToString(Object object, ToStringStyle style) 

Source Link

Document

Forwards to ReflectionToStringBuilder.

Usage

From source file:jp.co.ctc_g.rack.core.messaging.command.keypair.KeypairCreateCommand.java

@Override
public String toString() {

    return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}

From source file:com.gemini.mapper.SecurityGroupRuleDirectionCustomConverter.java

@Override
public Object convert(Object destValue, Object sourceValue, Class<?> destinationClass, Class<?> sourceClass) {
    if (sourceValue == null) {
        Logger.error("Security Group Rule Direction Custom Converter used incorrectly, NULL values passed");
        return null;
    }//from w w  w .j a  v  a2 s .  c o m
    if (sourceValue instanceof String) {
        //convert String to GeminiEnvironmentType
        for (GeminiSecurityGroupRuleDirection envType : GeminiSecurityGroupRuleDirection.values()) {
            if (envType.name().equals((String) sourceValue)) {
                return envType;
            }
        }
        Logger.error(
                "Security Group Rule Direction Custom Converter used incorrectly, invalid value passed: {}",
                (String) sourceValue);
    } else if (sourceValue instanceof GeminiSecurityGroupRuleDirection) {
        return ((GeminiSecurityGroupRuleDirection) sourceValue).name();
    } else {
        Logger.error(
                "Security Group Rule Direction Custom Converter used incorrectly. Arguments passed in were: source\n {} \n destination\n {}",
                ToStringBuilder.reflectionToString(sourceValue, ToStringStyle.MULTI_LINE_STYLE),
                ToStringBuilder.reflectionToString(destValue, ToStringStyle.MULTI_LINE_STYLE));
        throw new MappingException(
                "Converter SecurityGroupRuleDirectionCustomConverter used incorrectly. Arguments passed in were:"
                        + ToStringBuilder.reflectionToString(destValue, ToStringStyle.MULTI_LINE_STYLE)
                        + " and "
                        + ToStringBuilder.reflectionToString(sourceValue, ToStringStyle.MULTI_LINE_STYLE));
    }
    return null;
}

From source file:com.gemini.common.repository.impl.BaseRepositoryMongoDBImpl.java

@Override
public void update(String id, T transientObject) {
    Logger.debug("update: id: {} object: ",
            ToStringBuilder.reflectionToString(id, ToStringStyle.MULTI_LINE_STYLE),
            ToStringBuilder.reflectionToString(transientObject, ToStringStyle.MULTI_LINE_STYLE));
    save(transientObject);// w w w .j  a  v  a2 s  .  c om
}

From source file:acromusashi.stream.spout.DrpcRequestInfo.java

@Override
public String toString() {
    String result = ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    return result;
}

From source file:com.ms.commons.lang.RangeBuilderTest.java

@SuppressWarnings("rawtypes")
private void println(Object data) {
    if (data instanceof Collection) {
        for (Object obj : (Collection) data) {
            System.out.println(ToStringBuilder.reflectionToString(obj, ToStringStyle.SHORT_PREFIX_STYLE));
        }//  w w  w. j a v a 2  s.c o  m
    } else {
        System.out.println(ToStringBuilder.reflectionToString(data, ToStringStyle.SHORT_PREFIX_STYLE));
    }
}

From source file:au.id.hazelwood.sos.dto.framework.BaseDto.java

@Override
public String toString() {
    return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}

From source file:acromusashi.stream.bolt.StreamMessagePrintBolt.java

/**
 * {@inheritDoc}/*from   w ww. java  2s . co m*/
 */
@Override
public void onExecute(StreamMessage input) {
    StreamMessageHeader header = input.getHeader();
    Object body = input.getBody();

    logger.info("ReceiveHeader=" + header.toString() + " ,ReceiveBody="
            + ToStringBuilder.reflectionToString(body, ToStringStyle.SHORT_PREFIX_STYLE));
}

From source file:com.mirth.connect.model.ChannelStatus.java

public String toString() {
    return ToStringBuilder.reflectionToString(this, CalendarToStringStyle.instance());
}

From source file:edu.umd.cs.psl.sampler.HitAndRunSamplerStatistics.java

HitAndRunSamplerStatistics(AbstractHitAndRunSampler s, RunningProcess proc) {
    process = proc;/*  w ww . j  av a  2s .c om*/
    proc.setString(descriptionKey, ToStringBuilder.reflectionToString(s, ToStringStyle.MULTI_LINE_STYLE));
    proc.setLong(timeInCornersKey, 0);
    proc.setLong(noCallBacksKey, 0);
    startTime = System.currentTimeMillis();
}

From source file:com.cubeia.backoffice.wallet.api.dto.report.TransactionEntry.java

/** 
 * @return String, a readable representation
 *///w w  w .  j a v  a 2 s  .  c  o  m
@Override
public String toString() {
    return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}