本文整理汇总了Java中com.liferay.portal.kernel.util.SetUtil类的典型用法代码示例。如果您正苦于以下问题:Java SetUtil类的具体用法?Java SetUtil怎么用?Java SetUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SetUtil类属于com.liferay.portal.kernel.util包,在下文中一共展示了SetUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEmail
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
private EmailDTO getEmail(Email email) {
EmailDTO emailDTO = new EmailDTO();
if (email != null) {
emailDTO.setAddress(email.getValue());
// emailDTO.setAddress(email.getValue());
// TODO: Add multi-type support
StringBuilder sb = new StringBuilder();
Set<EmailType> types = SetUtil.fromList(email.getTypes());
if (types.size() > 0) {
for (EmailType type : types) {
sb.append(type.getValue());
}
} else {
sb.append("other");
}
emailDTO.setType(sb.toString());
}
return emailDTO;
}
示例2: getPhone
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
private PhoneDTO getPhone(Telephone phone) {
PhoneDTO phoneDTO = new PhoneDTO();
if (phone != null) {
phoneDTO.setNumber(phone.getText());
StringBuilder sb = new StringBuilder();
Set<TelephoneType> types = SetUtil.fromList(phone.getTypes());
// TODO: Add support for multiple telephone types
// e.g. home-fax, work-mobile, etc.
if (types.size() > 0) {
for (TelephoneType type : types) {
sb.append(type.getValue());
}
} else {
sb.append("other");
}
phoneDTO.setType(sb.toString());
}
return phoneDTO;
}
示例3: setDossierDocs
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the dossier docs associated with the doc template, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the doc template
* @param dossierDocPKs the primary keys of the dossier docs to be associated with the doc template
* @throws SystemException if a system exception occurred
*/
@Override
public void setDossierDocs(long pk, long[] dossierDocPKs)
throws SystemException {
Set<Long> newDossierDocPKsSet = SetUtil.fromArray(dossierDocPKs);
Set<Long> oldDossierDocPKsSet = SetUtil.fromArray(docTemplateToDossierDocTableMapper.getRightPrimaryKeys(
pk));
Set<Long> removeDossierDocPKsSet = new HashSet<Long>(oldDossierDocPKsSet);
removeDossierDocPKsSet.removeAll(newDossierDocPKsSet);
for (long removeDossierDocPK : removeDossierDocPKsSet) {
docTemplateToDossierDocTableMapper.deleteTableMapping(pk,
removeDossierDocPK);
}
newDossierDocPKsSet.removeAll(oldDossierDocPKsSet);
for (long newDossierDocPK : newDossierDocPKsSet) {
docTemplateToDossierDocTableMapper.addTableMapping(pk,
newDossierDocPK);
}
}
示例4: setDocTemplates
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the doc templates associated with the dossier doc, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the dossier doc
* @param docTemplatePKs the primary keys of the doc templates to be associated with the dossier doc
* @throws SystemException if a system exception occurred
*/
@Override
public void setDocTemplates(long pk, long[] docTemplatePKs)
throws SystemException {
Set<Long> newDocTemplatePKsSet = SetUtil.fromArray(docTemplatePKs);
Set<Long> oldDocTemplatePKsSet = SetUtil.fromArray(dossierDocToDocTemplateTableMapper.getRightPrimaryKeys(
pk));
Set<Long> removeDocTemplatePKsSet = new HashSet<Long>(oldDocTemplatePKsSet);
removeDocTemplatePKsSet.removeAll(newDocTemplatePKsSet);
for (long removeDocTemplatePK : removeDocTemplatePKsSet) {
dossierDocToDocTemplateTableMapper.deleteTableMapping(pk,
removeDocTemplatePK);
}
newDocTemplatePKsSet.removeAll(oldDocTemplatePKsSet);
for (long newDocTemplatePK : newDocTemplatePKsSet) {
dossierDocToDocTemplateTableMapper.addTableMapping(pk,
newDocTemplatePK);
}
}
示例5: setJobPoses
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the Job Poses associated with the employee, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the employee
* @param jobPosPKs the primary keys of the Job Poses to be associated with the employee
* @throws SystemException if a system exception occurred
*/
@Override
public void setJobPoses(long pk, long[] jobPosPKs)
throws SystemException {
Set<Long> newJobPosPKsSet = SetUtil.fromArray(jobPosPKs);
Set<Long> oldJobPosPKsSet = SetUtil.fromArray(employeeToJobPosTableMapper.getRightPrimaryKeys(
pk));
Set<Long> removeJobPosPKsSet = new HashSet<Long>(oldJobPosPKsSet);
removeJobPosPKsSet.removeAll(newJobPosPKsSet);
for (long removeJobPosPK : removeJobPosPKsSet) {
employeeToJobPosTableMapper.deleteTableMapping(pk, removeJobPosPK);
}
newJobPosPKsSet.removeAll(oldJobPosPKsSet);
for (long newJobPosPK : newJobPosPKsSet) {
employeeToJobPosTableMapper.addTableMapping(pk, newJobPosPK);
}
}
示例6: setEmployees
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the employees associated with the Job Pos, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the Job Pos
* @param employeePKs the primary keys of the employees to be associated with the Job Pos
* @throws SystemException if a system exception occurred
*/
@Override
public void setEmployees(long pk, long[] employeePKs)
throws SystemException {
Set<Long> newEmployeePKsSet = SetUtil.fromArray(employeePKs);
Set<Long> oldEmployeePKsSet = SetUtil.fromArray(jobPosToEmployeeTableMapper.getRightPrimaryKeys(
pk));
Set<Long> removeEmployeePKsSet = new HashSet<Long>(oldEmployeePKsSet);
removeEmployeePKsSet.removeAll(newEmployeePKsSet);
for (long removeEmployeePK : removeEmployeePKsSet) {
jobPosToEmployeeTableMapper.deleteTableMapping(pk, removeEmployeePK);
}
newEmployeePKsSet.removeAll(oldEmployeePKsSet);
for (long newEmployeePK : newEmployeePKsSet) {
jobPosToEmployeeTableMapper.addTableMapping(pk, newEmployeePK);
}
}
示例7: setDictDatas
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the dictionary datas associated with the dictionary collection, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the dictionary collection
* @param dictDataPKs the primary keys of the dictionary datas to be associated with the dictionary collection
* @throws SystemException if a system exception occurred
*/
@Override
public void setDictDatas(long pk, long[] dictDataPKs)
throws SystemException {
Set<Long> newDictDataPKsSet = SetUtil.fromArray(dictDataPKs);
Set<Long> oldDictDataPKsSet = SetUtil.fromArray(dictCollectionToDictDataTableMapper.getRightPrimaryKeys(
pk));
Set<Long> removeDictDataPKsSet = new HashSet<Long>(oldDictDataPKsSet);
removeDictDataPKsSet.removeAll(newDictDataPKsSet);
for (long removeDictDataPK : removeDictDataPKsSet) {
dictCollectionToDictDataTableMapper.deleteTableMapping(pk,
removeDictDataPK);
}
newDictDataPKsSet.removeAll(oldDictDataPKsSet);
for (long newDictDataPK : newDictDataPKsSet) {
dictCollectionToDictDataTableMapper.addTableMapping(pk,
newDictDataPK);
}
}
示例8: setDictCollections
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the dictionary collections associated with the dictionary data, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the dictionary data
* @param dictCollectionPKs the primary keys of the dictionary collections to be associated with the dictionary data
* @throws SystemException if a system exception occurred
*/
@Override
public void setDictCollections(long pk, long[] dictCollectionPKs)
throws SystemException {
Set<Long> newDictCollectionPKsSet = SetUtil.fromArray(dictCollectionPKs);
Set<Long> oldDictCollectionPKsSet = SetUtil.fromArray(dictDataToDictCollectionTableMapper.getRightPrimaryKeys(
pk));
Set<Long> removeDictCollectionPKsSet = new HashSet<Long>(oldDictCollectionPKsSet);
removeDictCollectionPKsSet.removeAll(newDictCollectionPKsSet);
for (long removeDictCollectionPK : removeDictCollectionPKsSet) {
dictDataToDictCollectionTableMapper.deleteTableMapping(pk,
removeDictCollectionPK);
}
newDictCollectionPKsSet.removeAll(oldDictCollectionPKsSet);
for (long newDictCollectionPK : newDictCollectionPKsSet) {
dictDataToDictCollectionTableMapper.addTableMapping(pk,
newDictCollectionPK);
}
}
示例9: setApplications
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the applications associated with the category, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the category
* @param applicationPKs the primary keys of the applications to be associated with the category
* @throws SystemException if a system exception occurred
*/
public void setApplications(long pk, long[] applicationPKs)
throws SystemException {
try {
Set<Long> applicationPKSet = SetUtil.fromArray(applicationPKs);
List<de.fraunhofer.fokus.movepla.model.Application> applications = getApplications(pk);
for (de.fraunhofer.fokus.movepla.model.Application application : applications) {
if (!applicationPKSet.remove(application.getPrimaryKey())) {
removeApplication.remove(pk, application.getPrimaryKey());
}
}
for (Long applicationPK : applicationPKSet) {
addApplication.add(pk, applicationPK);
}
} catch (Exception e) {
throw processException(e);
} finally {
FinderCacheUtil.clearCache(CategoryModelImpl.MAPPING_TABLE_MVP_APPLICATION_CATEGORY_NAME);
}
}
示例10: setApplications
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the applications associated with the region, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the region
* @param applicationPKs the primary keys of the applications to be associated with the region
* @throws SystemException if a system exception occurred
*/
public void setApplications(long pk, long[] applicationPKs)
throws SystemException {
try {
Set<Long> applicationPKSet = SetUtil.fromArray(applicationPKs);
List<de.fraunhofer.fokus.movepla.model.Application> applications = getApplications(pk);
for (de.fraunhofer.fokus.movepla.model.Application application : applications) {
if (!applicationPKSet.remove(application.getPrimaryKey())) {
removeApplication.remove(pk, application.getPrimaryKey());
}
}
for (Long applicationPK : applicationPKSet) {
addApplication.add(pk, applicationPK);
}
} catch (Exception e) {
throw processException(e);
} finally {
FinderCacheUtil.clearCache(RegionModelImpl.MAPPING_TABLE_MVP_APPLICATION_REGION_NAME);
}
}
示例11: setCategories
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the categories associated with the application, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the application
* @param categoryPKs the primary keys of the categories to be associated with the application
* @throws SystemException if a system exception occurred
*/
public void setCategories(long pk, long[] categoryPKs)
throws SystemException {
try {
Set<Long> categoryPKSet = SetUtil.fromArray(categoryPKs);
List<de.fraunhofer.fokus.movepla.model.Category> categories = getCategories(pk);
for (de.fraunhofer.fokus.movepla.model.Category category : categories) {
if (!categoryPKSet.remove(category.getPrimaryKey())) {
removeCategory.remove(pk, category.getPrimaryKey());
}
}
for (Long categoryPK : categoryPKSet) {
addCategory.add(pk, categoryPK);
}
} catch (Exception e) {
throw processException(e);
} finally {
FinderCacheUtil.clearCache(ApplicationModelImpl.MAPPING_TABLE_MVP_APPLICATION_CATEGORY_NAME);
}
}
示例12: setRegions
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the regions associated with the application, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the application
* @param regionPKs the primary keys of the regions to be associated with the application
* @throws SystemException if a system exception occurred
*/
public void setRegions(long pk, long[] regionPKs) throws SystemException {
try {
Set<Long> regionPKSet = SetUtil.fromArray(regionPKs);
List<de.fraunhofer.fokus.movepla.model.Region> regions = getRegions(pk);
for (de.fraunhofer.fokus.movepla.model.Region region : regions) {
if (!regionPKSet.remove(region.getPrimaryKey())) {
removeRegion.remove(pk, region.getPrimaryKey());
}
}
for (Long regionPK : regionPKSet) {
addRegion.add(pk, regionPK);
}
} catch (Exception e) {
throw processException(e);
} finally {
FinderCacheUtil.clearCache(ApplicationModelImpl.MAPPING_TABLE_MVP_APPLICATION_REGION_NAME);
}
}
示例13: setLanguages
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the languages associated with the application, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the application
* @param languagePKs the primary keys of the languages to be associated with the application
* @throws SystemException if a system exception occurred
*/
public void setLanguages(long pk, long[] languagePKs)
throws SystemException {
try {
Set<Long> languagePKSet = SetUtil.fromArray(languagePKs);
List<de.fraunhofer.fokus.movepla.model.Language> languages = getLanguages(pk);
for (de.fraunhofer.fokus.movepla.model.Language language : languages) {
if (!languagePKSet.remove(language.getPrimaryKey())) {
removeLanguage.remove(pk, language.getPrimaryKey());
}
}
for (Long languagePK : languagePKSet) {
addLanguage.add(pk, languagePK);
}
} catch (Exception e) {
throw processException(e);
} finally {
FinderCacheUtil.clearCache(ApplicationModelImpl.MAPPING_TABLE_MVP_APPLICATION_LANGUAGE_NAME);
}
}
示例14: setApplications
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the applications associated with the language, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the language
* @param applicationPKs the primary keys of the applications to be associated with the language
* @throws SystemException if a system exception occurred
*/
public void setApplications(long pk, long[] applicationPKs)
throws SystemException {
try {
Set<Long> applicationPKSet = SetUtil.fromArray(applicationPKs);
List<de.fraunhofer.fokus.movepla.model.Application> applications = getApplications(pk);
for (de.fraunhofer.fokus.movepla.model.Application application : applications) {
if (!applicationPKSet.remove(application.getPrimaryKey())) {
removeApplication.remove(pk, application.getPrimaryKey());
}
}
for (Long applicationPK : applicationPKSet) {
addApplication.add(pk, applicationPK);
}
} catch (Exception e) {
throw processException(e);
} finally {
FinderCacheUtil.clearCache(LanguageModelImpl.MAPPING_TABLE_MVP_APPLICATION_LANGUAGE_NAME);
}
}
示例15: setAHCatEntrieses
import com.liferay.portal.kernel.util.SetUtil; //导入依赖的package包/类
/**
* Sets the a h cat entrieses associated with the a h offer, removing and adding associations as necessary. Also notifies the appropriate model listeners and clears the mapping table finder cache.
*
* @param pk the primary key of the a h offer
* @param ahCatEntriesPKs the primary keys of the a h cat entrieses to be associated with the a h offer
* @throws SystemException if a system exception occurred
*/
@Override
public void setAHCatEntrieses(long pk, long[] ahCatEntriesPKs)
throws SystemException {
Set<Long> newAHCatEntriesPKsSet = SetUtil.fromArray(ahCatEntriesPKs);
Set<Long> oldAHCatEntriesPKsSet = SetUtil.fromArray(ahOfferToAHCatEntriesTableMapper.getRightPrimaryKeys(
pk));
Set<Long> removeAHCatEntriesPKsSet = new HashSet<Long>(oldAHCatEntriesPKsSet);
removeAHCatEntriesPKsSet.removeAll(newAHCatEntriesPKsSet);
for (long removeAHCatEntriesPK : removeAHCatEntriesPKsSet) {
ahOfferToAHCatEntriesTableMapper.deleteTableMapping(pk,
removeAHCatEntriesPK);
}
newAHCatEntriesPKsSet.removeAll(oldAHCatEntriesPKsSet);
for (long newAHCatEntriesPK : newAHCatEntriesPKsSet) {
ahOfferToAHCatEntriesTableMapper.addTableMapping(pk,
newAHCatEntriesPK);
}
}