Example usage for org.apache.commons.lang3.builder ToStringBuilder build

List of usage examples for org.apache.commons.lang3.builder ToStringBuilder build

Introduction

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

Prototype

@Override
public String build() 

Source Link

Document

Returns the String that was build as an object representation.

Usage

From source file:org.hbird.exchange.navigation.LocationContactEvent.java

@Override
public String toString() {
    ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
    builder.append("eventId", getInstanceID());
    builder.append("timestamp", getTimestamp());
    builder.append("start", Dates.toDefaultDateFormat(startTime));
    builder.append("end", Dates.toDefaultDateFormat(endTime));
    builder.append("gs", groundStationId);
    builder.append("sat", satelliteId);
    builder.append("orbit", orbitNumber);
    return builder.build();
}

From source file:org.hbird.exchange.navigation.OrbitalState.java

@Override
public String toString() {
    ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
    builder.append("ID", getInstanceID());
    builder.append("name", getName());
    builder.append("satelliteId", satelliteId);
    return builder.build();
}

From source file:org.hl7.fhir.utilities.validation.ValidationMessage.java

/**
 * Returns a representation of this ValidationMessage suitable for logging. The values of
 * most of the internal fields are included, so this may not be suitable for display to 
 * an end user.//from  w  w w  .  j av  a 2  s. c  om
 */
@Override
public String toString() {
    ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
    b.append("level", level);
    b.append("type", type);
    b.append("location", location);
    b.append("message", message);
    return b.build();
}

From source file:org.jboss.errai.codegen.util.CDIAnnotationUtils.java

/**
 * <p>Generate a string representation of an Annotation, as suggested by
 * {@link Annotation#toString()}.</p>
 *
 * @param a the annotation of which a string representation is desired
 * @return the standard string representation of an annotation, not
 * {@code null}/* w w  w .  j  av a 2  s. c  o  m*/
 */
public static String toString(final Annotation a) {
    final ToStringBuilder builder = new ToStringBuilder(a, TO_STRING_STYLE);
    for (final Method m : a.annotationType().getDeclaredMethods()) {
        if (m.getParameterTypes().length > 0) {
            continue; //wtf?
        }
        try {
            builder.append(m.getName(), m.invoke(a));
        } catch (final RuntimeException ex) {
            throw ex;
        } catch (final Exception ex) {
            throw new RuntimeException(ex);
        }
    }
    return builder.build();
}

From source file:org.jsweet.input.typescriptdef.util.Util.java

/**
 * <p>//from  ww w .  ja v  a  2 s. c o m
 * Generate a string representation of an Annotation, as suggested by
 * {@link Annotation#toString()}.
 * </p>
 *
 * @param a
 *            the annotation of which a string representation is desired
 * @return the standard string representation of an annotation, not
 *         {@code null}
 */
public static String toString(final Annotation a) {
    final ToStringBuilder builder = new ToStringBuilder(a, TO_STRING_STYLE);
    for (final Method m : a.annotationType().getDeclaredMethods()) {
        if (m.getParameterTypes().length > 0) {
            continue; // wtf?
        }
        try {
            Object val = m.invoke(a);
            if (val instanceof String) {
                val = "\"" + val + "\"";
            }
            builder.append(m.getName(), val);
        } catch (final RuntimeException ex) {
            throw ex;
        } catch (final Exception ex) {
            throw new RuntimeException(ex);
        }
    }
    return builder.build();
}

From source file:org.kisoonlineapp.security.event.UserEvent.java

@Override
public String toString() {
    ToStringBuilder tsb = new ToStringBuilder(this);
    tsb.append("userEventType", userEventType);
    String toString = tsb.build();
    return toString;
}

From source file:org.kisoonlineapp.uc.event.UcKisoonlineAppEvent.java

@Override
public String toString() {
    final ToStringBuilder tsb = new ToStringBuilder(this);
    tsb.append("ucKisoonlineAppEventType", ucKisoonlineAppEventType);
    final String toString = tsb.build();
    return toString;
}