summary.setId(bean.getId()); summary.setName(bean.getName()); summary.setDescription(bean.getDescription()); orgs.add(summary);
summary.setId(bean.getId()); summary.setName(bean.getName()); summary.setDescription(bean.getDescription()); orgs.add(summary);
/** * @see io.apiman.manager.api.core.IStorageQuery#findOrganizations(io.apiman.manager.api.beans.search.SearchCriteriaBean) */ @Override public SearchResultsBean<OrganizationSummaryBean> findOrganizations(SearchCriteriaBean criteria) throws StorageException { SearchResultsBean<OrganizationBean> orgs = find(criteria, OrganizationBean.class); SearchResultsBean<OrganizationSummaryBean> rval = new SearchResultsBean<>(); rval.setTotalSize(orgs.getTotalSize()); List<OrganizationBean> beans = orgs.getBeans(); for (OrganizationBean bean : beans) { OrganizationSummaryBean osb = new OrganizationSummaryBean(); osb.setId(bean.getId()); osb.setName(bean.getName()); osb.setDescription(bean.getDescription()); rval.getBeans().add(osb); } return rval; }
/** * @see io.apiman.manager.api.core.IStorageQuery#findOrganizations(io.apiman.manager.api.beans.search.SearchCriteriaBean) */ @Override public SearchResultsBean<OrganizationSummaryBean> findOrganizations(SearchCriteriaBean criteria) throws StorageException { SearchResultsBean<OrganizationBean> orgs = find(criteria, OrganizationBean.class); SearchResultsBean<OrganizationSummaryBean> rval = new SearchResultsBean<>(); rval.setTotalSize(orgs.getTotalSize()); List<OrganizationBean> beans = orgs.getBeans(); for (OrganizationBean bean : beans) { OrganizationSummaryBean osb = new OrganizationSummaryBean(); osb.setId(bean.getId()); osb.setName(bean.getName()); osb.setDescription(bean.getDescription()); rval.getBeans().add(osb); } return rval; }
if (AuditUtils.valueChanged(orgForUpdate.getDescription(), bean.getDescription())) { auditData.addChange("description", orgForUpdate.getDescription(), bean.getDescription()); //$NON-NLS-1$ orgForUpdate.setDescription(bean.getDescription());
if (AuditUtils.valueChanged(orgForUpdate.getDescription(), bean.getDescription())) { auditData.addChange("description", orgForUpdate.getDescription(), bean.getDescription()); //$NON-NLS-1$ orgForUpdate.setDescription(bean.getDescription());
/** * Marshals the given bean into the given map. * @param bean the bean * @return the content builder * @throws StorageException when a storage problem occurs while storing a bean */ public static XContentBuilder marshall(OrganizationBean bean) throws StorageException { try (XContentBuilder builder = XContentFactory.jsonBuilder()) { preMarshall(bean); builder .startObject() .field("id", bean.getId()) .field("name", bean.getName()) .field("description", bean.getDescription()) .field("createdBy", bean.getCreatedBy()) .field("createdOn", bean.getCreatedOn().getTime()) .field("modifiedBy", bean.getModifiedBy()) .field("modifiedOn", bean.getModifiedOn().getTime()) .endObject(); postMarshall(bean); return builder; } catch (IOException e) { throw new StorageException(e); } }
/** * Marshals the given bean into the given map. * @param bean the bean * @return the content builder * @throws StorageException when a storage problem occurs while storing a bean */ public static XContentBuilder marshall(OrganizationBean bean) throws StorageException { try (XContentBuilder builder = XContentFactory.jsonBuilder()) { preMarshall(bean); builder .startObject() .field("id", bean.getId()) .field("name", bean.getName()) .field("description", bean.getDescription()) .field("createdBy", bean.getCreatedBy()) .field("createdOn", bean.getCreatedOn().getTime()) .field("modifiedBy", bean.getModifiedBy()) .field("modifiedOn", bean.getModifiedOn().getTime()) .endObject(); postMarshall(bean); return builder; } catch (IOException e) { throw new StorageException(e); } }