Search in sources :

Example 31 with StringBundler

use of com.liferay.petra.string.StringBundler in project liferay-blade-samples by liferay.

the class CountryModelImpl method toString.

@Override
public String toString() {
    Map<String, Function<Country, Object>> attributeGetterFunctions = getAttributeGetterFunctions();
    StringBundler sb = new StringBundler(4 * attributeGetterFunctions.size() + 2);
    sb.append("{");
    for (Map.Entry<String, Function<Country, Object>> entry : attributeGetterFunctions.entrySet()) {
        String attributeName = entry.getKey();
        Function<Country, Object> attributeGetterFunction = entry.getValue();
        sb.append(attributeName);
        sb.append("=");
        sb.append(attributeGetterFunction.apply((Country) this));
        sb.append(", ");
    }
    if (sb.index() > 1) {
        sb.setIndex(sb.index() - 1);
    }
    sb.append("}");
    return sb.toString();
}
Also used : Function(java.util.function.Function) Country(com.liferay.blade.samples.jdbcservicebuilder.model.Country) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) StringBundler(com.liferay.petra.string.StringBundler)

Example 32 with StringBundler

use of com.liferay.petra.string.StringBundler in project liferay-blade-samples by liferay.

the class RegionCacheModel method toString.

@Override
public String toString() {
    StringBundler sb = new StringBundler(5);
    sb.append("{regionId=");
    sb.append(regionId);
    sb.append(", regionName=");
    sb.append(regionName);
    sb.append("}");
    return sb.toString();
}
Also used : StringBundler(com.liferay.petra.string.StringBundler)

Example 33 with StringBundler

use of com.liferay.petra.string.StringBundler in project liferay-blade-samples by liferay.

the class QuxCacheModel method toString.

@Override
public String toString() {
    StringBundler sb = new StringBundler(25);
    sb.append("{uuid=");
    sb.append(uuid);
    sb.append(", quxId=");
    sb.append(quxId);
    sb.append(", groupId=");
    sb.append(groupId);
    sb.append(", companyId=");
    sb.append(companyId);
    sb.append(", userId=");
    sb.append(userId);
    sb.append(", userName=");
    sb.append(userName);
    sb.append(", createDate=");
    sb.append(createDate);
    sb.append(", modifiedDate=");
    sb.append(modifiedDate);
    sb.append(", status=");
    sb.append(status);
    sb.append(", statusByUserId=");
    sb.append(statusByUserId);
    sb.append(", statusByUserName=");
    sb.append(statusByUserName);
    sb.append(", statusDate=");
    sb.append(statusDate);
    sb.append("}");
    return sb.toString();
}
Also used : StringBundler(com.liferay.petra.string.StringBundler)

Example 34 with StringBundler

use of com.liferay.petra.string.StringBundler in project liferay-blade-samples by liferay.

the class QuxModelImpl method toString.

@Override
public String toString() {
    Map<String, Function<Qux, Object>> attributeGetterFunctions = getAttributeGetterFunctions();
    StringBundler sb = new StringBundler(4 * attributeGetterFunctions.size() + 2);
    sb.append("{");
    for (Map.Entry<String, Function<Qux, Object>> entry : attributeGetterFunctions.entrySet()) {
        String attributeName = entry.getKey();
        Function<Qux, Object> attributeGetterFunction = entry.getValue();
        sb.append(attributeName);
        sb.append("=");
        sb.append(attributeGetterFunction.apply((Qux) this));
        sb.append(", ");
    }
    if (sb.index() > 1) {
        sb.setIndex(sb.index() - 1);
    }
    sb.append("}");
    return sb.toString();
}
Also used : Function(java.util.function.Function) Qux(com.liferay.blade.workflow.asset.model.Qux) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) StringBundler(com.liferay.petra.string.StringBundler)

Example 35 with StringBundler

use of com.liferay.petra.string.StringBundler in project liferay-blade-samples by liferay.

the class QuxPersistenceImpl method findByUuid_C_Last.

/**
 * Returns the last qux in the ordered set where uuid = &#63; and companyId = &#63;.
 *
 * @param uuid the uuid
 * @param companyId the company ID
 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
 * @return the last matching qux
 * @throws NoSuchQuxException if a matching qux could not be found
 */
@Override
public Qux findByUuid_C_Last(String uuid, long companyId, OrderByComparator<Qux> orderByComparator) throws NoSuchQuxException {
    Qux qux = fetchByUuid_C_Last(uuid, companyId, orderByComparator);
    if (qux != null) {
        return qux;
    }
    StringBundler msg = new StringBundler(6);
    msg.append(_NO_SUCH_ENTITY_WITH_KEY);
    msg.append("uuid=");
    msg.append(uuid);
    msg.append(", companyId=");
    msg.append(companyId);
    msg.append("}");
    throw new NoSuchQuxException(msg.toString());
}
Also used : Qux(com.liferay.blade.workflow.asset.model.Qux) NoSuchQuxException(com.liferay.blade.workflow.asset.exception.NoSuchQuxException) StringBundler(com.liferay.petra.string.StringBundler)

Aggregations

StringBundler (com.liferay.petra.string.StringBundler)90 Query (com.liferay.portal.kernel.dao.orm.Query)45 QueryPos (com.liferay.portal.kernel.dao.orm.QueryPos)38 Session (com.liferay.portal.kernel.dao.orm.Session)35 FinderPath (com.liferay.portal.kernel.dao.orm.FinderPath)31 Foo (com.liferay.blade.basic.model.Foo)17 Bar (com.liferay.blade.samples.servicebuilder.adq.model.Bar)17 NoSuchFooException (com.liferay.blade.basic.exception.NoSuchFooException)16 NoSuchBarException (com.liferay.blade.samples.servicebuilder.adq.exception.NoSuchBarException)16 HashMap (java.util.HashMap)14 LinkedHashMap (java.util.LinkedHashMap)14 Map (java.util.Map)14 Function (java.util.function.Function)14 Qux (com.liferay.blade.workflow.asset.model.Qux)13 Baz (com.liferay.blade.workflow.basic.model.Baz)13 NoSuchQuxException (com.liferay.blade.workflow.asset.exception.NoSuchQuxException)12 NoSuchBazException (com.liferay.blade.workflow.basic.exception.NoSuchBazException)12 List (java.util.List)4 Country (com.liferay.blade.samples.dspservicebuilder.model.Country)3 Country (com.liferay.blade.samples.jdbcservicebuilder.model.Country)3