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

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

Introduction

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

Prototype

ToStringStyle DEFAULT_STYLE

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

Click Source Link

Document

The default toString style.

Usage

From source file:org.gaixie.micrite.common.search.SearchBean.java

public String toString() {
    return new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE).append("name", name).append("value", value)
            .append("realtion", relation).toString();
}

From source file:org.musicrecital.model.User.java

/**
 * {@inheritDoc}//from  w  ww  . j  av  a 2  s .c o m
 */
public String toString() {
    ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE)
            .append("username", this.username).append("enabled", this.enabled)
            .append("accountExpired", this.accountExpired).append("credentialsExpired", this.credentialsExpired)
            .append("accountLocked", this.accountLocked);

    if (roles != null) {
        sb.append("Granted Authorities: ");

        int i = 0;
        for (Role role : roles) {
            if (i > 0) {
                sb.append(", ");
            }
            sb.append(role.toString());
            i++;
        }
    } else {
        sb.append("No Granted Authorities");
    }
    return sb.toString();
}

From source file:org.openhie.openempi.model.User.java

public String toString() {
    return new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE).append("username", this.username)
            .append("enabled", this.enabled).append("accountExpired", this.accountExpired)
            .append("credentialsExpired", this.credentialsExpired).append("accountLocked", this.accountLocked)
            .toString();/*from w  ww .  j  av  a  2s .c o  m*/
}

From source file:org.openhie.openempi.model.User.java

/**
 * {@inheritDoc}/*from  w  w  w  .ja  v  a2 s  .c  o  m*/
 */
public String toStringLong() {
    ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE)
            .append("username", this.username).append("enabled", this.enabled)
            .append("accountExpired", this.accountExpired).append("credentialsExpired", this.credentialsExpired)
            .append("accountLocked", this.accountLocked);

    GrantedAuthority[] auths = this.getAuthorities();
    if (auths != null) {
        sb.append("Granted Authorities: ");

        for (int i = 0; i < auths.length; i++) {
            if (i > 0) {
                sb.append(", ");
            }
            sb.append(auths[i].toString());
        }
    } else {
        sb.append("No Granted Authorities");
    }
    return sb.toString();
}

From source file:org.openmrs.contrib.metadatarepository.model.MetadataPackage.java

public String toString() {
    ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE).append("name", this.name)
            .append("description", this.description).append("version", this.version);

    return sb.toString();
}

From source file:org.slc.sli.api.security.context.ContextValidator.java

/**
* Validates entities, based upon entity definition and entity ids to validate.
*
* @param def - Definition of entities to validate
* @param ids - Collection of ids of entities to validate
* @param isTransitive - Determines whether validation is through another entity type
*
* @throws APIAccessDeniedException - When entities cannot be accessed
*//*from  w  w  w  .  j a va2 s.  c  o  m*/
public void validateContextToEntities(EntityDefinition def, Collection<String> ids, boolean isTransitive)
        throws APIAccessDeniedException {
    LOG.debug(">>>ContextValidator.validateContextToEntities()");
    LOG.debug("  def: " + ToStringBuilder.reflectionToString(def, ToStringStyle.DEFAULT_STYLE));
    LOG.debug("  ids: {}", (ids == null) ? "null" : ids.toArray().toString());

    LOG.debug("  isTransitive" + isTransitive);

    IContextValidator validator = findValidator(def.getType(), isTransitive);
    LOG.debug("  loaded validator: "
            + ToStringBuilder.reflectionToString(validator, ToStringStyle.DEFAULT_STYLE));

    if (validator != null) {
        NeutralQuery getIdsQuery = new NeutralQuery(
                new NeutralCriteria("_id", "in", new ArrayList<String>(ids)));
        LOG.debug("  getIdsQuery: " + getIdsQuery.toString());

        Collection<Entity> entities = (Collection<Entity>) repo.findAll(def.getStoredCollectionName(),
                getIdsQuery);
        LOG.debug("  entities: " + ToStringBuilder.reflectionToString(entities, ToStringStyle.DEFAULT_STYLE));

        Set<String> idsToValidate = getEntityIdsToValidate(def, entities, isTransitive, ids);
        LOG.debug("  idsToValidate: " + idsToValidate.toString());

        Set<String> validatedIds = getValidatedIds(def, idsToValidate, validator);
        LOG.debug("  validatedIds: " + validatedIds.toString());

        if (!validatedIds.containsAll(idsToValidate)) {
            LOG.debug("    ...APIAccessDeniedException");
            throw new APIAccessDeniedException("Cannot access entities", def.getType(), idsToValidate);
        }
    } else {
        throw new APIAccessDeniedException("No validator for " + def.getType() + ", transitive=" + isTransitive,
                def.getType(), ids);
    }
}

From source file:org.slc.sli.api.security.context.validator.StaffToStudentValidator.java

private Set<String> validateStaffToStudentContextThroughSharedEducationOrganization(Collection<String> ids) {
    LOG.trace(">>>StaffToStudentValidator.validateStaffToStudentContextThroughSharedEducationOrganization()");
    LOG.debug("  ids: {}",
            (ids == null) ? "null" : ToStringBuilder.reflectionToString(ids, ToStringStyle.DEFAULT_STYLE));

    // lookup current staff edOrg associations and get the Ed Org Ids
    Set<String> staffsEdOrgIds = getStaffCurrentAssociatedEdOrgs();

    // lookup students
    Iterable<Entity> students = getStudentEntitiesFromIds(ids);

    Set<String> validIds = new HashSet<String>();

    if (students != null && students.iterator().hasNext()) {

        LOG.debug("  Iterating on each student entity.");

        for (Entity entity : students) {
            LOG.debug("  student: " + ToStringBuilder.reflectionToString(entity, ToStringStyle.DEFAULT_STYLE));

            Set<String> studentsEdOrgs = getStudentsEdOrgs(entity);
            Set<String> validPrograms = programValidator.validate(EntityNames.PROGRAM,
                    getValidPrograms(entity));
            Set<String> validCohorts = cohortValidator.validate(EntityNames.COHORT, getValidCohorts(entity));

            LOG.debug("  # studentsEdOrgs: {}", (studentsEdOrgs == null) ? "null" : studentsEdOrgs.size());
            LOG.debug("  # validPrograms: {}", (validPrograms == null) ? "null" : validPrograms.size());
            LOG.debug("  # validCohorts: {}", (validCohorts == null) ? "null" : validCohorts.size());

            boolean hasStaffStudentIntersection = isIntersection(staffsEdOrgIds, studentsEdOrgs);
            LOG.debug("   hasStaffStudentIntersection = " + hasStaffStudentIntersection);

            if ((hasStaffStudentIntersection || !validPrograms.isEmpty() || !validCohorts.isEmpty())) {
                validIds.add(entity.getEntityId());
            }/*from  w w  w .ja va2  s. co m*/
        }
    }

    return validIds;
}

From source file:org.slc.sli.api.security.context.validator.StaffToStudentValidator.java

private Iterable<Entity> getStudentEntitiesFromIds(Collection<String> studentIds) {
    LOG.debug("StaffToStudentValidator.getStudentEntitiesFromIds()");
    LOG.debug("  studentIds: {}", (studentIds == null) ? "null"
            : ToStringBuilder.reflectionToString(studentIds, ToStringStyle.DEFAULT_STYLE));

    NeutralQuery studentQuery = new NeutralQuery(new NeutralCriteria(ParameterConstants.ID,
            NeutralCriteria.CRITERIA_IN, new ArrayList<String>(studentIds)));
    studentQuery.setEmbeddedFieldString("schools");

    Iterable<Entity> students = null;
    students = getRepo().findAll(EntityNames.STUDENT, studentQuery);

    if (students == null) {
        LOG.debug("  students NOT found in Repo.");
    } else {// w ww  .  j ava2  s . c o m
        LOG.debug("  students WERE found in Repo.");
    }

    return students;
}

From source file:org.zeroturnaround.jrebel.gradle.dsl.RebelDslClasspath.java

public String toString() {
    ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
    builder.append("resources", resources);
    builder.append("fallback", fallback);
    return builder.toString();
}

From source file:org.zeroturnaround.jrebel.gradle.dsl.RebelDslClasspathResource.java

public String toString() {
    ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
    builder.append("directory", directory);
    builder.append("dirset", dirset);
    builder.append("excludes", excludes);
    builder.append("includes", includes);
    builder.append("jar", jar);
    builder.append("jarset", jarset);
    return builder.toString();
}