repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionSpecificationOptionValueLocalServiceBaseImpl.java | CPDefinitionSpecificationOptionValueLocalServiceBaseImpl.getCPDefinitionSpecificationOptionValuesByUuidAndCompanyId | @Override
public List<CPDefinitionSpecificationOptionValue> getCPDefinitionSpecificationOptionValuesByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CPDefinitionSpecificationOptionValue> orderByComparator) {
return cpDefinitionSpecificationOptionValuePersistence.findByUuid_C(uuid,
companyId, start, end, orderByComparator);
} | java | @Override
public List<CPDefinitionSpecificationOptionValue> getCPDefinitionSpecificationOptionValuesByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CPDefinitionSpecificationOptionValue> orderByComparator) {
return cpDefinitionSpecificationOptionValuePersistence.findByUuid_C(uuid,
companyId, start, end, orderByComparator);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionSpecificationOptionValue",
">",
"getCPDefinitionSpecificationOptionValuesByUuidAndCompanyId",
"(",
"String",
"uuid",
",",
"long",
"companyId",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CP... | Returns a range of cp definition specification option values matching the UUID and company.
@param uuid the UUID of the cp definition specification option values
@param companyId the primary key of the company
@param start the lower bound of the range of cp definition specification option values
@param end the upper bound of the range of cp definition specification option values (not inclusive)
@param orderByComparator the comparator to order the results by (optionally <code>null</code>)
@return the range of matching cp definition specification option values, or an empty list if no matches were found | [
"Returns",
"a",
"range",
"of",
"cp",
"definition",
"specification",
"option",
"values",
"matching",
"the",
"UUID",
"and",
"company",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionSpecificationOptionValueLocalServiceBaseImpl.java#L412-L418 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionSpecificationOptionValueLocalServiceBaseImpl.java | CPDefinitionSpecificationOptionValueLocalServiceBaseImpl.updateCPDefinitionSpecificationOptionValue | @Indexable(type = IndexableType.REINDEX)
@Override
public CPDefinitionSpecificationOptionValue updateCPDefinitionSpecificationOptionValue(
CPDefinitionSpecificationOptionValue cpDefinitionSpecificationOptionValue) {
return cpDefinitionSpecificationOptionValuePersistence.update(cpDefinitionSpecificationOptionValue);
} | java | @Indexable(type = IndexableType.REINDEX)
@Override
public CPDefinitionSpecificationOptionValue updateCPDefinitionSpecificationOptionValue(
CPDefinitionSpecificationOptionValue cpDefinitionSpecificationOptionValue) {
return cpDefinitionSpecificationOptionValuePersistence.update(cpDefinitionSpecificationOptionValue);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"REINDEX",
")",
"@",
"Override",
"public",
"CPDefinitionSpecificationOptionValue",
"updateCPDefinitionSpecificationOptionValue",
"(",
"CPDefinitionSpecificationOptionValue",
"cpDefinitionSpecificationOptionValue",
")",
"{"... | Updates the cp definition specification option value in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
@param cpDefinitionSpecificationOptionValue the cp definition specification option value
@return the cp definition specification option value that was updated | [
"Updates",
"the",
"cp",
"definition",
"specification",
"option",
"value",
"in",
"the",
"database",
"or",
"adds",
"it",
"if",
"it",
"does",
"not",
"yet",
"exist",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionSpecificationOptionValueLocalServiceBaseImpl.java#L469-L474 | train |
liferay/com-liferay-commerce | commerce-tax-engine-fixed-api/src/main/java/com/liferay/commerce/tax/engine/fixed/service/CommerceTaxFixedRateLocalServiceWrapper.java | CommerceTaxFixedRateLocalServiceWrapper.getCommerceTaxFixedRate | @Override
public com.liferay.commerce.tax.engine.fixed.model.CommerceTaxFixedRate getCommerceTaxFixedRate(
long commerceTaxFixedRateId)
throws com.liferay.portal.kernel.exception.PortalException {
return _commerceTaxFixedRateLocalService.getCommerceTaxFixedRate(commerceTaxFixedRateId);
} | java | @Override
public com.liferay.commerce.tax.engine.fixed.model.CommerceTaxFixedRate getCommerceTaxFixedRate(
long commerceTaxFixedRateId)
throws com.liferay.portal.kernel.exception.PortalException {
return _commerceTaxFixedRateLocalService.getCommerceTaxFixedRate(commerceTaxFixedRateId);
} | [
"@",
"Override",
"public",
"com",
".",
"liferay",
".",
"commerce",
".",
"tax",
".",
"engine",
".",
"fixed",
".",
"model",
".",
"CommerceTaxFixedRate",
"getCommerceTaxFixedRate",
"(",
"long",
"commerceTaxFixedRateId",
")",
"throws",
"com",
".",
"liferay",
".",
... | Returns the commerce tax fixed rate with the primary key.
@param commerceTaxFixedRateId the primary key of the commerce tax fixed rate
@return the commerce tax fixed rate
@throws PortalException if a commerce tax fixed rate with the primary key could not be found | [
"Returns",
"the",
"commerce",
"tax",
"fixed",
"rate",
"with",
"the",
"primary",
"key",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-engine-fixed-api/src/main/java/com/liferay/commerce/tax/engine/fixed/service/CommerceTaxFixedRateLocalServiceWrapper.java#L230-L235 | train |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.cacheResult | @Override
public void cacheResult(CommerceWarehouse commerceWarehouse) {
entityCache.putResult(CommerceWarehouseModelImpl.ENTITY_CACHE_ENABLED,
CommerceWarehouseImpl.class, commerceWarehouse.getPrimaryKey(),
commerceWarehouse);
commerceWarehouse.resetOriginalValues();
} | java | @Override
public void cacheResult(CommerceWarehouse commerceWarehouse) {
entityCache.putResult(CommerceWarehouseModelImpl.ENTITY_CACHE_ENABLED,
CommerceWarehouseImpl.class, commerceWarehouse.getPrimaryKey(),
commerceWarehouse);
commerceWarehouse.resetOriginalValues();
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"CommerceWarehouse",
"commerceWarehouse",
")",
"{",
"entityCache",
".",
"putResult",
"(",
"CommerceWarehouseModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceWarehouseImpl",
".",
"class",
",",
"commerceWarehouse"... | Caches the commerce warehouse in the entity cache if it is enabled.
@param commerceWarehouse the commerce warehouse | [
"Caches",
"the",
"commerce",
"warehouse",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L4691-L4698 | train |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.cacheResult | @Override
public void cacheResult(List<CommerceWarehouse> commerceWarehouses) {
for (CommerceWarehouse commerceWarehouse : commerceWarehouses) {
if (entityCache.getResult(
CommerceWarehouseModelImpl.ENTITY_CACHE_ENABLED,
CommerceWarehouseImpl.class,
commerceWarehouse.getPrimaryKey()) == null) {
cacheResult(commerceWarehouse);
}
else {
commerceWarehouse.resetOriginalValues();
}
}
} | java | @Override
public void cacheResult(List<CommerceWarehouse> commerceWarehouses) {
for (CommerceWarehouse commerceWarehouse : commerceWarehouses) {
if (entityCache.getResult(
CommerceWarehouseModelImpl.ENTITY_CACHE_ENABLED,
CommerceWarehouseImpl.class,
commerceWarehouse.getPrimaryKey()) == null) {
cacheResult(commerceWarehouse);
}
else {
commerceWarehouse.resetOriginalValues();
}
}
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"List",
"<",
"CommerceWarehouse",
">",
"commerceWarehouses",
")",
"{",
"for",
"(",
"CommerceWarehouse",
"commerceWarehouse",
":",
"commerceWarehouses",
")",
"{",
"if",
"(",
"entityCache",
".",
"getResult",
"("... | Caches the commerce warehouses in the entity cache if it is enabled.
@param commerceWarehouses the commerce warehouses | [
"Caches",
"the",
"commerce",
"warehouses",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L4705-L4718 | train |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.clearCache | @Override
public void clearCache() {
entityCache.clearCache(CommerceWarehouseImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache() {
entityCache.clearCache(CommerceWarehouseImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
")",
"{",
"entityCache",
".",
"clearCache",
"(",
"CommerceWarehouseImpl",
".",
"class",
")",
";",
"finderCache",
".",
"clearCache",
"(",
"FINDER_CLASS_NAME_ENTITY",
")",
";",
"finderCache",
".",
"clearCache",
... | Clears the cache for all commerce warehouses.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"all",
"commerce",
"warehouses",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L4727-L4734 | train |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.clearCache | @Override
public void clearCache(CommerceWarehouse commerceWarehouse) {
entityCache.removeResult(CommerceWarehouseModelImpl.ENTITY_CACHE_ENABLED,
CommerceWarehouseImpl.class, commerceWarehouse.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache(CommerceWarehouse commerceWarehouse) {
entityCache.removeResult(CommerceWarehouseModelImpl.ENTITY_CACHE_ENABLED,
CommerceWarehouseImpl.class, commerceWarehouse.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
"CommerceWarehouse",
"commerceWarehouse",
")",
"{",
"entityCache",
".",
"removeResult",
"(",
"CommerceWarehouseModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceWarehouseImpl",
".",
"class",
",",
"commerceWarehous... | Clears the cache for the commerce warehouse.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"the",
"commerce",
"warehouse",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L4743-L4750 | train |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java | CommerceWarehousePersistenceImpl.findAll | @Override
public List<CommerceWarehouse> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceWarehouse> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceWarehouse",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce warehouses.
@return the commerce warehouses | [
"Returns",
"all",
"the",
"commerce",
"warehouses",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehousePersistenceImpl.java#L5397-L5400 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPFriendlyURLEntryLocalServiceBaseImpl.java | CPFriendlyURLEntryLocalServiceBaseImpl.addCPFriendlyURLEntry | @Indexable(type = IndexableType.REINDEX)
@Override
public CPFriendlyURLEntry addCPFriendlyURLEntry(
CPFriendlyURLEntry cpFriendlyURLEntry) {
cpFriendlyURLEntry.setNew(true);
return cpFriendlyURLEntryPersistence.update(cpFriendlyURLEntry);
} | java | @Indexable(type = IndexableType.REINDEX)
@Override
public CPFriendlyURLEntry addCPFriendlyURLEntry(
CPFriendlyURLEntry cpFriendlyURLEntry) {
cpFriendlyURLEntry.setNew(true);
return cpFriendlyURLEntryPersistence.update(cpFriendlyURLEntry);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"REINDEX",
")",
"@",
"Override",
"public",
"CPFriendlyURLEntry",
"addCPFriendlyURLEntry",
"(",
"CPFriendlyURLEntry",
"cpFriendlyURLEntry",
")",
"{",
"cpFriendlyURLEntry",
".",
"setNew",
"(",
"true",
")",
";",... | Adds the cp friendly url entry to the database. Also notifies the appropriate model listeners.
@param cpFriendlyURLEntry the cp friendly url entry
@return the cp friendly url entry that was added | [
"Adds",
"the",
"cp",
"friendly",
"url",
"entry",
"to",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPFriendlyURLEntryLocalServiceBaseImpl.java#L114-L121 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPFriendlyURLEntryLocalServiceBaseImpl.java | CPFriendlyURLEntryLocalServiceBaseImpl.deleteCPFriendlyURLEntry | @Indexable(type = IndexableType.DELETE)
@Override
public CPFriendlyURLEntry deleteCPFriendlyURLEntry(
long CPFriendlyURLEntryId) throws PortalException {
return cpFriendlyURLEntryPersistence.remove(CPFriendlyURLEntryId);
} | java | @Indexable(type = IndexableType.DELETE)
@Override
public CPFriendlyURLEntry deleteCPFriendlyURLEntry(
long CPFriendlyURLEntryId) throws PortalException {
return cpFriendlyURLEntryPersistence.remove(CPFriendlyURLEntryId);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"DELETE",
")",
"@",
"Override",
"public",
"CPFriendlyURLEntry",
"deleteCPFriendlyURLEntry",
"(",
"long",
"CPFriendlyURLEntryId",
")",
"throws",
"PortalException",
"{",
"return",
"cpFriendlyURLEntryPersistence",
"... | Deletes the cp friendly url entry with the primary key from the database. Also notifies the appropriate model listeners.
@param CPFriendlyURLEntryId the primary key of the cp friendly url entry
@return the cp friendly url entry that was removed
@throws PortalException if a cp friendly url entry with the primary key could not be found | [
"Deletes",
"the",
"cp",
"friendly",
"url",
"entry",
"with",
"the",
"primary",
"key",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPFriendlyURLEntryLocalServiceBaseImpl.java#L143-L148 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPFriendlyURLEntryLocalServiceBaseImpl.java | CPFriendlyURLEntryLocalServiceBaseImpl.deleteCPFriendlyURLEntry | @Indexable(type = IndexableType.DELETE)
@Override
public CPFriendlyURLEntry deleteCPFriendlyURLEntry(
CPFriendlyURLEntry cpFriendlyURLEntry) {
return cpFriendlyURLEntryPersistence.remove(cpFriendlyURLEntry);
} | java | @Indexable(type = IndexableType.DELETE)
@Override
public CPFriendlyURLEntry deleteCPFriendlyURLEntry(
CPFriendlyURLEntry cpFriendlyURLEntry) {
return cpFriendlyURLEntryPersistence.remove(cpFriendlyURLEntry);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"DELETE",
")",
"@",
"Override",
"public",
"CPFriendlyURLEntry",
"deleteCPFriendlyURLEntry",
"(",
"CPFriendlyURLEntry",
"cpFriendlyURLEntry",
")",
"{",
"return",
"cpFriendlyURLEntryPersistence",
".",
"remove",
"("... | Deletes the cp friendly url entry from the database. Also notifies the appropriate model listeners.
@param cpFriendlyURLEntry the cp friendly url entry
@return the cp friendly url entry that was removed | [
"Deletes",
"the",
"cp",
"friendly",
"url",
"entry",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPFriendlyURLEntryLocalServiceBaseImpl.java#L156-L161 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPFriendlyURLEntryLocalServiceBaseImpl.java | CPFriendlyURLEntryLocalServiceBaseImpl.getCPFriendlyURLEntriesByUuidAndCompanyId | @Override
public List<CPFriendlyURLEntry> getCPFriendlyURLEntriesByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CPFriendlyURLEntry> orderByComparator) {
return cpFriendlyURLEntryPersistence.findByUuid_C(uuid, companyId,
start, end, orderByComparator);
} | java | @Override
public List<CPFriendlyURLEntry> getCPFriendlyURLEntriesByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CPFriendlyURLEntry> orderByComparator) {
return cpFriendlyURLEntryPersistence.findByUuid_C(uuid, companyId,
start, end, orderByComparator);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPFriendlyURLEntry",
">",
"getCPFriendlyURLEntriesByUuidAndCompanyId",
"(",
"String",
"uuid",
",",
"long",
"companyId",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CPFriendlyURLEntry",
">",
"orderB... | Returns a range of cp friendly url entries matching the UUID and company.
@param uuid the UUID of the cp friendly url entries
@param companyId the primary key of the company
@param start the lower bound of the range of cp friendly url entries
@param end the upper bound of the range of cp friendly url entries (not inclusive)
@param orderByComparator the comparator to order the results by (optionally <code>null</code>)
@return the range of matching cp friendly url entries, or an empty list if no matches were found | [
"Returns",
"a",
"range",
"of",
"cp",
"friendly",
"url",
"entries",
"matching",
"the",
"UUID",
"and",
"company",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPFriendlyURLEntryLocalServiceBaseImpl.java#L419-L425 | train |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/base/CommerceOrderItemLocalServiceBaseImpl.java | CommerceOrderItemLocalServiceBaseImpl.fetchCommerceOrderItemByReferenceCode | @Override
public CommerceOrderItem fetchCommerceOrderItemByReferenceCode(
long companyId, String externalReferenceCode) {
return commerceOrderItemPersistence.fetchByC_ERC(companyId, null);
} | java | @Override
public CommerceOrderItem fetchCommerceOrderItemByReferenceCode(
long companyId, String externalReferenceCode) {
return commerceOrderItemPersistence.fetchByC_ERC(companyId, null);
} | [
"@",
"Override",
"public",
"CommerceOrderItem",
"fetchCommerceOrderItemByReferenceCode",
"(",
"long",
"companyId",
",",
"String",
"externalReferenceCode",
")",
"{",
"return",
"commerceOrderItemPersistence",
".",
"fetchByC_ERC",
"(",
"companyId",
",",
"null",
")",
";",
"... | Returns the commerce order item with the matching external reference code and company.
@param companyId the primary key of the company
@param externalReferenceCode the commerce order item's external reference code
@return the matching commerce order item, or <code>null</code> if a matching commerce order item could not be found | [
"Returns",
"the",
"commerce",
"order",
"item",
"with",
"the",
"matching",
"external",
"reference",
"code",
"and",
"company",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/base/CommerceOrderItemLocalServiceBaseImpl.java#L251-L255 | train |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/model/CommerceAvailabilityEstimateWrapper.java | CommerceAvailabilityEstimateWrapper.getTitle | @Override
public String getTitle(String languageId, boolean useDefault) {
return _commerceAvailabilityEstimate.getTitle(languageId, useDefault);
} | java | @Override
public String getTitle(String languageId, boolean useDefault) {
return _commerceAvailabilityEstimate.getTitle(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getTitle",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceAvailabilityEstimate",
".",
"getTitle",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized title of this commerce availability estimate in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested language
@return the localized title of this commerce availability estimate | [
"Returns",
"the",
"localized",
"title",
"of",
"this",
"commerce",
"availability",
"estimate",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/model/CommerceAvailabilityEstimateWrapper.java#L313-L316 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPSpecificationOptionLocalServiceBaseImpl.java | CPSpecificationOptionLocalServiceBaseImpl.addCPSpecificationOption | @Indexable(type = IndexableType.REINDEX)
@Override
public CPSpecificationOption addCPSpecificationOption(
CPSpecificationOption cpSpecificationOption) {
cpSpecificationOption.setNew(true);
return cpSpecificationOptionPersistence.update(cpSpecificationOption);
} | java | @Indexable(type = IndexableType.REINDEX)
@Override
public CPSpecificationOption addCPSpecificationOption(
CPSpecificationOption cpSpecificationOption) {
cpSpecificationOption.setNew(true);
return cpSpecificationOptionPersistence.update(cpSpecificationOption);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"REINDEX",
")",
"@",
"Override",
"public",
"CPSpecificationOption",
"addCPSpecificationOption",
"(",
"CPSpecificationOption",
"cpSpecificationOption",
")",
"{",
"cpSpecificationOption",
".",
"setNew",
"(",
"true"... | Adds the cp specification option to the database. Also notifies the appropriate model listeners.
@param cpSpecificationOption the cp specification option
@return the cp specification option that was added | [
"Adds",
"the",
"cp",
"specification",
"option",
"to",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPSpecificationOptionLocalServiceBaseImpl.java#L114-L121 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPSpecificationOptionLocalServiceBaseImpl.java | CPSpecificationOptionLocalServiceBaseImpl.deleteCPSpecificationOption | @Indexable(type = IndexableType.DELETE)
@Override
public CPSpecificationOption deleteCPSpecificationOption(
long CPSpecificationOptionId) throws PortalException {
return cpSpecificationOptionPersistence.remove(CPSpecificationOptionId);
} | java | @Indexable(type = IndexableType.DELETE)
@Override
public CPSpecificationOption deleteCPSpecificationOption(
long CPSpecificationOptionId) throws PortalException {
return cpSpecificationOptionPersistence.remove(CPSpecificationOptionId);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"DELETE",
")",
"@",
"Override",
"public",
"CPSpecificationOption",
"deleteCPSpecificationOption",
"(",
"long",
"CPSpecificationOptionId",
")",
"throws",
"PortalException",
"{",
"return",
"cpSpecificationOptionPersi... | Deletes the cp specification option with the primary key from the database. Also notifies the appropriate model listeners.
@param CPSpecificationOptionId the primary key of the cp specification option
@return the cp specification option that was removed
@throws PortalException if a cp specification option with the primary key could not be found | [
"Deletes",
"the",
"cp",
"specification",
"option",
"with",
"the",
"primary",
"key",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPSpecificationOptionLocalServiceBaseImpl.java#L143-L148 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPSpecificationOptionLocalServiceBaseImpl.java | CPSpecificationOptionLocalServiceBaseImpl.getCPSpecificationOptionsByUuidAndCompanyId | @Override
public List<CPSpecificationOption> getCPSpecificationOptionsByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CPSpecificationOption> orderByComparator) {
return cpSpecificationOptionPersistence.findByUuid_C(uuid, companyId,
start, end, orderByComparator);
} | java | @Override
public List<CPSpecificationOption> getCPSpecificationOptionsByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CPSpecificationOption> orderByComparator) {
return cpSpecificationOptionPersistence.findByUuid_C(uuid, companyId,
start, end, orderByComparator);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPSpecificationOption",
">",
"getCPSpecificationOptionsByUuidAndCompanyId",
"(",
"String",
"uuid",
",",
"long",
"companyId",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CPSpecificationOption",
">",
... | Returns a range of cp specification options matching the UUID and company.
@param uuid the UUID of the cp specification options
@param companyId the primary key of the company
@param start the lower bound of the range of cp specification options
@param end the upper bound of the range of cp specification options (not inclusive)
@param orderByComparator the comparator to order the results by (optionally <code>null</code>)
@return the range of matching cp specification options, or an empty list if no matches were found | [
"Returns",
"a",
"range",
"of",
"cp",
"specification",
"options",
"matching",
"the",
"UUID",
"and",
"company",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPSpecificationOptionLocalServiceBaseImpl.java#L409-L415 | train |
liferay/com-liferay-commerce | commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java | CPDefinitionVirtualSettingPersistenceImpl.cacheResult | @Override
public void cacheResult(
CPDefinitionVirtualSetting cpDefinitionVirtualSetting) {
entityCache.putResult(CPDefinitionVirtualSettingModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionVirtualSettingImpl.class,
cpDefinitionVirtualSetting.getPrimaryKey(),
cpDefinitionVirtualSetting);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
cpDefinitionVirtualSetting.getUuid(),
cpDefinitionVirtualSetting.getGroupId()
}, cpDefinitionVirtualSetting);
finderCache.putResult(FINDER_PATH_FETCH_BY_C_C,
new Object[] {
cpDefinitionVirtualSetting.getClassNameId(),
cpDefinitionVirtualSetting.getClassPK()
}, cpDefinitionVirtualSetting);
cpDefinitionVirtualSetting.resetOriginalValues();
} | java | @Override
public void cacheResult(
CPDefinitionVirtualSetting cpDefinitionVirtualSetting) {
entityCache.putResult(CPDefinitionVirtualSettingModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionVirtualSettingImpl.class,
cpDefinitionVirtualSetting.getPrimaryKey(),
cpDefinitionVirtualSetting);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
cpDefinitionVirtualSetting.getUuid(),
cpDefinitionVirtualSetting.getGroupId()
}, cpDefinitionVirtualSetting);
finderCache.putResult(FINDER_PATH_FETCH_BY_C_C,
new Object[] {
cpDefinitionVirtualSetting.getClassNameId(),
cpDefinitionVirtualSetting.getClassPK()
}, cpDefinitionVirtualSetting);
cpDefinitionVirtualSetting.resetOriginalValues();
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"CPDefinitionVirtualSetting",
"cpDefinitionVirtualSetting",
")",
"{",
"entityCache",
".",
"putResult",
"(",
"CPDefinitionVirtualSettingModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CPDefinitionVirtualSettingImpl",
".",
"... | Caches the cp definition virtual setting in the entity cache if it is enabled.
@param cpDefinitionVirtualSetting the cp definition virtual setting | [
"Caches",
"the",
"cp",
"definition",
"virtual",
"setting",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java#L1757-L1778 | train |
liferay/com-liferay-commerce | commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java | CPDefinitionVirtualSettingPersistenceImpl.cacheResult | @Override
public void cacheResult(
List<CPDefinitionVirtualSetting> cpDefinitionVirtualSettings) {
for (CPDefinitionVirtualSetting cpDefinitionVirtualSetting : cpDefinitionVirtualSettings) {
if (entityCache.getResult(
CPDefinitionVirtualSettingModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionVirtualSettingImpl.class,
cpDefinitionVirtualSetting.getPrimaryKey()) == null) {
cacheResult(cpDefinitionVirtualSetting);
}
else {
cpDefinitionVirtualSetting.resetOriginalValues();
}
}
} | java | @Override
public void cacheResult(
List<CPDefinitionVirtualSetting> cpDefinitionVirtualSettings) {
for (CPDefinitionVirtualSetting cpDefinitionVirtualSetting : cpDefinitionVirtualSettings) {
if (entityCache.getResult(
CPDefinitionVirtualSettingModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionVirtualSettingImpl.class,
cpDefinitionVirtualSetting.getPrimaryKey()) == null) {
cacheResult(cpDefinitionVirtualSetting);
}
else {
cpDefinitionVirtualSetting.resetOriginalValues();
}
}
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"List",
"<",
"CPDefinitionVirtualSetting",
">",
"cpDefinitionVirtualSettings",
")",
"{",
"for",
"(",
"CPDefinitionVirtualSetting",
"cpDefinitionVirtualSetting",
":",
"cpDefinitionVirtualSettings",
")",
"{",
"if",
"(",... | Caches the cp definition virtual settings in the entity cache if it is enabled.
@param cpDefinitionVirtualSettings the cp definition virtual settings | [
"Caches",
"the",
"cp",
"definition",
"virtual",
"settings",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java#L1785-L1799 | train |
liferay/com-liferay-commerce | commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java | CPDefinitionVirtualSettingPersistenceImpl.clearCache | @Override
public void clearCache() {
entityCache.clearCache(CPDefinitionVirtualSettingImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache() {
entityCache.clearCache(CPDefinitionVirtualSettingImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
")",
"{",
"entityCache",
".",
"clearCache",
"(",
"CPDefinitionVirtualSettingImpl",
".",
"class",
")",
";",
"finderCache",
".",
"clearCache",
"(",
"FINDER_CLASS_NAME_ENTITY",
")",
";",
"finderCache",
".",
"clear... | Clears the cache for all cp definition virtual settings.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"all",
"cp",
"definition",
"virtual",
"settings",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java#L1808-L1815 | train |
liferay/com-liferay-commerce | commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java | CPDefinitionVirtualSettingPersistenceImpl.clearCache | @Override
public void clearCache(
CPDefinitionVirtualSetting cpDefinitionVirtualSetting) {
entityCache.removeResult(CPDefinitionVirtualSettingModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionVirtualSettingImpl.class,
cpDefinitionVirtualSetting.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
clearUniqueFindersCache((CPDefinitionVirtualSettingModelImpl)cpDefinitionVirtualSetting,
true);
} | java | @Override
public void clearCache(
CPDefinitionVirtualSetting cpDefinitionVirtualSetting) {
entityCache.removeResult(CPDefinitionVirtualSettingModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionVirtualSettingImpl.class,
cpDefinitionVirtualSetting.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
clearUniqueFindersCache((CPDefinitionVirtualSettingModelImpl)cpDefinitionVirtualSetting,
true);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
"CPDefinitionVirtualSetting",
"cpDefinitionVirtualSetting",
")",
"{",
"entityCache",
".",
"removeResult",
"(",
"CPDefinitionVirtualSettingModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CPDefinitionVirtualSettingImpl",
".",
... | Clears the cache for the cp definition virtual setting.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"the",
"cp",
"definition",
"virtual",
"setting",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java#L1824-L1836 | train |
liferay/com-liferay-commerce | commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java | CPDefinitionVirtualSettingPersistenceImpl.remove | @Override
public CPDefinitionVirtualSetting remove(Serializable primaryKey)
throws NoSuchCPDefinitionVirtualSettingException {
Session session = null;
try {
session = openSession();
CPDefinitionVirtualSetting cpDefinitionVirtualSetting = (CPDefinitionVirtualSetting)session.get(CPDefinitionVirtualSettingImpl.class,
primaryKey);
if (cpDefinitionVirtualSetting == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchCPDefinitionVirtualSettingException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return remove(cpDefinitionVirtualSetting);
}
catch (NoSuchCPDefinitionVirtualSettingException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
} | java | @Override
public CPDefinitionVirtualSetting remove(Serializable primaryKey)
throws NoSuchCPDefinitionVirtualSettingException {
Session session = null;
try {
session = openSession();
CPDefinitionVirtualSetting cpDefinitionVirtualSetting = (CPDefinitionVirtualSetting)session.get(CPDefinitionVirtualSettingImpl.class,
primaryKey);
if (cpDefinitionVirtualSetting == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchCPDefinitionVirtualSettingException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return remove(cpDefinitionVirtualSetting);
}
catch (NoSuchCPDefinitionVirtualSettingException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
} | [
"@",
"Override",
"public",
"CPDefinitionVirtualSetting",
"remove",
"(",
"Serializable",
"primaryKey",
")",
"throws",
"NoSuchCPDefinitionVirtualSettingException",
"{",
"Session",
"session",
"=",
"null",
";",
"try",
"{",
"session",
"=",
"openSession",
"(",
")",
";",
"... | Removes the cp definition virtual setting with the primary key from the database. Also notifies the appropriate model listeners.
@param primaryKey the primary key of the cp definition virtual setting
@return the cp definition virtual setting that was removed
@throws NoSuchCPDefinitionVirtualSettingException if a cp definition virtual setting with the primary key could not be found | [
"Removes",
"the",
"cp",
"definition",
"virtual",
"setting",
"with",
"the",
"primary",
"key",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java#L1965-L1996 | train |
liferay/com-liferay-commerce | commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java | CPDefinitionVirtualSettingPersistenceImpl.findAll | @Override
public List<CPDefinitionVirtualSetting> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionVirtualSetting> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionVirtualSetting",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp definition virtual settings.
@return the cp definition virtual settings | [
"Returns",
"all",
"the",
"cp",
"definition",
"virtual",
"settings",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-service/src/main/java/com/liferay/commerce/product/type/virtual/service/persistence/impl/CPDefinitionVirtualSettingPersistenceImpl.java#L2386-L2389 | train |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java | CommerceNotificationAttachmentPersistenceImpl.cacheResult | @Override
public void cacheResult(
CommerceNotificationAttachment commerceNotificationAttachment) {
entityCache.putResult(CommerceNotificationAttachmentModelImpl.ENTITY_CACHE_ENABLED,
CommerceNotificationAttachmentImpl.class,
commerceNotificationAttachment.getPrimaryKey(),
commerceNotificationAttachment);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
commerceNotificationAttachment.getUuid(),
commerceNotificationAttachment.getGroupId()
}, commerceNotificationAttachment);
commerceNotificationAttachment.resetOriginalValues();
} | java | @Override
public void cacheResult(
CommerceNotificationAttachment commerceNotificationAttachment) {
entityCache.putResult(CommerceNotificationAttachmentModelImpl.ENTITY_CACHE_ENABLED,
CommerceNotificationAttachmentImpl.class,
commerceNotificationAttachment.getPrimaryKey(),
commerceNotificationAttachment);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
commerceNotificationAttachment.getUuid(),
commerceNotificationAttachment.getGroupId()
}, commerceNotificationAttachment);
commerceNotificationAttachment.resetOriginalValues();
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"CommerceNotificationAttachment",
"commerceNotificationAttachment",
")",
"{",
"entityCache",
".",
"putResult",
"(",
"CommerceNotificationAttachmentModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceNotificationAttachmentI... | Caches the commerce notification attachment in the entity cache if it is enabled.
@param commerceNotificationAttachment the commerce notification attachment | [
"Caches",
"the",
"commerce",
"notification",
"attachment",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java#L2084-L2099 | train |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java | CommerceNotificationAttachmentPersistenceImpl.cacheResult | @Override
public void cacheResult(
List<CommerceNotificationAttachment> commerceNotificationAttachments) {
for (CommerceNotificationAttachment commerceNotificationAttachment : commerceNotificationAttachments) {
if (entityCache.getResult(
CommerceNotificationAttachmentModelImpl.ENTITY_CACHE_ENABLED,
CommerceNotificationAttachmentImpl.class,
commerceNotificationAttachment.getPrimaryKey()) == null) {
cacheResult(commerceNotificationAttachment);
}
else {
commerceNotificationAttachment.resetOriginalValues();
}
}
} | java | @Override
public void cacheResult(
List<CommerceNotificationAttachment> commerceNotificationAttachments) {
for (CommerceNotificationAttachment commerceNotificationAttachment : commerceNotificationAttachments) {
if (entityCache.getResult(
CommerceNotificationAttachmentModelImpl.ENTITY_CACHE_ENABLED,
CommerceNotificationAttachmentImpl.class,
commerceNotificationAttachment.getPrimaryKey()) == null) {
cacheResult(commerceNotificationAttachment);
}
else {
commerceNotificationAttachment.resetOriginalValues();
}
}
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"List",
"<",
"CommerceNotificationAttachment",
">",
"commerceNotificationAttachments",
")",
"{",
"for",
"(",
"CommerceNotificationAttachment",
"commerceNotificationAttachment",
":",
"commerceNotificationAttachments",
")",
... | Caches the commerce notification attachments in the entity cache if it is enabled.
@param commerceNotificationAttachments the commerce notification attachments | [
"Caches",
"the",
"commerce",
"notification",
"attachments",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java#L2106-L2120 | train |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java | CommerceNotificationAttachmentPersistenceImpl.clearCache | @Override
public void clearCache() {
entityCache.clearCache(CommerceNotificationAttachmentImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache() {
entityCache.clearCache(CommerceNotificationAttachmentImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
")",
"{",
"entityCache",
".",
"clearCache",
"(",
"CommerceNotificationAttachmentImpl",
".",
"class",
")",
";",
"finderCache",
".",
"clearCache",
"(",
"FINDER_CLASS_NAME_ENTITY",
")",
";",
"finderCache",
".",
"c... | Clears the cache for all commerce notification attachments.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"all",
"commerce",
"notification",
"attachments",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java#L2129-L2136 | train |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java | CommerceNotificationAttachmentPersistenceImpl.clearCache | @Override
public void clearCache(
CommerceNotificationAttachment commerceNotificationAttachment) {
entityCache.removeResult(CommerceNotificationAttachmentModelImpl.ENTITY_CACHE_ENABLED,
CommerceNotificationAttachmentImpl.class,
commerceNotificationAttachment.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
clearUniqueFindersCache((CommerceNotificationAttachmentModelImpl)commerceNotificationAttachment,
true);
} | java | @Override
public void clearCache(
CommerceNotificationAttachment commerceNotificationAttachment) {
entityCache.removeResult(CommerceNotificationAttachmentModelImpl.ENTITY_CACHE_ENABLED,
CommerceNotificationAttachmentImpl.class,
commerceNotificationAttachment.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
clearUniqueFindersCache((CommerceNotificationAttachmentModelImpl)commerceNotificationAttachment,
true);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
"CommerceNotificationAttachment",
"commerceNotificationAttachment",
")",
"{",
"entityCache",
".",
"removeResult",
"(",
"CommerceNotificationAttachmentModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceNotificationAttachmen... | Clears the cache for the commerce notification attachment.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"the",
"commerce",
"notification",
"attachment",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java#L2145-L2157 | train |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java | CommerceNotificationAttachmentPersistenceImpl.findAll | @Override
public List<CommerceNotificationAttachment> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceNotificationAttachment> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationAttachment",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce notification attachments.
@return the commerce notification attachments | [
"Returns",
"all",
"the",
"commerce",
"notification",
"attachments",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationAttachmentPersistenceImpl.java#L2713-L2716 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java | CommerceDiscountUsageEntryPersistenceImpl.cacheResult | @Override
public void cacheResult(
CommerceDiscountUsageEntry commerceDiscountUsageEntry) {
entityCache.putResult(CommerceDiscountUsageEntryModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountUsageEntryImpl.class,
commerceDiscountUsageEntry.getPrimaryKey(),
commerceDiscountUsageEntry);
commerceDiscountUsageEntry.resetOriginalValues();
} | java | @Override
public void cacheResult(
CommerceDiscountUsageEntry commerceDiscountUsageEntry) {
entityCache.putResult(CommerceDiscountUsageEntryModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountUsageEntryImpl.class,
commerceDiscountUsageEntry.getPrimaryKey(),
commerceDiscountUsageEntry);
commerceDiscountUsageEntry.resetOriginalValues();
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"CommerceDiscountUsageEntry",
"commerceDiscountUsageEntry",
")",
"{",
"entityCache",
".",
"putResult",
"(",
"CommerceDiscountUsageEntryModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceDiscountUsageEntryImpl",
".",
"... | Caches the commerce discount usage entry in the entity cache if it is enabled.
@param commerceDiscountUsageEntry the commerce discount usage entry | [
"Caches",
"the",
"commerce",
"discount",
"usage",
"entry",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java#L618-L627 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java | CommerceDiscountUsageEntryPersistenceImpl.cacheResult | @Override
public void cacheResult(
List<CommerceDiscountUsageEntry> commerceDiscountUsageEntries) {
for (CommerceDiscountUsageEntry commerceDiscountUsageEntry : commerceDiscountUsageEntries) {
if (entityCache.getResult(
CommerceDiscountUsageEntryModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountUsageEntryImpl.class,
commerceDiscountUsageEntry.getPrimaryKey()) == null) {
cacheResult(commerceDiscountUsageEntry);
}
else {
commerceDiscountUsageEntry.resetOriginalValues();
}
}
} | java | @Override
public void cacheResult(
List<CommerceDiscountUsageEntry> commerceDiscountUsageEntries) {
for (CommerceDiscountUsageEntry commerceDiscountUsageEntry : commerceDiscountUsageEntries) {
if (entityCache.getResult(
CommerceDiscountUsageEntryModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountUsageEntryImpl.class,
commerceDiscountUsageEntry.getPrimaryKey()) == null) {
cacheResult(commerceDiscountUsageEntry);
}
else {
commerceDiscountUsageEntry.resetOriginalValues();
}
}
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"List",
"<",
"CommerceDiscountUsageEntry",
">",
"commerceDiscountUsageEntries",
")",
"{",
"for",
"(",
"CommerceDiscountUsageEntry",
"commerceDiscountUsageEntry",
":",
"commerceDiscountUsageEntries",
")",
"{",
"if",
"(... | Caches the commerce discount usage entries in the entity cache if it is enabled.
@param commerceDiscountUsageEntries the commerce discount usage entries | [
"Caches",
"the",
"commerce",
"discount",
"usage",
"entries",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java#L634-L648 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java | CommerceDiscountUsageEntryPersistenceImpl.clearCache | @Override
public void clearCache() {
entityCache.clearCache(CommerceDiscountUsageEntryImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache() {
entityCache.clearCache(CommerceDiscountUsageEntryImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
")",
"{",
"entityCache",
".",
"clearCache",
"(",
"CommerceDiscountUsageEntryImpl",
".",
"class",
")",
";",
"finderCache",
".",
"clearCache",
"(",
"FINDER_CLASS_NAME_ENTITY",
")",
";",
"finderCache",
".",
"clear... | Clears the cache for all commerce discount usage entries.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"all",
"commerce",
"discount",
"usage",
"entries",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java#L657-L664 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java | CommerceDiscountUsageEntryPersistenceImpl.clearCache | @Override
public void clearCache(
CommerceDiscountUsageEntry commerceDiscountUsageEntry) {
entityCache.removeResult(CommerceDiscountUsageEntryModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountUsageEntryImpl.class,
commerceDiscountUsageEntry.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache(
CommerceDiscountUsageEntry commerceDiscountUsageEntry) {
entityCache.removeResult(CommerceDiscountUsageEntryModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountUsageEntryImpl.class,
commerceDiscountUsageEntry.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
"CommerceDiscountUsageEntry",
"commerceDiscountUsageEntry",
")",
"{",
"entityCache",
".",
"removeResult",
"(",
"CommerceDiscountUsageEntryModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceDiscountUsageEntryImpl",
".",
... | Clears the cache for the commerce discount usage entry.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"the",
"commerce",
"discount",
"usage",
"entry",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java#L673-L682 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java | CommerceDiscountUsageEntryPersistenceImpl.remove | @Override
public CommerceDiscountUsageEntry remove(Serializable primaryKey)
throws NoSuchDiscountUsageEntryException {
Session session = null;
try {
session = openSession();
CommerceDiscountUsageEntry commerceDiscountUsageEntry = (CommerceDiscountUsageEntry)session.get(CommerceDiscountUsageEntryImpl.class,
primaryKey);
if (commerceDiscountUsageEntry == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchDiscountUsageEntryException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return remove(commerceDiscountUsageEntry);
}
catch (NoSuchDiscountUsageEntryException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
} | java | @Override
public CommerceDiscountUsageEntry remove(Serializable primaryKey)
throws NoSuchDiscountUsageEntryException {
Session session = null;
try {
session = openSession();
CommerceDiscountUsageEntry commerceDiscountUsageEntry = (CommerceDiscountUsageEntry)session.get(CommerceDiscountUsageEntryImpl.class,
primaryKey);
if (commerceDiscountUsageEntry == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchDiscountUsageEntryException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return remove(commerceDiscountUsageEntry);
}
catch (NoSuchDiscountUsageEntryException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
} | [
"@",
"Override",
"public",
"CommerceDiscountUsageEntry",
"remove",
"(",
"Serializable",
"primaryKey",
")",
"throws",
"NoSuchDiscountUsageEntryException",
"{",
"Session",
"session",
"=",
"null",
";",
"try",
"{",
"session",
"=",
"openSession",
"(",
")",
";",
"Commerce... | Removes the commerce discount usage entry with the primary key from the database. Also notifies the appropriate model listeners.
@param primaryKey the primary key of the commerce discount usage entry
@return the commerce discount usage entry that was removed
@throws NoSuchDiscountUsageEntryException if a commerce discount usage entry with the primary key could not be found | [
"Removes",
"the",
"commerce",
"discount",
"usage",
"entry",
"with",
"the",
"primary",
"key",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java#L735-L766 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java | CommerceDiscountUsageEntryPersistenceImpl.findAll | @Override
public List<CommerceDiscountUsageEntry> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceDiscountUsageEntry> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountUsageEntry",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce discount usage entries.
@return the commerce discount usage entries | [
"Returns",
"all",
"the",
"commerce",
"discount",
"usage",
"entries",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountUsageEntryPersistenceImpl.java#L1117-L1120 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.cacheResult | @Override
public void cacheResult(CPDefinitionOptionRel cpDefinitionOptionRel) {
entityCache.putResult(CPDefinitionOptionRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionRelImpl.class,
cpDefinitionOptionRel.getPrimaryKey(), cpDefinitionOptionRel);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
cpDefinitionOptionRel.getUuid(),
cpDefinitionOptionRel.getGroupId()
}, cpDefinitionOptionRel);
finderCache.putResult(FINDER_PATH_FETCH_BY_C_C,
new Object[] {
cpDefinitionOptionRel.getCPDefinitionId(),
cpDefinitionOptionRel.getCPOptionId()
}, cpDefinitionOptionRel);
cpDefinitionOptionRel.resetOriginalValues();
} | java | @Override
public void cacheResult(CPDefinitionOptionRel cpDefinitionOptionRel) {
entityCache.putResult(CPDefinitionOptionRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionRelImpl.class,
cpDefinitionOptionRel.getPrimaryKey(), cpDefinitionOptionRel);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
cpDefinitionOptionRel.getUuid(),
cpDefinitionOptionRel.getGroupId()
}, cpDefinitionOptionRel);
finderCache.putResult(FINDER_PATH_FETCH_BY_C_C,
new Object[] {
cpDefinitionOptionRel.getCPDefinitionId(),
cpDefinitionOptionRel.getCPOptionId()
}, cpDefinitionOptionRel);
cpDefinitionOptionRel.resetOriginalValues();
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"CPDefinitionOptionRel",
"cpDefinitionOptionRel",
")",
"{",
"entityCache",
".",
"putResult",
"(",
"CPDefinitionOptionRelModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CPDefinitionOptionRelImpl",
".",
"class",
",",
"cp... | Caches the cp definition option rel in the entity cache if it is enabled.
@param cpDefinitionOptionRel the cp definition option rel | [
"Caches",
"the",
"cp",
"definition",
"option",
"rel",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L3847-L3866 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.cacheResult | @Override
public void cacheResult(List<CPDefinitionOptionRel> cpDefinitionOptionRels) {
for (CPDefinitionOptionRel cpDefinitionOptionRel : cpDefinitionOptionRels) {
if (entityCache.getResult(
CPDefinitionOptionRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionRelImpl.class,
cpDefinitionOptionRel.getPrimaryKey()) == null) {
cacheResult(cpDefinitionOptionRel);
}
else {
cpDefinitionOptionRel.resetOriginalValues();
}
}
} | java | @Override
public void cacheResult(List<CPDefinitionOptionRel> cpDefinitionOptionRels) {
for (CPDefinitionOptionRel cpDefinitionOptionRel : cpDefinitionOptionRels) {
if (entityCache.getResult(
CPDefinitionOptionRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionRelImpl.class,
cpDefinitionOptionRel.getPrimaryKey()) == null) {
cacheResult(cpDefinitionOptionRel);
}
else {
cpDefinitionOptionRel.resetOriginalValues();
}
}
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"List",
"<",
"CPDefinitionOptionRel",
">",
"cpDefinitionOptionRels",
")",
"{",
"for",
"(",
"CPDefinitionOptionRel",
"cpDefinitionOptionRel",
":",
"cpDefinitionOptionRels",
")",
"{",
"if",
"(",
"entityCache",
".",
... | Caches the cp definition option rels in the entity cache if it is enabled.
@param cpDefinitionOptionRels the cp definition option rels | [
"Caches",
"the",
"cp",
"definition",
"option",
"rels",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L3873-L3886 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.clearCache | @Override
public void clearCache() {
entityCache.clearCache(CPDefinitionOptionRelImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache() {
entityCache.clearCache(CPDefinitionOptionRelImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
")",
"{",
"entityCache",
".",
"clearCache",
"(",
"CPDefinitionOptionRelImpl",
".",
"class",
")",
";",
"finderCache",
".",
"clearCache",
"(",
"FINDER_CLASS_NAME_ENTITY",
")",
";",
"finderCache",
".",
"clearCache... | Clears the cache for all cp definition option rels.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"all",
"cp",
"definition",
"option",
"rels",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L3895-L3902 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.clearCache | @Override
public void clearCache(CPDefinitionOptionRel cpDefinitionOptionRel) {
entityCache.removeResult(CPDefinitionOptionRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionRelImpl.class,
cpDefinitionOptionRel.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
clearUniqueFindersCache((CPDefinitionOptionRelModelImpl)cpDefinitionOptionRel,
true);
} | java | @Override
public void clearCache(CPDefinitionOptionRel cpDefinitionOptionRel) {
entityCache.removeResult(CPDefinitionOptionRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionRelImpl.class,
cpDefinitionOptionRel.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
clearUniqueFindersCache((CPDefinitionOptionRelModelImpl)cpDefinitionOptionRel,
true);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
"CPDefinitionOptionRel",
"cpDefinitionOptionRel",
")",
"{",
"entityCache",
".",
"removeResult",
"(",
"CPDefinitionOptionRelModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CPDefinitionOptionRelImpl",
".",
"class",
",",
"... | Clears the cache for the cp definition option rel.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"the",
"cp",
"definition",
"option",
"rel",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L3911-L3922 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.findAll | @Override
public List<CPDefinitionOptionRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionOptionRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionRel",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp definition option rels.
@return the cp definition option rels | [
"Returns",
"all",
"the",
"cp",
"definition",
"option",
"rels",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L4572-L4575 | train |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/base/CommerceWishListServiceBaseImpl.java | CommerceWishListServiceBaseImpl.setCommerceWishListItemService | public void setCommerceWishListItemService(
com.liferay.commerce.wish.list.service.CommerceWishListItemService commerceWishListItemService) {
this.commerceWishListItemService = commerceWishListItemService;
} | java | public void setCommerceWishListItemService(
com.liferay.commerce.wish.list.service.CommerceWishListItemService commerceWishListItemService) {
this.commerceWishListItemService = commerceWishListItemService;
} | [
"public",
"void",
"setCommerceWishListItemService",
"(",
"com",
".",
"liferay",
".",
"commerce",
".",
"wish",
".",
"list",
".",
"service",
".",
"CommerceWishListItemService",
"commerceWishListItemService",
")",
"{",
"this",
".",
"commerceWishListItemService",
"=",
"co... | Sets the commerce wish list item remote service.
@param commerceWishListItemService the commerce wish list item remote service | [
"Sets",
"the",
"commerce",
"wish",
"list",
"item",
"remote",
"service",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/base/CommerceWishListServiceBaseImpl.java#L147-L150 | train |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/base/CommerceTierPriceEntryLocalServiceBaseImpl.java | CommerceTierPriceEntryLocalServiceBaseImpl.fetchCommerceTierPriceEntryByReferenceCode | @Override
public CommerceTierPriceEntry fetchCommerceTierPriceEntryByReferenceCode(
long companyId, String externalReferenceCode) {
return commerceTierPriceEntryPersistence.fetchByC_ERC(companyId, null);
} | java | @Override
public CommerceTierPriceEntry fetchCommerceTierPriceEntryByReferenceCode(
long companyId, String externalReferenceCode) {
return commerceTierPriceEntryPersistence.fetchByC_ERC(companyId, null);
} | [
"@",
"Override",
"public",
"CommerceTierPriceEntry",
"fetchCommerceTierPriceEntryByReferenceCode",
"(",
"long",
"companyId",
",",
"String",
"externalReferenceCode",
")",
"{",
"return",
"commerceTierPriceEntryPersistence",
".",
"fetchByC_ERC",
"(",
"companyId",
",",
"null",
... | Returns the commerce tier price entry with the matching external reference code and company.
@param companyId the primary key of the company
@param externalReferenceCode the commerce tier price entry's external reference code
@return the matching commerce tier price entry, or <code>null</code> if a matching commerce tier price entry could not be found | [
"Returns",
"the",
"commerce",
"tier",
"price",
"entry",
"with",
"the",
"matching",
"external",
"reference",
"code",
"and",
"company",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/base/CommerceTierPriceEntryLocalServiceBaseImpl.java#L257-L261 | train |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/base/CommerceTierPriceEntryLocalServiceBaseImpl.java | CommerceTierPriceEntryLocalServiceBaseImpl.getCommerceTierPriceEntriesByUuidAndCompanyId | @Override
public List<CommerceTierPriceEntry> getCommerceTierPriceEntriesByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CommerceTierPriceEntry> orderByComparator) {
return commerceTierPriceEntryPersistence.findByUuid_C(uuid, companyId,
start, end, orderByComparator);
} | java | @Override
public List<CommerceTierPriceEntry> getCommerceTierPriceEntriesByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CommerceTierPriceEntry> orderByComparator) {
return commerceTierPriceEntryPersistence.findByUuid_C(uuid, companyId,
start, end, orderByComparator);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceTierPriceEntry",
">",
"getCommerceTierPriceEntriesByUuidAndCompanyId",
"(",
"String",
"uuid",
",",
"long",
"companyId",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CommerceTierPriceEntry",
">... | Returns a range of commerce tier price entries matching the UUID and company.
@param uuid the UUID of the commerce tier price entries
@param companyId the primary key of the company
@param start the lower bound of the range of commerce tier price entries
@param end the upper bound of the range of commerce tier price entries (not inclusive)
@param orderByComparator the comparator to order the results by (optionally <code>null</code>)
@return the range of matching commerce tier price entries, or an empty list if no matches were found | [
"Returns",
"a",
"range",
"of",
"commerce",
"tier",
"price",
"entries",
"matching",
"the",
"UUID",
"and",
"company",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/base/CommerceTierPriceEntryLocalServiceBaseImpl.java#L407-L413 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java | CommerceDiscountRulePersistenceImpl.cacheResult | @Override
public void cacheResult(CommerceDiscountRule commerceDiscountRule) {
entityCache.putResult(CommerceDiscountRuleModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountRuleImpl.class,
commerceDiscountRule.getPrimaryKey(), commerceDiscountRule);
commerceDiscountRule.resetOriginalValues();
} | java | @Override
public void cacheResult(CommerceDiscountRule commerceDiscountRule) {
entityCache.putResult(CommerceDiscountRuleModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountRuleImpl.class,
commerceDiscountRule.getPrimaryKey(), commerceDiscountRule);
commerceDiscountRule.resetOriginalValues();
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"CommerceDiscountRule",
"commerceDiscountRule",
")",
"{",
"entityCache",
".",
"putResult",
"(",
"CommerceDiscountRuleModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceDiscountRuleImpl",
".",
"class",
",",
"commer... | Caches the commerce discount rule in the entity cache if it is enabled.
@param commerceDiscountRule the commerce discount rule | [
"Caches",
"the",
"commerce",
"discount",
"rule",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java#L650-L657 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java | CommerceDiscountRulePersistenceImpl.cacheResult | @Override
public void cacheResult(List<CommerceDiscountRule> commerceDiscountRules) {
for (CommerceDiscountRule commerceDiscountRule : commerceDiscountRules) {
if (entityCache.getResult(
CommerceDiscountRuleModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountRuleImpl.class,
commerceDiscountRule.getPrimaryKey()) == null) {
cacheResult(commerceDiscountRule);
}
else {
commerceDiscountRule.resetOriginalValues();
}
}
} | java | @Override
public void cacheResult(List<CommerceDiscountRule> commerceDiscountRules) {
for (CommerceDiscountRule commerceDiscountRule : commerceDiscountRules) {
if (entityCache.getResult(
CommerceDiscountRuleModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountRuleImpl.class,
commerceDiscountRule.getPrimaryKey()) == null) {
cacheResult(commerceDiscountRule);
}
else {
commerceDiscountRule.resetOriginalValues();
}
}
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"List",
"<",
"CommerceDiscountRule",
">",
"commerceDiscountRules",
")",
"{",
"for",
"(",
"CommerceDiscountRule",
"commerceDiscountRule",
":",
"commerceDiscountRules",
")",
"{",
"if",
"(",
"entityCache",
".",
"ge... | Caches the commerce discount rules in the entity cache if it is enabled.
@param commerceDiscountRules the commerce discount rules | [
"Caches",
"the",
"commerce",
"discount",
"rules",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java#L664-L677 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java | CommerceDiscountRulePersistenceImpl.clearCache | @Override
public void clearCache() {
entityCache.clearCache(CommerceDiscountRuleImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache() {
entityCache.clearCache(CommerceDiscountRuleImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
")",
"{",
"entityCache",
".",
"clearCache",
"(",
"CommerceDiscountRuleImpl",
".",
"class",
")",
";",
"finderCache",
".",
"clearCache",
"(",
"FINDER_CLASS_NAME_ENTITY",
")",
";",
"finderCache",
".",
"clearCache"... | Clears the cache for all commerce discount rules.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"all",
"commerce",
"discount",
"rules",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java#L686-L693 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java | CommerceDiscountRulePersistenceImpl.clearCache | @Override
public void clearCache(CommerceDiscountRule commerceDiscountRule) {
entityCache.removeResult(CommerceDiscountRuleModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountRuleImpl.class, commerceDiscountRule.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache(CommerceDiscountRule commerceDiscountRule) {
entityCache.removeResult(CommerceDiscountRuleModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountRuleImpl.class, commerceDiscountRule.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
"CommerceDiscountRule",
"commerceDiscountRule",
")",
"{",
"entityCache",
".",
"removeResult",
"(",
"CommerceDiscountRuleModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceDiscountRuleImpl",
".",
"class",
",",
"comm... | Clears the cache for the commerce discount rule.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"the",
"commerce",
"discount",
"rule",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java#L702-L709 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java | CommerceDiscountRulePersistenceImpl.remove | @Override
public CommerceDiscountRule remove(Serializable primaryKey)
throws NoSuchDiscountRuleException {
Session session = null;
try {
session = openSession();
CommerceDiscountRule commerceDiscountRule = (CommerceDiscountRule)session.get(CommerceDiscountRuleImpl.class,
primaryKey);
if (commerceDiscountRule == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchDiscountRuleException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return remove(commerceDiscountRule);
}
catch (NoSuchDiscountRuleException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
} | java | @Override
public CommerceDiscountRule remove(Serializable primaryKey)
throws NoSuchDiscountRuleException {
Session session = null;
try {
session = openSession();
CommerceDiscountRule commerceDiscountRule = (CommerceDiscountRule)session.get(CommerceDiscountRuleImpl.class,
primaryKey);
if (commerceDiscountRule == null) {
if (_log.isDebugEnabled()) {
_log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
}
throw new NoSuchDiscountRuleException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
primaryKey);
}
return remove(commerceDiscountRule);
}
catch (NoSuchDiscountRuleException nsee) {
throw nsee;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
} | [
"@",
"Override",
"public",
"CommerceDiscountRule",
"remove",
"(",
"Serializable",
"primaryKey",
")",
"throws",
"NoSuchDiscountRuleException",
"{",
"Session",
"session",
"=",
"null",
";",
"try",
"{",
"session",
"=",
"openSession",
"(",
")",
";",
"CommerceDiscountRule... | Removes the commerce discount rule with the primary key from the database. Also notifies the appropriate model listeners.
@param primaryKey the primary key of the commerce discount rule
@return the commerce discount rule that was removed
@throws NoSuchDiscountRuleException if a commerce discount rule with the primary key could not be found | [
"Removes",
"the",
"commerce",
"discount",
"rule",
"with",
"the",
"primary",
"key",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java#L761-L792 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java | CommerceDiscountRulePersistenceImpl.findAll | @Override
public List<CommerceDiscountRule> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceDiscountRule> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscountRule",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce discount rules.
@return the commerce discount rules | [
"Returns",
"all",
"the",
"commerce",
"discount",
"rules",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRulePersistenceImpl.java#L1142-L1145 | train |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateServiceBaseImpl.java | CommerceNotificationTemplateServiceBaseImpl.setCommerceNotificationQueueEntryService | public void setCommerceNotificationQueueEntryService(
com.liferay.commerce.notification.service.CommerceNotificationQueueEntryService commerceNotificationQueueEntryService) {
this.commerceNotificationQueueEntryService = commerceNotificationQueueEntryService;
} | java | public void setCommerceNotificationQueueEntryService(
com.liferay.commerce.notification.service.CommerceNotificationQueueEntryService commerceNotificationQueueEntryService) {
this.commerceNotificationQueueEntryService = commerceNotificationQueueEntryService;
} | [
"public",
"void",
"setCommerceNotificationQueueEntryService",
"(",
"com",
".",
"liferay",
".",
"commerce",
".",
"notification",
".",
"service",
".",
"CommerceNotificationQueueEntryService",
"commerceNotificationQueueEntryService",
")",
"{",
"this",
".",
"commerceNotificationQ... | Sets the commerce notification queue entry remote service.
@param commerceNotificationQueueEntryService the commerce notification queue entry remote service | [
"Sets",
"the",
"commerce",
"notification",
"queue",
"entry",
"remote",
"service",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/base/CommerceNotificationTemplateServiceBaseImpl.java#L133-L136 | train |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/CPDefinitionSpecificationOptionValueLocalServiceWrapper.java | CPDefinitionSpecificationOptionValueLocalServiceWrapper.getCPDefinitionSpecificationOptionValue | @Override
public com.liferay.commerce.product.model.CPDefinitionSpecificationOptionValue getCPDefinitionSpecificationOptionValue(
long CPDefinitionSpecificationOptionValueId)
throws com.liferay.portal.kernel.exception.PortalException {
return _cpDefinitionSpecificationOptionValueLocalService.getCPDefinitionSpecificationOptionValue(CPDefinitionSpecificationOptionValueId);
} | java | @Override
public com.liferay.commerce.product.model.CPDefinitionSpecificationOptionValue getCPDefinitionSpecificationOptionValue(
long CPDefinitionSpecificationOptionValueId)
throws com.liferay.portal.kernel.exception.PortalException {
return _cpDefinitionSpecificationOptionValueLocalService.getCPDefinitionSpecificationOptionValue(CPDefinitionSpecificationOptionValueId);
} | [
"@",
"Override",
"public",
"com",
".",
"liferay",
".",
"commerce",
".",
"product",
".",
"model",
".",
"CPDefinitionSpecificationOptionValue",
"getCPDefinitionSpecificationOptionValue",
"(",
"long",
"CPDefinitionSpecificationOptionValueId",
")",
"throws",
"com",
".",
"life... | Returns the cp definition specification option value with the primary key.
@param CPDefinitionSpecificationOptionValueId the primary key of the cp definition specification option value
@return the cp definition specification option value
@throws PortalException if a cp definition specification option value with the primary key could not be found | [
"Returns",
"the",
"cp",
"definition",
"specification",
"option",
"value",
"with",
"the",
"primary",
"key",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/CPDefinitionSpecificationOptionValueLocalServiceWrapper.java#L247-L252 | train |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/base/CommerceWishListItemLocalServiceBaseImpl.java | CommerceWishListItemLocalServiceBaseImpl.deleteCommerceWishListItem | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceWishListItem deleteCommerceWishListItem(
long commerceWishListItemId) throws PortalException {
return commerceWishListItemPersistence.remove(commerceWishListItemId);
} | java | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceWishListItem deleteCommerceWishListItem(
long commerceWishListItemId) throws PortalException {
return commerceWishListItemPersistence.remove(commerceWishListItemId);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"DELETE",
")",
"@",
"Override",
"public",
"CommerceWishListItem",
"deleteCommerceWishListItem",
"(",
"long",
"commerceWishListItemId",
")",
"throws",
"PortalException",
"{",
"return",
"commerceWishListItemPersisten... | Deletes the commerce wish list item with the primary key from the database. Also notifies the appropriate model listeners.
@param commerceWishListItemId the primary key of the commerce wish list item
@return the commerce wish list item that was removed
@throws PortalException if a commerce wish list item with the primary key could not be found | [
"Deletes",
"the",
"commerce",
"wish",
"list",
"item",
"with",
"the",
"primary",
"key",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/base/CommerceWishListItemLocalServiceBaseImpl.java#L113-L118 | train |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/base/CommerceWishListItemLocalServiceBaseImpl.java | CommerceWishListItemLocalServiceBaseImpl.deleteCommerceWishListItem | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceWishListItem deleteCommerceWishListItem(
CommerceWishListItem commerceWishListItem) {
return commerceWishListItemPersistence.remove(commerceWishListItem);
} | java | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceWishListItem deleteCommerceWishListItem(
CommerceWishListItem commerceWishListItem) {
return commerceWishListItemPersistence.remove(commerceWishListItem);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"DELETE",
")",
"@",
"Override",
"public",
"CommerceWishListItem",
"deleteCommerceWishListItem",
"(",
"CommerceWishListItem",
"commerceWishListItem",
")",
"{",
"return",
"commerceWishListItemPersistence",
".",
"remo... | Deletes the commerce wish list item from the database. Also notifies the appropriate model listeners.
@param commerceWishListItem the commerce wish list item
@return the commerce wish list item that was removed | [
"Deletes",
"the",
"commerce",
"wish",
"list",
"item",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/base/CommerceWishListItemLocalServiceBaseImpl.java#L126-L131 | train |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/CPInstanceLocalServiceUtil.java | CPInstanceLocalServiceUtil.getCPInstance | public static com.liferay.commerce.product.model.CPInstance getCPInstance(
long CPInstanceId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService().getCPInstance(CPInstanceId);
} | java | public static com.liferay.commerce.product.model.CPInstance getCPInstance(
long CPInstanceId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService().getCPInstance(CPInstanceId);
} | [
"public",
"static",
"com",
".",
"liferay",
".",
"commerce",
".",
"product",
".",
"model",
".",
"CPInstance",
"getCPInstance",
"(",
"long",
"CPInstanceId",
")",
"throws",
"com",
".",
"liferay",
".",
"portal",
".",
"kernel",
".",
"exception",
".",
"PortalExcep... | Returns the cp instance with the primary key.
@param CPInstanceId the primary key of the cp instance
@return the cp instance
@throws PortalException if a cp instance with the primary key could not be found | [
"Returns",
"the",
"cp",
"instance",
"with",
"the",
"primary",
"key",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/CPInstanceLocalServiceUtil.java#L348-L352 | train |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/base/CommerceWarehouseLocalServiceBaseImpl.java | CommerceWarehouseLocalServiceBaseImpl.deleteCommerceWarehouse | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceWarehouse deleteCommerceWarehouse(long commerceWarehouseId)
throws PortalException {
return commerceWarehousePersistence.remove(commerceWarehouseId);
} | java | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceWarehouse deleteCommerceWarehouse(long commerceWarehouseId)
throws PortalException {
return commerceWarehousePersistence.remove(commerceWarehouseId);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"DELETE",
")",
"@",
"Override",
"public",
"CommerceWarehouse",
"deleteCommerceWarehouse",
"(",
"long",
"commerceWarehouseId",
")",
"throws",
"PortalException",
"{",
"return",
"commerceWarehousePersistence",
".",
... | Deletes the commerce warehouse with the primary key from the database. Also notifies the appropriate model listeners.
@param commerceWarehouseId the primary key of the commerce warehouse
@return the commerce warehouse that was removed
@throws PortalException if a commerce warehouse with the primary key could not be found | [
"Deletes",
"the",
"commerce",
"warehouse",
"with",
"the",
"primary",
"key",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/base/CommerceWarehouseLocalServiceBaseImpl.java#L135-L140 | train |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/base/CommerceWarehouseLocalServiceBaseImpl.java | CommerceWarehouseLocalServiceBaseImpl.runSQL | protected void runSQL(String sql) {
try {
DataSource dataSource = commerceWarehousePersistence.getDataSource();
DB db = DBManagerUtil.getDB();
sql = db.buildSQL(sql);
sql = PortalUtil.transformSQL(sql);
SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
sql);
sqlUpdate.update();
}
catch (Exception e) {
throw new SystemException(e);
}
} | java | protected void runSQL(String sql) {
try {
DataSource dataSource = commerceWarehousePersistence.getDataSource();
DB db = DBManagerUtil.getDB();
sql = db.buildSQL(sql);
sql = PortalUtil.transformSQL(sql);
SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
sql);
sqlUpdate.update();
}
catch (Exception e) {
throw new SystemException(e);
}
} | [
"protected",
"void",
"runSQL",
"(",
"String",
"sql",
")",
"{",
"try",
"{",
"DataSource",
"dataSource",
"=",
"commerceWarehousePersistence",
".",
"getDataSource",
"(",
")",
";",
"DB",
"db",
"=",
"DBManagerUtil",
".",
"getDB",
"(",
")",
";",
"sql",
"=",
"db"... | Performs a SQL query.
@param sql the sql query | [
"Performs",
"a",
"SQL",
"query",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/base/CommerceWarehouseLocalServiceBaseImpl.java#L1289-L1306 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.cacheResult | @Override
public void cacheResult(
CPDefinitionOptionValueRel cpDefinitionOptionValueRel) {
entityCache.putResult(CPDefinitionOptionValueRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionValueRelImpl.class,
cpDefinitionOptionValueRel.getPrimaryKey(),
cpDefinitionOptionValueRel);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
cpDefinitionOptionValueRel.getUuid(),
cpDefinitionOptionValueRel.getGroupId()
}, cpDefinitionOptionValueRel);
finderCache.putResult(FINDER_PATH_FETCH_BY_C_K,
new Object[] {
cpDefinitionOptionValueRel.getCPDefinitionOptionRelId(),
cpDefinitionOptionValueRel.getKey()
}, cpDefinitionOptionValueRel);
cpDefinitionOptionValueRel.resetOriginalValues();
} | java | @Override
public void cacheResult(
CPDefinitionOptionValueRel cpDefinitionOptionValueRel) {
entityCache.putResult(CPDefinitionOptionValueRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionValueRelImpl.class,
cpDefinitionOptionValueRel.getPrimaryKey(),
cpDefinitionOptionValueRel);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
cpDefinitionOptionValueRel.getUuid(),
cpDefinitionOptionValueRel.getGroupId()
}, cpDefinitionOptionValueRel);
finderCache.putResult(FINDER_PATH_FETCH_BY_C_K,
new Object[] {
cpDefinitionOptionValueRel.getCPDefinitionOptionRelId(),
cpDefinitionOptionValueRel.getKey()
}, cpDefinitionOptionValueRel);
cpDefinitionOptionValueRel.resetOriginalValues();
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"CPDefinitionOptionValueRel",
"cpDefinitionOptionValueRel",
")",
"{",
"entityCache",
".",
"putResult",
"(",
"CPDefinitionOptionValueRelModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CPDefinitionOptionValueRelImpl",
".",
"... | Caches the cp definition option value rel in the entity cache if it is enabled.
@param cpDefinitionOptionValueRel the cp definition option value rel | [
"Caches",
"the",
"cp",
"definition",
"option",
"value",
"rel",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L3904-L3925 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.cacheResult | @Override
public void cacheResult(
List<CPDefinitionOptionValueRel> cpDefinitionOptionValueRels) {
for (CPDefinitionOptionValueRel cpDefinitionOptionValueRel : cpDefinitionOptionValueRels) {
if (entityCache.getResult(
CPDefinitionOptionValueRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionValueRelImpl.class,
cpDefinitionOptionValueRel.getPrimaryKey()) == null) {
cacheResult(cpDefinitionOptionValueRel);
}
else {
cpDefinitionOptionValueRel.resetOriginalValues();
}
}
} | java | @Override
public void cacheResult(
List<CPDefinitionOptionValueRel> cpDefinitionOptionValueRels) {
for (CPDefinitionOptionValueRel cpDefinitionOptionValueRel : cpDefinitionOptionValueRels) {
if (entityCache.getResult(
CPDefinitionOptionValueRelModelImpl.ENTITY_CACHE_ENABLED,
CPDefinitionOptionValueRelImpl.class,
cpDefinitionOptionValueRel.getPrimaryKey()) == null) {
cacheResult(cpDefinitionOptionValueRel);
}
else {
cpDefinitionOptionValueRel.resetOriginalValues();
}
}
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"List",
"<",
"CPDefinitionOptionValueRel",
">",
"cpDefinitionOptionValueRels",
")",
"{",
"for",
"(",
"CPDefinitionOptionValueRel",
"cpDefinitionOptionValueRel",
":",
"cpDefinitionOptionValueRels",
")",
"{",
"if",
"(",... | Caches the cp definition option value rels in the entity cache if it is enabled.
@param cpDefinitionOptionValueRels the cp definition option value rels | [
"Caches",
"the",
"cp",
"definition",
"option",
"value",
"rels",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L3932-L3946 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.clearCache | @Override
public void clearCache() {
entityCache.clearCache(CPDefinitionOptionValueRelImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache() {
entityCache.clearCache(CPDefinitionOptionValueRelImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
")",
"{",
"entityCache",
".",
"clearCache",
"(",
"CPDefinitionOptionValueRelImpl",
".",
"class",
")",
";",
"finderCache",
".",
"clearCache",
"(",
"FINDER_CLASS_NAME_ENTITY",
")",
";",
"finderCache",
".",
"clear... | Clears the cache for all cp definition option value rels.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"all",
"cp",
"definition",
"option",
"value",
"rels",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L3955-L3962 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.findAll | @Override
public List<CPDefinitionOptionValueRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionOptionValueRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionValueRel",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp definition option value rels.
@return the cp definition option value rels | [
"Returns",
"all",
"the",
"cp",
"definition",
"option",
"value",
"rels",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L4638-L4641 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionOptionRelLocalServiceBaseImpl.java | CPDefinitionOptionRelLocalServiceBaseImpl.deleteCPDefinitionOptionRel | @Indexable(type = IndexableType.DELETE)
@Override
public CPDefinitionOptionRel deleteCPDefinitionOptionRel(
long CPDefinitionOptionRelId) throws PortalException {
return cpDefinitionOptionRelPersistence.remove(CPDefinitionOptionRelId);
} | java | @Indexable(type = IndexableType.DELETE)
@Override
public CPDefinitionOptionRel deleteCPDefinitionOptionRel(
long CPDefinitionOptionRelId) throws PortalException {
return cpDefinitionOptionRelPersistence.remove(CPDefinitionOptionRelId);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"DELETE",
")",
"@",
"Override",
"public",
"CPDefinitionOptionRel",
"deleteCPDefinitionOptionRel",
"(",
"long",
"CPDefinitionOptionRelId",
")",
"throws",
"PortalException",
"{",
"return",
"cpDefinitionOptionRelPersi... | Deletes the cp definition option rel with the primary key from the database. Also notifies the appropriate model listeners.
@param CPDefinitionOptionRelId the primary key of the cp definition option rel
@return the cp definition option rel that was removed
@throws PortalException if a cp definition option rel with the primary key could not be found | [
"Deletes",
"the",
"cp",
"definition",
"option",
"rel",
"with",
"the",
"primary",
"key",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionOptionRelLocalServiceBaseImpl.java#L143-L148 | train |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionOptionRelLocalServiceBaseImpl.java | CPDefinitionOptionRelLocalServiceBaseImpl.getCPDefinitionOptionRelsByUuidAndCompanyId | @Override
public List<CPDefinitionOptionRel> getCPDefinitionOptionRelsByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CPDefinitionOptionRel> orderByComparator) {
return cpDefinitionOptionRelPersistence.findByUuid_C(uuid, companyId,
start, end, orderByComparator);
} | java | @Override
public List<CPDefinitionOptionRel> getCPDefinitionOptionRelsByUuidAndCompanyId(
String uuid, long companyId, int start, int end,
OrderByComparator<CPDefinitionOptionRel> orderByComparator) {
return cpDefinitionOptionRelPersistence.findByUuid_C(uuid, companyId,
start, end, orderByComparator);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionRel",
">",
"getCPDefinitionOptionRelsByUuidAndCompanyId",
"(",
"String",
"uuid",
",",
"long",
"companyId",
",",
"int",
"start",
",",
"int",
"end",
",",
"OrderByComparator",
"<",
"CPDefinitionOptionRel",
">",
... | Returns a range of cp definition option rels matching the UUID and company.
@param uuid the UUID of the cp definition option rels
@param companyId the primary key of the company
@param start the lower bound of the range of cp definition option rels
@param end the upper bound of the range of cp definition option rels (not inclusive)
@param orderByComparator the comparator to order the results by (optionally <code>null</code>)
@return the range of matching cp definition option rels, or an empty list if no matches were found | [
"Returns",
"a",
"range",
"of",
"cp",
"definition",
"option",
"rels",
"matching",
"the",
"UUID",
"and",
"company",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPDefinitionOptionRelLocalServiceBaseImpl.java#L407-L413 | train |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/base/CommerceShipmentItemLocalServiceBaseImpl.java | CommerceShipmentItemLocalServiceBaseImpl.dynamicQuery | @Override
public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
int end) {
return commerceShipmentItemPersistence.findWithDynamicQuery(dynamicQuery,
start, end);
} | java | @Override
public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
int end) {
return commerceShipmentItemPersistence.findWithDynamicQuery(dynamicQuery,
start, end);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"dynamicQuery",
"(",
"DynamicQuery",
"dynamicQuery",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"commerceShipmentItemPersistence",
".",
"findWithDynamicQuery",
"(",
"dynamicQuery",... | Performs a dynamic query on the database and returns a range of the matching rows.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.commerce.model.impl.CommerceShipmentItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
</p>
@param dynamicQuery the dynamic query
@param start the lower bound of the range of model instances
@param end the upper bound of the range of model instances (not inclusive)
@return the range of matching rows | [
"Performs",
"a",
"dynamic",
"query",
"on",
"the",
"database",
"and",
"returns",
"a",
"range",
"of",
"the",
"matching",
"rows",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/base/CommerceShipmentItemLocalServiceBaseImpl.java#L185-L190 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.cacheResult | @Override
public void cacheResult(CommerceDiscount commerceDiscount) {
entityCache.putResult(CommerceDiscountModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountImpl.class, commerceDiscount.getPrimaryKey(),
commerceDiscount);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
commerceDiscount.getUuid(), commerceDiscount.getGroupId()
}, commerceDiscount);
commerceDiscount.resetOriginalValues();
} | java | @Override
public void cacheResult(CommerceDiscount commerceDiscount) {
entityCache.putResult(CommerceDiscountModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountImpl.class, commerceDiscount.getPrimaryKey(),
commerceDiscount);
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
new Object[] {
commerceDiscount.getUuid(), commerceDiscount.getGroupId()
}, commerceDiscount);
commerceDiscount.resetOriginalValues();
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"CommerceDiscount",
"commerceDiscount",
")",
"{",
"entityCache",
".",
"putResult",
"(",
"CommerceDiscountModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceDiscountImpl",
".",
"class",
",",
"commerceDiscount",
"... | Caches the commerce discount in the entity cache if it is enabled.
@param commerceDiscount the commerce discount | [
"Caches",
"the",
"commerce",
"discount",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L4530-L4542 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.cacheResult | @Override
public void cacheResult(List<CommerceDiscount> commerceDiscounts) {
for (CommerceDiscount commerceDiscount : commerceDiscounts) {
if (entityCache.getResult(
CommerceDiscountModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountImpl.class,
commerceDiscount.getPrimaryKey()) == null) {
cacheResult(commerceDiscount);
}
else {
commerceDiscount.resetOriginalValues();
}
}
} | java | @Override
public void cacheResult(List<CommerceDiscount> commerceDiscounts) {
for (CommerceDiscount commerceDiscount : commerceDiscounts) {
if (entityCache.getResult(
CommerceDiscountModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountImpl.class,
commerceDiscount.getPrimaryKey()) == null) {
cacheResult(commerceDiscount);
}
else {
commerceDiscount.resetOriginalValues();
}
}
} | [
"@",
"Override",
"public",
"void",
"cacheResult",
"(",
"List",
"<",
"CommerceDiscount",
">",
"commerceDiscounts",
")",
"{",
"for",
"(",
"CommerceDiscount",
"commerceDiscount",
":",
"commerceDiscounts",
")",
"{",
"if",
"(",
"entityCache",
".",
"getResult",
"(",
"... | Caches the commerce discounts in the entity cache if it is enabled.
@param commerceDiscounts the commerce discounts | [
"Caches",
"the",
"commerce",
"discounts",
"in",
"the",
"entity",
"cache",
"if",
"it",
"is",
"enabled",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L4549-L4562 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.clearCache | @Override
public void clearCache() {
entityCache.clearCache(CommerceDiscountImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | java | @Override
public void clearCache() {
entityCache.clearCache(CommerceDiscountImpl.class);
finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
")",
"{",
"entityCache",
".",
"clearCache",
"(",
"CommerceDiscountImpl",
".",
"class",
")",
";",
"finderCache",
".",
"clearCache",
"(",
"FINDER_CLASS_NAME_ENTITY",
")",
";",
"finderCache",
".",
"clearCache",
... | Clears the cache for all commerce discounts.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"all",
"commerce",
"discounts",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L4571-L4578 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.clearCache | @Override
public void clearCache(CommerceDiscount commerceDiscount) {
entityCache.removeResult(CommerceDiscountModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountImpl.class, commerceDiscount.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
clearUniqueFindersCache((CommerceDiscountModelImpl)commerceDiscount,
true);
} | java | @Override
public void clearCache(CommerceDiscount commerceDiscount) {
entityCache.removeResult(CommerceDiscountModelImpl.ENTITY_CACHE_ENABLED,
CommerceDiscountImpl.class, commerceDiscount.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
clearUniqueFindersCache((CommerceDiscountModelImpl)commerceDiscount,
true);
} | [
"@",
"Override",
"public",
"void",
"clearCache",
"(",
"CommerceDiscount",
"commerceDiscount",
")",
"{",
"entityCache",
".",
"removeResult",
"(",
"CommerceDiscountModelImpl",
".",
"ENTITY_CACHE_ENABLED",
",",
"CommerceDiscountImpl",
".",
"class",
",",
"commerceDiscount",
... | Clears the cache for the commerce discount.
<p>
The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
</p> | [
"Clears",
"the",
"cache",
"for",
"the",
"commerce",
"discount",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L4587-L4597 | train |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.findAll | @Override
public List<CommerceDiscount> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceDiscount> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscount",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce discounts.
@return the commerce discounts | [
"Returns",
"all",
"the",
"commerce",
"discounts",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L5155-L5158 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java | AuthorizationCodeFlow.newTokenRequest | public AuthorizationCodeTokenRequest newTokenRequest(String authorizationCode) {
return new AuthorizationCodeTokenRequest(transport, jsonFactory,
new GenericUrl(tokenServerEncodedUrl), authorizationCode).setClientAuthentication(
clientAuthentication).setRequestInitializer(requestInitializer).setScopes(scopes);
} | java | public AuthorizationCodeTokenRequest newTokenRequest(String authorizationCode) {
return new AuthorizationCodeTokenRequest(transport, jsonFactory,
new GenericUrl(tokenServerEncodedUrl), authorizationCode).setClientAuthentication(
clientAuthentication).setRequestInitializer(requestInitializer).setScopes(scopes);
} | [
"public",
"AuthorizationCodeTokenRequest",
"newTokenRequest",
"(",
"String",
"authorizationCode",
")",
"{",
"return",
"new",
"AuthorizationCodeTokenRequest",
"(",
"transport",
",",
"jsonFactory",
",",
"new",
"GenericUrl",
"(",
"tokenServerEncodedUrl",
")",
",",
"authoriza... | Returns a new instance of an authorization code token request based on the given authorization
code.
<p>
This is used to make a request for an access token using the authorization code. It uses
{@link #getTransport()}, {@link #getJsonFactory()}, {@link #getTokenServerEncodedUrl()},
{@link #getClientAuthentication()}, {@link #getRequestInitializer()}, and {@link #getScopes()}.
</p>
<pre>
static TokenResponse requestAccessToken(AuthorizationCodeFlow flow, String code)
throws IOException, TokenResponseException {
return flow.newTokenRequest(code).setRedirectUri("https://client.example.com/rd").execute();
}
</pre>
@param authorizationCode authorization code. | [
"Returns",
"a",
"new",
"instance",
"of",
"an",
"authorization",
"code",
"token",
"request",
"based",
"on",
"the",
"given",
"authorization",
"code",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java#L208-L212 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java | AuthorizationCodeFlow.createAndStoreCredential | @SuppressWarnings("deprecation")
public Credential createAndStoreCredential(TokenResponse response, String userId)
throws IOException {
Credential credential = newCredential(userId).setFromTokenResponse(response);
if (credentialStore != null) {
credentialStore.store(userId, credential);
}
if (credentialDataStore != null) {
credentialDataStore.set(userId, new StoredCredential(credential));
}
if (credentialCreatedListener != null) {
credentialCreatedListener.onCredentialCreated(credential, response);
}
return credential;
} | java | @SuppressWarnings("deprecation")
public Credential createAndStoreCredential(TokenResponse response, String userId)
throws IOException {
Credential credential = newCredential(userId).setFromTokenResponse(response);
if (credentialStore != null) {
credentialStore.store(userId, credential);
}
if (credentialDataStore != null) {
credentialDataStore.set(userId, new StoredCredential(credential));
}
if (credentialCreatedListener != null) {
credentialCreatedListener.onCredentialCreated(credential, response);
}
return credential;
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"Credential",
"createAndStoreCredential",
"(",
"TokenResponse",
"response",
",",
"String",
"userId",
")",
"throws",
"IOException",
"{",
"Credential",
"credential",
"=",
"newCredential",
"(",
"userId",
")"... | Creates a new credential for the given user ID based on the given token response
and stores it in the credential store.
@param response token response
@param userId user ID or {@code null} if not using a persisted credential store
@return newly created credential | [
"Creates",
"a",
"new",
"credential",
"for",
"the",
"given",
"user",
"ID",
"based",
"on",
"the",
"given",
"token",
"response",
"and",
"stores",
"it",
"in",
"the",
"credential",
"store",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java#L222-L236 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java | AuthorizationCodeFlow.loadCredential | @SuppressWarnings("deprecation")
public Credential loadCredential(String userId) throws IOException {
// No requests need to be performed when userId is not specified.
if (isNullOrEmpty(userId)) {
return null;
}
if (credentialDataStore == null && credentialStore == null) {
return null;
}
Credential credential = newCredential(userId);
if (credentialDataStore != null) {
StoredCredential stored = credentialDataStore.get(userId);
if (stored == null) {
return null;
}
credential.setAccessToken(stored.getAccessToken());
credential.setRefreshToken(stored.getRefreshToken());
credential.setExpirationTimeMilliseconds(stored.getExpirationTimeMilliseconds());
} else if (!credentialStore.load(userId, credential)) {
return null;
}
return credential;
} | java | @SuppressWarnings("deprecation")
public Credential loadCredential(String userId) throws IOException {
// No requests need to be performed when userId is not specified.
if (isNullOrEmpty(userId)) {
return null;
}
if (credentialDataStore == null && credentialStore == null) {
return null;
}
Credential credential = newCredential(userId);
if (credentialDataStore != null) {
StoredCredential stored = credentialDataStore.get(userId);
if (stored == null) {
return null;
}
credential.setAccessToken(stored.getAccessToken());
credential.setRefreshToken(stored.getRefreshToken());
credential.setExpirationTimeMilliseconds(stored.getExpirationTimeMilliseconds());
} else if (!credentialStore.load(userId, credential)) {
return null;
}
return credential;
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"Credential",
"loadCredential",
"(",
"String",
"userId",
")",
"throws",
"IOException",
"{",
"// No requests need to be performed when userId is not specified.",
"if",
"(",
"isNullOrEmpty",
"(",
"userId",
")",
... | Loads the credential of the given user ID from the credential store.
@param userId user ID or {@code null} if not using a persisted credential store
@return credential found in the credential store of the given user ID or {@code null} for none
found | [
"Loads",
"the",
"credential",
"of",
"the",
"given",
"user",
"ID",
"from",
"the",
"credential",
"store",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java#L245-L269 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java | AuthorizationCodeFlow.newCredential | @SuppressWarnings("deprecation")
private Credential newCredential(String userId) {
Credential.Builder builder = new Credential.Builder(method).setTransport(transport)
.setJsonFactory(jsonFactory)
.setTokenServerEncodedUrl(tokenServerEncodedUrl)
.setClientAuthentication(clientAuthentication)
.setRequestInitializer(requestInitializer)
.setClock(clock);
if (credentialDataStore != null) {
builder.addRefreshListener(
new DataStoreCredentialRefreshListener(userId, credentialDataStore));
} else if (credentialStore != null) {
builder.addRefreshListener(new CredentialStoreRefreshListener(userId, credentialStore));
}
builder.getRefreshListeners().addAll(refreshListeners);
return builder.build();
} | java | @SuppressWarnings("deprecation")
private Credential newCredential(String userId) {
Credential.Builder builder = new Credential.Builder(method).setTransport(transport)
.setJsonFactory(jsonFactory)
.setTokenServerEncodedUrl(tokenServerEncodedUrl)
.setClientAuthentication(clientAuthentication)
.setRequestInitializer(requestInitializer)
.setClock(clock);
if (credentialDataStore != null) {
builder.addRefreshListener(
new DataStoreCredentialRefreshListener(userId, credentialDataStore));
} else if (credentialStore != null) {
builder.addRefreshListener(new CredentialStoreRefreshListener(userId, credentialStore));
}
builder.getRefreshListeners().addAll(refreshListeners);
return builder.build();
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"Credential",
"newCredential",
"(",
"String",
"userId",
")",
"{",
"Credential",
".",
"Builder",
"builder",
"=",
"new",
"Credential",
".",
"Builder",
"(",
"method",
")",
".",
"setTransport",
"(",
... | Returns a new credential instance based on the given user ID.
@param userId user ID or {@code null} if not using a persisted credential store | [
"Returns",
"a",
"new",
"credential",
"instance",
"based",
"on",
"the",
"given",
"user",
"ID",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java#L276-L292 | train |
googleapis/google-oauth-java-client | google-oauth-client-appengine/src/main/java/com/google/api/client/extensions/appengine/auth/AppEngineServletUtils.java | AppEngineServletUtils.getUserId | static final String getUserId() {
UserService userService = UserServiceFactory.getUserService();
User loggedIn = userService.getCurrentUser();
Preconditions.checkState(loggedIn != null, "This servlet requires the user to be logged in.");
return loggedIn.getUserId();
} | java | static final String getUserId() {
UserService userService = UserServiceFactory.getUserService();
User loggedIn = userService.getCurrentUser();
Preconditions.checkState(loggedIn != null, "This servlet requires the user to be logged in.");
return loggedIn.getUserId();
} | [
"static",
"final",
"String",
"getUserId",
"(",
")",
"{",
"UserService",
"userService",
"=",
"UserServiceFactory",
".",
"getUserService",
"(",
")",
";",
"User",
"loggedIn",
"=",
"userService",
".",
"getCurrentUser",
"(",
")",
";",
"Preconditions",
".",
"checkStat... | Return the user id for the currently logged in user. | [
"Return",
"the",
"user",
"id",
"for",
"the",
"currently",
"logged",
"in",
"user",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client-appengine/src/main/java/com/google/api/client/extensions/appengine/auth/AppEngineServletUtils.java#L39-L44 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth/AbstractOAuthGetToken.java | AbstractOAuthGetToken.execute | public final OAuthCredentialsResponse execute() throws IOException {
HttpRequestFactory requestFactory = transport.createRequestFactory();
HttpRequest request =
requestFactory.buildRequest(usePost ? HttpMethods.POST : HttpMethods.GET, this, null);
createParameters().intercept(request);
HttpResponse response = request.execute();
response.setContentLoggingLimit(0);
OAuthCredentialsResponse oauthResponse = new OAuthCredentialsResponse();
UrlEncodedParser.parse(response.parseAsString(), oauthResponse);
return oauthResponse;
} | java | public final OAuthCredentialsResponse execute() throws IOException {
HttpRequestFactory requestFactory = transport.createRequestFactory();
HttpRequest request =
requestFactory.buildRequest(usePost ? HttpMethods.POST : HttpMethods.GET, this, null);
createParameters().intercept(request);
HttpResponse response = request.execute();
response.setContentLoggingLimit(0);
OAuthCredentialsResponse oauthResponse = new OAuthCredentialsResponse();
UrlEncodedParser.parse(response.parseAsString(), oauthResponse);
return oauthResponse;
} | [
"public",
"final",
"OAuthCredentialsResponse",
"execute",
"(",
")",
"throws",
"IOException",
"{",
"HttpRequestFactory",
"requestFactory",
"=",
"transport",
".",
"createRequestFactory",
"(",
")",
";",
"HttpRequest",
"request",
"=",
"requestFactory",
".",
"buildRequest",
... | Executes the HTTP request for a temporary or long-lived token.
@return OAuth credentials response object | [
"Executes",
"the",
"HTTP",
"request",
"for",
"a",
"temporary",
"or",
"long",
"-",
"lived",
"token",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth/AbstractOAuthGetToken.java#L68-L78 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth/AbstractOAuthGetToken.java | AbstractOAuthGetToken.createParameters | public OAuthParameters createParameters() {
OAuthParameters result = new OAuthParameters();
result.consumerKey = consumerKey;
result.signer = signer;
return result;
} | java | public OAuthParameters createParameters() {
OAuthParameters result = new OAuthParameters();
result.consumerKey = consumerKey;
result.signer = signer;
return result;
} | [
"public",
"OAuthParameters",
"createParameters",
"(",
")",
"{",
"OAuthParameters",
"result",
"=",
"new",
"OAuthParameters",
"(",
")",
";",
"result",
".",
"consumerKey",
"=",
"consumerKey",
";",
"result",
".",
"signer",
"=",
"signer",
";",
"return",
"result",
"... | Returns a new instance of the OAuth authentication provider. Subclasses may override by calling
this super implementation and then adding OAuth parameters. | [
"Returns",
"a",
"new",
"instance",
"of",
"the",
"OAuth",
"authentication",
"provider",
".",
"Subclasses",
"may",
"override",
"by",
"calling",
"this",
"super",
"implementation",
"and",
"then",
"adding",
"OAuth",
"parameters",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth/AbstractOAuthGetToken.java#L84-L89 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/TokenRequest.java | TokenRequest.setTokenServerUrl | public TokenRequest setTokenServerUrl(GenericUrl tokenServerUrl) {
this.tokenServerUrl = tokenServerUrl;
Preconditions.checkArgument(tokenServerUrl.getFragment() == null);
return this;
} | java | public TokenRequest setTokenServerUrl(GenericUrl tokenServerUrl) {
this.tokenServerUrl = tokenServerUrl;
Preconditions.checkArgument(tokenServerUrl.getFragment() == null);
return this;
} | [
"public",
"TokenRequest",
"setTokenServerUrl",
"(",
"GenericUrl",
"tokenServerUrl",
")",
"{",
"this",
".",
"tokenServerUrl",
"=",
"tokenServerUrl",
";",
"Preconditions",
".",
"checkArgument",
"(",
"tokenServerUrl",
".",
"getFragment",
"(",
")",
"==",
"null",
")",
... | Sets the token server URL.
<p>
Overriding is only supported for the purpose of calling the super implementation and changing
the return type, but nothing else.
</p> | [
"Sets",
"the",
"token",
"server",
"URL",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/TokenRequest.java#L195-L199 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/TokenRequest.java | TokenRequest.executeUnparsed | public final HttpResponse executeUnparsed() throws IOException {
// must set clientAuthentication as last execute interceptor in case it needs to sign request
HttpRequestFactory requestFactory =
transport.createRequestFactory(new HttpRequestInitializer() {
public void initialize(HttpRequest request) throws IOException {
if (requestInitializer != null) {
requestInitializer.initialize(request);
}
final HttpExecuteInterceptor interceptor = request.getInterceptor();
request.setInterceptor(new HttpExecuteInterceptor() {
public void intercept(HttpRequest request) throws IOException {
if (interceptor != null) {
interceptor.intercept(request);
}
if (clientAuthentication != null) {
clientAuthentication.intercept(request);
}
}
});
}
});
// make request
HttpRequest request =
requestFactory.buildPostRequest(tokenServerUrl, new UrlEncodedContent(this));
request.setParser(new JsonObjectParser(jsonFactory));
request.setThrowExceptionOnExecuteError(false);
HttpResponse response = request.execute();
if (response.isSuccessStatusCode()) {
return response;
}
throw TokenResponseException.from(jsonFactory, response);
} | java | public final HttpResponse executeUnparsed() throws IOException {
// must set clientAuthentication as last execute interceptor in case it needs to sign request
HttpRequestFactory requestFactory =
transport.createRequestFactory(new HttpRequestInitializer() {
public void initialize(HttpRequest request) throws IOException {
if (requestInitializer != null) {
requestInitializer.initialize(request);
}
final HttpExecuteInterceptor interceptor = request.getInterceptor();
request.setInterceptor(new HttpExecuteInterceptor() {
public void intercept(HttpRequest request) throws IOException {
if (interceptor != null) {
interceptor.intercept(request);
}
if (clientAuthentication != null) {
clientAuthentication.intercept(request);
}
}
});
}
});
// make request
HttpRequest request =
requestFactory.buildPostRequest(tokenServerUrl, new UrlEncodedContent(this));
request.setParser(new JsonObjectParser(jsonFactory));
request.setThrowExceptionOnExecuteError(false);
HttpResponse response = request.execute();
if (response.isSuccessStatusCode()) {
return response;
}
throw TokenResponseException.from(jsonFactory, response);
} | [
"public",
"final",
"HttpResponse",
"executeUnparsed",
"(",
")",
"throws",
"IOException",
"{",
"// must set clientAuthentication as last execute interceptor in case it needs to sign request",
"HttpRequestFactory",
"requestFactory",
"=",
"transport",
".",
"createRequestFactory",
"(",
... | Executes request for an access token, and returns the HTTP response.
<p>
To execute and parse the response to {@link TokenResponse}, instead use {@link #execute()}.
</p>
<p>
Callers should call {@link HttpResponse#disconnect} when the returned HTTP response object is
no longer needed. However, {@link HttpResponse#disconnect} does not have to be called if the
response stream is properly closed. Example usage:
</p>
<pre>
HttpResponse response = tokenRequest.executeUnparsed();
try {
process the HTTP response object
} finally {
response.disconnect();
}
</pre>
@return successful access token response, which can then be parsed directly using
{@link HttpResponse#parseAs(Class)} or some other parsing method
@throws TokenResponseException for an error response | [
"Executes",
"request",
"for",
"an",
"access",
"token",
"and",
"returns",
"the",
"HTTP",
"response",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/TokenRequest.java#L295-L327 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java | Credential.setAccessToken | public Credential setAccessToken(String accessToken) {
lock.lock();
try {
this.accessToken = accessToken;
} finally {
lock.unlock();
}
return this;
} | java | public Credential setAccessToken(String accessToken) {
lock.lock();
try {
this.accessToken = accessToken;
} finally {
lock.unlock();
}
return this;
} | [
"public",
"Credential",
"setAccessToken",
"(",
"String",
"accessToken",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"this",
".",
"accessToken",
"=",
"accessToken",
";",
"}",
"finally",
"{",
"lock",
".",
"unlock",
"(",
")",
";",
"}",
"retu... | Sets the access token.
<p>
Overriding is only supported for the purpose of calling the super implementation and changing
the return type, but nothing else.
</p>
@param accessToken access token or {@code null} for none | [
"Sets",
"the",
"access",
"token",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java#L310-L318 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java | Credential.setRefreshToken | public Credential setRefreshToken(String refreshToken) {
lock.lock();
try {
if (refreshToken != null) {
Preconditions.checkArgument(jsonFactory != null && transport != null
&& clientAuthentication != null && tokenServerEncodedUrl != null,
"Please use the Builder and call setJsonFactory, setTransport, setClientAuthentication"
+ " and setTokenServerUrl/setTokenServerEncodedUrl");
}
this.refreshToken = refreshToken;
} finally {
lock.unlock();
}
return this;
} | java | public Credential setRefreshToken(String refreshToken) {
lock.lock();
try {
if (refreshToken != null) {
Preconditions.checkArgument(jsonFactory != null && transport != null
&& clientAuthentication != null && tokenServerEncodedUrl != null,
"Please use the Builder and call setJsonFactory, setTransport, setClientAuthentication"
+ " and setTokenServerUrl/setTokenServerEncodedUrl");
}
this.refreshToken = refreshToken;
} finally {
lock.unlock();
}
return this;
} | [
"public",
"Credential",
"setRefreshToken",
"(",
"String",
"refreshToken",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"refreshToken",
"!=",
"null",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"jsonFactory",
"!=",
"null",
... | Sets the refresh token.
<p>
Overriding is only supported for the purpose of calling the super implementation and changing
the return type, but nothing else.
</p>
@param refreshToken refresh token or {@code null} for none | [
"Sets",
"the",
"refresh",
"token",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java#L377-L391 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java | Credential.refreshToken | public final boolean refreshToken() throws IOException {
lock.lock();
try {
try {
TokenResponse tokenResponse = executeRefreshToken();
if (tokenResponse != null) {
setFromTokenResponse(tokenResponse);
for (CredentialRefreshListener refreshListener : refreshListeners) {
refreshListener.onTokenResponse(this, tokenResponse);
}
return true;
}
} catch (TokenResponseException e) {
boolean statusCode4xx = 400 <= e.getStatusCode() && e.getStatusCode() < 500;
// check if it is a normal error response
if (e.getDetails() != null && statusCode4xx) {
// We were unable to get a new access token (e.g. it may have been revoked), we must now
// indicate that our current token is invalid.
setAccessToken(null);
setExpiresInSeconds(null);
}
for (CredentialRefreshListener refreshListener : refreshListeners) {
refreshListener.onTokenErrorResponse(this, e.getDetails());
}
if (statusCode4xx) {
throw e;
}
}
return false;
} finally {
lock.unlock();
}
} | java | public final boolean refreshToken() throws IOException {
lock.lock();
try {
try {
TokenResponse tokenResponse = executeRefreshToken();
if (tokenResponse != null) {
setFromTokenResponse(tokenResponse);
for (CredentialRefreshListener refreshListener : refreshListeners) {
refreshListener.onTokenResponse(this, tokenResponse);
}
return true;
}
} catch (TokenResponseException e) {
boolean statusCode4xx = 400 <= e.getStatusCode() && e.getStatusCode() < 500;
// check if it is a normal error response
if (e.getDetails() != null && statusCode4xx) {
// We were unable to get a new access token (e.g. it may have been revoked), we must now
// indicate that our current token is invalid.
setAccessToken(null);
setExpiresInSeconds(null);
}
for (CredentialRefreshListener refreshListener : refreshListeners) {
refreshListener.onTokenErrorResponse(this, e.getDetails());
}
if (statusCode4xx) {
throw e;
}
}
return false;
} finally {
lock.unlock();
}
} | [
"public",
"final",
"boolean",
"refreshToken",
"(",
")",
"throws",
"IOException",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"try",
"{",
"TokenResponse",
"tokenResponse",
"=",
"executeRefreshToken",
"(",
")",
";",
"if",
"(",
"tokenResponse",
"!=",
... | Request a new access token from the authorization endpoint.
<p>
On success, it will call {@link #setFromTokenResponse(TokenResponse)}, call
{@link CredentialRefreshListener#onTokenResponse} with the token response, and return
{@code true}. On error, it will call {@link #setAccessToken(String)} and
{@link #setExpiresInSeconds(Long)} with {@code null}, call
{@link CredentialRefreshListener#onTokenErrorResponse} with the token error response, and
return {@code false}. If a 4xx error is encountered while refreshing the token,
{@link TokenResponseException} is thrown.
</p>
<p>
If there is no refresh token, it will quietly return {@code false}.
</p>
@return whether a new access token was successfully retrieved | [
"Request",
"a",
"new",
"access",
"token",
"from",
"the",
"authorization",
"endpoint",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java#L490-L522 | train |
googleapis/google-oauth-java-client | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java | Credential.executeRefreshToken | protected TokenResponse executeRefreshToken() throws IOException {
if (refreshToken == null) {
return null;
}
return new RefreshTokenRequest(transport, jsonFactory, new GenericUrl(tokenServerEncodedUrl),
refreshToken).setClientAuthentication(clientAuthentication)
.setRequestInitializer(requestInitializer).execute();
} | java | protected TokenResponse executeRefreshToken() throws IOException {
if (refreshToken == null) {
return null;
}
return new RefreshTokenRequest(transport, jsonFactory, new GenericUrl(tokenServerEncodedUrl),
refreshToken).setClientAuthentication(clientAuthentication)
.setRequestInitializer(requestInitializer).execute();
} | [
"protected",
"TokenResponse",
"executeRefreshToken",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"refreshToken",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"RefreshTokenRequest",
"(",
"transport",
",",
"jsonFactory",
",",
"new",
... | Executes a request for new credentials from the token server.
<p>
The default implementation calls {@link RefreshTokenRequest#execute()} using the
{@link #getTransport()}, {@link #getJsonFactory()}, {@link #getRequestInitializer()},
{@link #getTokenServerEncodedUrl()}, {@link #getRefreshToken()}, and the
{@link #getClientAuthentication()}. If {@link #getRefreshToken()} is {@code null}, it instead
returns {@code null}.
</p>
<p>
Subclasses may override for a different implementation. Implementations can assume proper
thread synchronization is already taken care of inside {@link #refreshToken()}.
</p>
@return successful response from the token server or {@code null} if it is not possible to
refresh the access token
@throws TokenResponseException if an error response was received from the token server | [
"Executes",
"a",
"request",
"for",
"new",
"credentials",
"from",
"the",
"token",
"server",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java#L571-L578 | train |
googleapis/google-oauth-java-client | google-oauth-client-servlet/src/main/java/com/google/api/client/extensions/servlet/auth/AbstractFlowUserServlet.java | AbstractFlowUserServlet.startAuthFlow | private void startAuthFlow(
HttpServletResponse resp, PersistenceManager pm, ThreeLeggedFlow oauthFlow)
throws IOException {
pm.makePersistent(oauthFlow);
String authorizationUrl = oauthFlow.getAuthorizationUrl();
resp.sendRedirect(authorizationUrl);
} | java | private void startAuthFlow(
HttpServletResponse resp, PersistenceManager pm, ThreeLeggedFlow oauthFlow)
throws IOException {
pm.makePersistent(oauthFlow);
String authorizationUrl = oauthFlow.getAuthorizationUrl();
resp.sendRedirect(authorizationUrl);
} | [
"private",
"void",
"startAuthFlow",
"(",
"HttpServletResponse",
"resp",
",",
"PersistenceManager",
"pm",
",",
"ThreeLeggedFlow",
"oauthFlow",
")",
"throws",
"IOException",
"{",
"pm",
".",
"makePersistent",
"(",
"oauthFlow",
")",
";",
"String",
"authorizationUrl",
"=... | Start the auth flow. Don't run any code after this method that will change the response object. | [
"Start",
"the",
"auth",
"flow",
".",
"Don",
"t",
"run",
"any",
"code",
"after",
"this",
"method",
"that",
"will",
"change",
"the",
"response",
"object",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client-servlet/src/main/java/com/google/api/client/extensions/servlet/auth/AbstractFlowUserServlet.java#L113-L119 | train |
googleapis/google-oauth-java-client | google-oauth-client-servlet/src/main/java/com/google/api/client/extensions/servlet/auth/AbstractFlowUserServlet.java | AbstractFlowUserServlet.getCredential | protected Credential getCredential(HttpServletRequest req) {
Credential cred = (Credential) req.getAttribute(AUTH_CREDENTIAL);
return cred;
} | java | protected Credential getCredential(HttpServletRequest req) {
Credential cred = (Credential) req.getAttribute(AUTH_CREDENTIAL);
return cred;
} | [
"protected",
"Credential",
"getCredential",
"(",
"HttpServletRequest",
"req",
")",
"{",
"Credential",
"cred",
"=",
"(",
"Credential",
")",
"req",
".",
"getAttribute",
"(",
"AUTH_CREDENTIAL",
")",
";",
"return",
"cred",
";",
"}"
] | Fetch a credential associated with this request.
@param req Request object to use as context for fetching the credential.
@return Credential object for this request and user.
@since 1.5 | [
"Fetch",
"a",
"credential",
"associated",
"with",
"this",
"request",
"."
] | 7a829f8fd4d216c7d5882a82b9b58930fb375592 | https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client-servlet/src/main/java/com/google/api/client/extensions/servlet/auth/AbstractFlowUserServlet.java#L129-L132 | train |
square/tape | tape/src/main/java/com/squareup/tape2/QueueFile.java | QueueFile.ringWrite | private void ringWrite(long position, byte[] buffer, int offset, int count) throws IOException {
position = wrapPosition(position);
if (position + count <= fileLength) {
raf.seek(position);
raf.write(buffer, offset, count);
} else {
// The write overlaps the EOF.
// # of bytes to write before the EOF. Guaranteed to be less than Integer.MAX_VALUE.
int beforeEof = (int) (fileLength - position);
raf.seek(position);
raf.write(buffer, offset, beforeEof);
raf.seek(headerLength);
raf.write(buffer, offset + beforeEof, count - beforeEof);
}
} | java | private void ringWrite(long position, byte[] buffer, int offset, int count) throws IOException {
position = wrapPosition(position);
if (position + count <= fileLength) {
raf.seek(position);
raf.write(buffer, offset, count);
} else {
// The write overlaps the EOF.
// # of bytes to write before the EOF. Guaranteed to be less than Integer.MAX_VALUE.
int beforeEof = (int) (fileLength - position);
raf.seek(position);
raf.write(buffer, offset, beforeEof);
raf.seek(headerLength);
raf.write(buffer, offset + beforeEof, count - beforeEof);
}
} | [
"private",
"void",
"ringWrite",
"(",
"long",
"position",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"count",
")",
"throws",
"IOException",
"{",
"position",
"=",
"wrapPosition",
"(",
"position",
")",
";",
"if",
"(",
"position",
"+"... | Writes count bytes from buffer to position in file. Automatically wraps write if position is
past the end of the file or if buffer overlaps it.
@param position in file to write to
@param buffer to write from
@param count # of bytes to write | [
"Writes",
"count",
"bytes",
"from",
"buffer",
"to",
"position",
"in",
"file",
".",
"Automatically",
"wraps",
"write",
"if",
"position",
"is",
"past",
"the",
"end",
"of",
"the",
"file",
"or",
"if",
"buffer",
"overlaps",
"it",
"."
] | 445cd3fd0a7b3ec48c9ea3e0e86663fe6d3735d8 | https://github.com/square/tape/blob/445cd3fd0a7b3ec48c9ea3e0e86663fe6d3735d8/tape/src/main/java/com/squareup/tape2/QueueFile.java#L308-L322 | train |
square/tape | tape/src/main/java/com/squareup/tape2/QueueFile.java | QueueFile.expandIfNecessary | private void expandIfNecessary(long dataLength) throws IOException {
long elementLength = Element.HEADER_LENGTH + dataLength;
long remainingBytes = remainingBytes();
if (remainingBytes >= elementLength) return;
// Expand.
long previousLength = fileLength;
long newLength;
// Double the length until we can fit the new data.
do {
remainingBytes += previousLength;
newLength = previousLength << 1;
previousLength = newLength;
} while (remainingBytes < elementLength);
setLength(newLength);
// Calculate the position of the tail end of the data in the ring buffer
long endOfLastElement = wrapPosition(last.position + Element.HEADER_LENGTH + last.length);
long count = 0;
// If the buffer is split, we need to make it contiguous
if (endOfLastElement <= first.position) {
FileChannel channel = raf.getChannel();
channel.position(fileLength); // destination position
count = endOfLastElement - headerLength;
if (channel.transferTo(headerLength, count, channel) != count) {
throw new AssertionError("Copied insufficient number of bytes!");
}
}
// Commit the expansion.
if (last.position < first.position) {
long newLastPosition = fileLength + last.position - headerLength;
writeHeader(newLength, elementCount, first.position, newLastPosition);
last = new Element(newLastPosition, last.length);
} else {
writeHeader(newLength, elementCount, first.position, last.position);
}
fileLength = newLength;
if (zero) {
ringErase(headerLength, count);
}
} | java | private void expandIfNecessary(long dataLength) throws IOException {
long elementLength = Element.HEADER_LENGTH + dataLength;
long remainingBytes = remainingBytes();
if (remainingBytes >= elementLength) return;
// Expand.
long previousLength = fileLength;
long newLength;
// Double the length until we can fit the new data.
do {
remainingBytes += previousLength;
newLength = previousLength << 1;
previousLength = newLength;
} while (remainingBytes < elementLength);
setLength(newLength);
// Calculate the position of the tail end of the data in the ring buffer
long endOfLastElement = wrapPosition(last.position + Element.HEADER_LENGTH + last.length);
long count = 0;
// If the buffer is split, we need to make it contiguous
if (endOfLastElement <= first.position) {
FileChannel channel = raf.getChannel();
channel.position(fileLength); // destination position
count = endOfLastElement - headerLength;
if (channel.transferTo(headerLength, count, channel) != count) {
throw new AssertionError("Copied insufficient number of bytes!");
}
}
// Commit the expansion.
if (last.position < first.position) {
long newLastPosition = fileLength + last.position - headerLength;
writeHeader(newLength, elementCount, first.position, newLastPosition);
last = new Element(newLastPosition, last.length);
} else {
writeHeader(newLength, elementCount, first.position, last.position);
}
fileLength = newLength;
if (zero) {
ringErase(headerLength, count);
}
} | [
"private",
"void",
"expandIfNecessary",
"(",
"long",
"dataLength",
")",
"throws",
"IOException",
"{",
"long",
"elementLength",
"=",
"Element",
".",
"HEADER_LENGTH",
"+",
"dataLength",
";",
"long",
"remainingBytes",
"=",
"remainingBytes",
"(",
")",
";",
"if",
"("... | If necessary, expands the file to accommodate an additional element of the given length.
@param dataLength length of data being added | [
"If",
"necessary",
"expands",
"the",
"file",
"to",
"accommodate",
"an",
"additional",
"element",
"of",
"the",
"given",
"length",
"."
] | 445cd3fd0a7b3ec48c9ea3e0e86663fe6d3735d8 | https://github.com/square/tape/blob/445cd3fd0a7b3ec48c9ea3e0e86663fe6d3735d8/tape/src/main/java/com/squareup/tape2/QueueFile.java#L437-L481 | train |
square/tape | tape/src/main/java/com/squareup/tape2/QueueFile.java | QueueFile.getSneakyThrowable | @SuppressWarnings({"unchecked", "TypeParameterUnusedInFormals"})
static <T extends Throwable> T getSneakyThrowable(Throwable t) throws T {
throw (T) t;
} | java | @SuppressWarnings({"unchecked", "TypeParameterUnusedInFormals"})
static <T extends Throwable> T getSneakyThrowable(Throwable t) throws T {
throw (T) t;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"TypeParameterUnusedInFormals\"",
"}",
")",
"static",
"<",
"T",
"extends",
"Throwable",
">",
"T",
"getSneakyThrowable",
"(",
"Throwable",
"t",
")",
"throws",
"T",
"{",
"throw",
"(",
"T",
")",
"t",
";... | Use this to throw checked exceptions from iterator methods that do not declare that they throw
checked exceptions. | [
"Use",
"this",
"to",
"throw",
"checked",
"exceptions",
"from",
"iterator",
"methods",
"that",
"do",
"not",
"declare",
"that",
"they",
"throw",
"checked",
"exceptions",
"."
] | 445cd3fd0a7b3ec48c9ea3e0e86663fe6d3735d8 | https://github.com/square/tape/blob/445cd3fd0a7b3ec48c9ea3e0e86663fe6d3735d8/tape/src/main/java/com/squareup/tape2/QueueFile.java#L769-L772 | train |
jMetal/jMetal | jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG3.java | WFG3.t1 | public float[] t1(float[] z, int k) {
float[] result = new float[z.length];
System.arraycopy(z, 0, result, 0, k);
for (int i = k; i < z.length; i++) {
result[i] = (new Transformations()).sLinear(z[i], (float) 0.35);
}
return result;
} | java | public float[] t1(float[] z, int k) {
float[] result = new float[z.length];
System.arraycopy(z, 0, result, 0, k);
for (int i = k; i < z.length; i++) {
result[i] = (new Transformations()).sLinear(z[i], (float) 0.35);
}
return result;
} | [
"public",
"float",
"[",
"]",
"t1",
"(",
"float",
"[",
"]",
"z",
",",
"int",
"k",
")",
"{",
"float",
"[",
"]",
"result",
"=",
"new",
"float",
"[",
"z",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"z",
",",
"0",
",",
"result",
","... | WFG3 t1 transformation | [
"WFG3",
"t1",
"transformation"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG3.java#L69-L79 | train |
jMetal/jMetal | jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG3.java | WFG3.t2 | public float[] t2(float[] z, int k) {
float[] result = new float[z.length];
System.arraycopy(z, 0, result, 0, k);
int l = z.length - k;
for (int i = k + 1; i <= k + l / 2; i++) {
int head = k + 2 * (i - k) - 1;
int tail = k + 2 * (i - k);
float[] subZ = subVector(z, head - 1, tail - 1);
result[i - 1] = (new Transformations()).rNonsep(subZ, 2);
}
return result;
} | java | public float[] t2(float[] z, int k) {
float[] result = new float[z.length];
System.arraycopy(z, 0, result, 0, k);
int l = z.length - k;
for (int i = k + 1; i <= k + l / 2; i++) {
int head = k + 2 * (i - k) - 1;
int tail = k + 2 * (i - k);
float[] subZ = subVector(z, head - 1, tail - 1);
result[i - 1] = (new Transformations()).rNonsep(subZ, 2);
}
return result;
} | [
"public",
"float",
"[",
"]",
"t2",
"(",
"float",
"[",
"]",
"z",
",",
"int",
"k",
")",
"{",
"float",
"[",
"]",
"result",
"=",
"new",
"float",
"[",
"z",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"z",
",",
"0",
",",
"result",
","... | WFG3 t2 transformation | [
"WFG3",
"t2",
"transformation"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/wfg/WFG3.java#L85-L99 | train |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/util/experiment/Experiment.java | Experiment.removeDuplicatedAlgorithms | public void removeDuplicatedAlgorithms() {
List<ExperimentAlgorithm<S, Result>> algorithmList = new ArrayList<>() ;
HashSet<String> algorithmTagList = new HashSet<>() ;
getAlgorithmList().removeIf(alg -> !algorithmTagList.add(alg.getAlgorithmTag())) ;
} | java | public void removeDuplicatedAlgorithms() {
List<ExperimentAlgorithm<S, Result>> algorithmList = new ArrayList<>() ;
HashSet<String> algorithmTagList = new HashSet<>() ;
getAlgorithmList().removeIf(alg -> !algorithmTagList.add(alg.getAlgorithmTag())) ;
} | [
"public",
"void",
"removeDuplicatedAlgorithms",
"(",
")",
"{",
"List",
"<",
"ExperimentAlgorithm",
"<",
"S",
",",
"Result",
">",
">",
"algorithmList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"HashSet",
"<",
"String",
">",
"algorithmTagList",
"=",
"new"... | The list of algorithms contain an algorithm instance per problem. This is not convenient for
calculating statistical data, because a same algorithm will appear many times.
This method remove duplicated algorithms and leave only an instance of each one. | [
"The",
"list",
"of",
"algorithms",
"contain",
"an",
"algorithm",
"instance",
"per",
"problem",
".",
"This",
"is",
"not",
"convenient",
"for",
"calculating",
"statistical",
"data",
"because",
"a",
"same",
"algorithm",
"will",
"appear",
"many",
"times",
".",
"Th... | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/util/experiment/Experiment.java#L102-L108 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/AbstractMOEAD.java | AbstractMOEAD.initializeUniformWeight | protected void initializeUniformWeight() {
if ((problem.getNumberOfObjectives() == 2) && (populationSize <= 300)) {
for (int n = 0; n < populationSize; n++) {
double a = 1.0 * n / (populationSize - 1);
lambda[n][0] = a;
lambda[n][1] = 1 - a;
}
} else {
String dataFileName;
dataFileName = "W" + problem.getNumberOfObjectives() + "D_" +
populationSize + ".dat";
try {
// String path =
// Paths.get(VectorFileUtils.class.getClassLoader().getResource(filePath).toURI()).toString
// ();
InputStream in =
getClass()
.getClassLoader()
.getResourceAsStream(dataDirectory + "/" + dataFileName);
InputStreamReader isr = new InputStreamReader(in);
BufferedReader br = new BufferedReader(isr);
int i = 0;
int j = 0;
String aux = br.readLine();
while (aux != null) {
StringTokenizer st = new StringTokenizer(aux);
j = 0;
while (st.hasMoreTokens()) {
double value = new Double(st.nextToken());
lambda[i][j] = value;
j++;
}
aux = br.readLine();
i++;
}
br.close();
} catch (Exception e) {
throw new JMetalException("initializeUniformWeight: failed when reading for file: "
+ dataDirectory + "/" + dataFileName, e) ;
}
}
} | java | protected void initializeUniformWeight() {
if ((problem.getNumberOfObjectives() == 2) && (populationSize <= 300)) {
for (int n = 0; n < populationSize; n++) {
double a = 1.0 * n / (populationSize - 1);
lambda[n][0] = a;
lambda[n][1] = 1 - a;
}
} else {
String dataFileName;
dataFileName = "W" + problem.getNumberOfObjectives() + "D_" +
populationSize + ".dat";
try {
// String path =
// Paths.get(VectorFileUtils.class.getClassLoader().getResource(filePath).toURI()).toString
// ();
InputStream in =
getClass()
.getClassLoader()
.getResourceAsStream(dataDirectory + "/" + dataFileName);
InputStreamReader isr = new InputStreamReader(in);
BufferedReader br = new BufferedReader(isr);
int i = 0;
int j = 0;
String aux = br.readLine();
while (aux != null) {
StringTokenizer st = new StringTokenizer(aux);
j = 0;
while (st.hasMoreTokens()) {
double value = new Double(st.nextToken());
lambda[i][j] = value;
j++;
}
aux = br.readLine();
i++;
}
br.close();
} catch (Exception e) {
throw new JMetalException("initializeUniformWeight: failed when reading for file: "
+ dataDirectory + "/" + dataFileName, e) ;
}
}
} | [
"protected",
"void",
"initializeUniformWeight",
"(",
")",
"{",
"if",
"(",
"(",
"problem",
".",
"getNumberOfObjectives",
"(",
")",
"==",
"2",
")",
"&&",
"(",
"populationSize",
"<=",
"300",
")",
")",
"{",
"for",
"(",
"int",
"n",
"=",
"0",
";",
"n",
"<"... | Initialize weight vectors | [
"Initialize",
"weight",
"vectors"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/AbstractMOEAD.java#L97-L141 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/AbstractMOEAD.java | AbstractMOEAD.updateNeighborhood | @SuppressWarnings("unchecked")
protected void updateNeighborhood(S individual, int subProblemId, NeighborType neighborType) throws JMetalException {
int size;
int time;
time = 0;
if (neighborType == NeighborType.NEIGHBOR) {
size = neighborhood[subProblemId].length;
} else {
size = population.size();
}
int[] perm = new int[size];
MOEADUtils.randomPermutation(perm, size);
for (int i = 0; i < size; i++) {
int k;
if (neighborType == NeighborType.NEIGHBOR) {
k = neighborhood[subProblemId][perm[i]];
} else {
k = perm[i];
}
double f1, f2;
f1 = fitnessFunction(population.get(k), lambda[k]);
f2 = fitnessFunction(individual, lambda[k]);
if (f2 < f1) {
population.set(k, (S)individual.copy());
time++;
}
if (time >= maximumNumberOfReplacedSolutions) {
return;
}
}
} | java | @SuppressWarnings("unchecked")
protected void updateNeighborhood(S individual, int subProblemId, NeighborType neighborType) throws JMetalException {
int size;
int time;
time = 0;
if (neighborType == NeighborType.NEIGHBOR) {
size = neighborhood[subProblemId].length;
} else {
size = population.size();
}
int[] perm = new int[size];
MOEADUtils.randomPermutation(perm, size);
for (int i = 0; i < size; i++) {
int k;
if (neighborType == NeighborType.NEIGHBOR) {
k = neighborhood[subProblemId][perm[i]];
} else {
k = perm[i];
}
double f1, f2;
f1 = fitnessFunction(population.get(k), lambda[k]);
f2 = fitnessFunction(individual, lambda[k]);
if (f2 < f1) {
population.set(k, (S)individual.copy());
time++;
}
if (time >= maximumNumberOfReplacedSolutions) {
return;
}
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"void",
"updateNeighborhood",
"(",
"S",
"individual",
",",
"int",
"subProblemId",
",",
"NeighborType",
"neighborType",
")",
"throws",
"JMetalException",
"{",
"int",
"size",
";",
"int",
"time",
";",
... | Update neighborhood method
@param individual
@param subProblemId
@param neighborType
@throws JMetalException | [
"Update",
"neighborhood",
"method"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/AbstractMOEAD.java#L230-L267 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.initPopulation | public void initPopulation() {
for (int i = 0; i < populationSize; i++) {
S newSolution = problem.createSolution();
problem.evaluate(newSolution);
evaluations++;
population.add(newSolution);
subregionIdx[i][i] = 1;
}
} | java | public void initPopulation() {
for (int i = 0; i < populationSize; i++) {
S newSolution = problem.createSolution();
problem.evaluate(newSolution);
evaluations++;
population.add(newSolution);
subregionIdx[i][i] = 1;
}
} | [
"public",
"void",
"initPopulation",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"populationSize",
";",
"i",
"++",
")",
"{",
"S",
"newSolution",
"=",
"problem",
".",
"createSolution",
"(",
")",
";",
"problem",
".",
"evaluate",
"(",... | Initialize the population | [
"Initialize",
"the",
"population"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L114-L122 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.sumFitness | public double sumFitness(int location) {
double sum = 0;
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[location][i] == 1) {
sum = sum + fitnessFunction(population.get(i), lambda[location]);
}
}
return sum;
} | java | public double sumFitness(int location) {
double sum = 0;
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[location][i] == 1) {
sum = sum + fitnessFunction(population.get(i), lambda[location]);
}
}
return sum;
} | [
"public",
"double",
"sumFitness",
"(",
"int",
"location",
")",
"{",
"double",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"populationSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"subregionIdx",
"[",
"location",
"]",
"[",
... | calculate the sum of fitnesses of solutions in the location subregion | [
"calculate",
"the",
"sum",
"of",
"fitnesses",
"of",
"solutions",
"in",
"the",
"location",
"subregion"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1108-L1118 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.deleteCrowdIndiv_same | public void deleteCrowdIndiv_same(int crowdIdx, int nicheCount, double indivFitness, S indiv) {
// find the solution indices within this crowdIdx subregion
ArrayList<Integer> indList = new ArrayList<>();
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[crowdIdx][i] == 1) {
indList.add(i);
}
}
// find the solution with the worst fitness value
int listSize = indList.size();
int worstIdx = indList.get(0);
double maxFitness = fitnessFunction(population.get(worstIdx), lambda[crowdIdx]);
for (int i = 1; i < listSize; i++) {
int curIdx = indList.get(i);
double curFitness = fitnessFunction(population.get(curIdx), lambda[crowdIdx]);
if (curFitness > maxFitness) {
worstIdx = curIdx;
maxFitness = curFitness;
}
}
// if indiv has a better fitness, use indiv to replace the worst one
if (indivFitness < maxFitness) {
replace(worstIdx, indiv);
}
} | java | public void deleteCrowdIndiv_same(int crowdIdx, int nicheCount, double indivFitness, S indiv) {
// find the solution indices within this crowdIdx subregion
ArrayList<Integer> indList = new ArrayList<>();
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[crowdIdx][i] == 1) {
indList.add(i);
}
}
// find the solution with the worst fitness value
int listSize = indList.size();
int worstIdx = indList.get(0);
double maxFitness = fitnessFunction(population.get(worstIdx), lambda[crowdIdx]);
for (int i = 1; i < listSize; i++) {
int curIdx = indList.get(i);
double curFitness = fitnessFunction(population.get(curIdx), lambda[crowdIdx]);
if (curFitness > maxFitness) {
worstIdx = curIdx;
maxFitness = curFitness;
}
}
// if indiv has a better fitness, use indiv to replace the worst one
if (indivFitness < maxFitness) {
replace(worstIdx, indiv);
}
} | [
"public",
"void",
"deleteCrowdIndiv_same",
"(",
"int",
"crowdIdx",
",",
"int",
"nicheCount",
",",
"double",
"indivFitness",
",",
"S",
"indiv",
")",
"{",
"// find the solution indices within this crowdIdx subregion",
"ArrayList",
"<",
"Integer",
">",
"indList",
"=",
"n... | delete one solution from the most crowded subregion, which is indiv's subregion. Compare
indiv's fitness value and the worst one in this subregion | [
"delete",
"one",
"solution",
"from",
"the",
"most",
"crowded",
"subregion",
"which",
"is",
"indiv",
"s",
"subregion",
".",
"Compare",
"indiv",
"s",
"fitness",
"value",
"and",
"the",
"worst",
"one",
"in",
"this",
"subregion"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1124-L1151 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.deleteCrowdIndiv_diff | public void deleteCrowdIndiv_diff(int crowdIdx, int curLocation, int nicheCount, S indiv) {
// find the solution indices within this crowdIdx subregion
ArrayList<Integer> indList = new ArrayList<>();
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[crowdIdx][i] == 1) {
indList.add(i);
}
}
// find the solution with the worst fitness value
int worstIdx = indList.get(0);
double maxFitness = fitnessFunction(population.get(worstIdx), lambda[crowdIdx]);
for (int i = 1; i < nicheCount; i++) {
int curIdx = indList.get(i);
double curFitness = fitnessFunction(population.get(curIdx), lambda[crowdIdx]);
if (curFitness > maxFitness) {
worstIdx = curIdx;
maxFitness = curFitness;
}
}
// use indiv to replace the worst one
replace(worstIdx, indiv);
subregionIdx[crowdIdx][worstIdx] = 0;
subregionIdx[curLocation][worstIdx] = 1;
} | java | public void deleteCrowdIndiv_diff(int crowdIdx, int curLocation, int nicheCount, S indiv) {
// find the solution indices within this crowdIdx subregion
ArrayList<Integer> indList = new ArrayList<>();
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[crowdIdx][i] == 1) {
indList.add(i);
}
}
// find the solution with the worst fitness value
int worstIdx = indList.get(0);
double maxFitness = fitnessFunction(population.get(worstIdx), lambda[crowdIdx]);
for (int i = 1; i < nicheCount; i++) {
int curIdx = indList.get(i);
double curFitness = fitnessFunction(population.get(curIdx), lambda[crowdIdx]);
if (curFitness > maxFitness) {
worstIdx = curIdx;
maxFitness = curFitness;
}
}
// use indiv to replace the worst one
replace(worstIdx, indiv);
subregionIdx[crowdIdx][worstIdx] = 0;
subregionIdx[curLocation][worstIdx] = 1;
} | [
"public",
"void",
"deleteCrowdIndiv_diff",
"(",
"int",
"crowdIdx",
",",
"int",
"curLocation",
",",
"int",
"nicheCount",
",",
"S",
"indiv",
")",
"{",
"// find the solution indices within this crowdIdx subregion",
"ArrayList",
"<",
"Integer",
">",
"indList",
"=",
"new",... | delete one solution from the most crowded subregion, which is different from indiv's subregion.
just use indiv to replace the worst solution in that subregion | [
"delete",
"one",
"solution",
"from",
"the",
"most",
"crowded",
"subregion",
"which",
"is",
"different",
"from",
"indiv",
"s",
"subregion",
".",
"just",
"use",
"indiv",
"to",
"replace",
"the",
"worst",
"solution",
"in",
"that",
"subregion"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1157-L1184 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.countOnes | public int countOnes(int location) {
int count = 0;
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[location][i] == 1) {
count++;
}
}
return count;
} | java | public int countOnes(int location) {
int count = 0;
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[location][i] == 1) {
count++;
}
}
return count;
} | [
"public",
"int",
"countOnes",
"(",
"int",
"location",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"populationSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"subregionIdx",
"[",
"location",
"]",
"[",
"i",... | Count the number of 1s in the 'location'th subregion | [
"Count",
"the",
"number",
"of",
"1s",
"in",
"the",
"location",
"th",
"subregion"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1189-L1199 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.countRankOnes | public int countRankOnes(int location) {
int count = 0;
for (int i = 0; i < populationSize; i++) {
if (rankIdx[location][i] == 1) {
count++;
}
}
return count;
} | java | public int countRankOnes(int location) {
int count = 0;
for (int i = 0; i < populationSize; i++) {
if (rankIdx[location][i] == 1) {
count++;
}
}
return count;
} | [
"public",
"int",
"countRankOnes",
"(",
"int",
"location",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"populationSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"rankIdx",
"[",
"location",
"]",
"[",
"i",
... | count the number of 1s in a row of rank matrix | [
"count",
"the",
"number",
"of",
"1s",
"in",
"a",
"row",
"of",
"rank",
"matrix"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1204-L1214 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.findPosition | public int findPosition(S indiv) {
for (int i = 0; i < populationSize; i++) {
if (indiv.equals(population.get(i))) {
return i;
}
}
return -1;
} | java | public int findPosition(S indiv) {
for (int i = 0; i < populationSize; i++) {
if (indiv.equals(population.get(i))) {
return i;
}
}
return -1;
} | [
"public",
"int",
"findPosition",
"(",
"S",
"indiv",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"populationSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"indiv",
".",
"equals",
"(",
"population",
".",
"get",
"(",
"i",
")",
")",
")"... | find the index of the solution 'indiv' in the population | [
"find",
"the",
"index",
"of",
"the",
"solution",
"indiv",
"in",
"the",
"population"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1219-L1228 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.findRegion | public int findRegion(int idx) {
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[i][idx] == 1) {
return i;
}
}
return -1;
} | java | public int findRegion(int idx) {
for (int i = 0; i < populationSize; i++) {
if (subregionIdx[i][idx] == 1) {
return i;
}
}
return -1;
} | [
"public",
"int",
"findRegion",
"(",
"int",
"idx",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"populationSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"subregionIdx",
"[",
"i",
"]",
"[",
"idx",
"]",
"==",
"1",
")",
"{",
"return",
... | find the subregion of the 'idx'th solution in the population | [
"find",
"the",
"subregion",
"of",
"the",
"idx",
"th",
"solution",
"in",
"the",
"population"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1233-L1242 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.setLocation | public void setLocation(S indiv, double[] z_, double[] nz_) {
int minIdx;
double distance, minDist;
minIdx = 0;
distance = calculateDistance2(indiv, lambda[0], z_, nz_);
minDist = distance;
for (int i = 1; i < populationSize; i++) {
distance = calculateDistance2(indiv, lambda[i], z_, nz_);
if (distance < minDist) {
minIdx = i;
minDist = distance;
}
}
//indiv.setRegion(minIdx);
indiv.setAttribute("region", minIdx);
//indiv.Set_associateDist(minDist);
// indiv.setAttribute(ATTRIBUTES.DIST, minDist);
} | java | public void setLocation(S indiv, double[] z_, double[] nz_) {
int minIdx;
double distance, minDist;
minIdx = 0;
distance = calculateDistance2(indiv, lambda[0], z_, nz_);
minDist = distance;
for (int i = 1; i < populationSize; i++) {
distance = calculateDistance2(indiv, lambda[i], z_, nz_);
if (distance < minDist) {
minIdx = i;
minDist = distance;
}
}
//indiv.setRegion(minIdx);
indiv.setAttribute("region", minIdx);
//indiv.Set_associateDist(minDist);
// indiv.setAttribute(ATTRIBUTES.DIST, minDist);
} | [
"public",
"void",
"setLocation",
"(",
"S",
"indiv",
",",
"double",
"[",
"]",
"z_",
",",
"double",
"[",
"]",
"nz_",
")",
"{",
"int",
"minIdx",
";",
"double",
"distance",
",",
"minDist",
";",
"minIdx",
"=",
"0",
";",
"distance",
"=",
"calculateDistance2"... | Set the location of a solution based on the orthogonal distance | [
"Set",
"the",
"location",
"of",
"a",
"solution",
"based",
"on",
"the",
"orthogonal",
"distance"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1247-L1267 | train |
jMetal/jMetal | jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java | MOEADD.innerproduct | public double innerproduct(double[] vec1, double[] vec2) {
double sum = 0;
for (int i = 0; i < vec1.length; i++) {
sum += vec1[i] * vec2[i];
}
return sum;
} | java | public double innerproduct(double[] vec1, double[] vec2) {
double sum = 0;
for (int i = 0; i < vec1.length; i++) {
sum += vec1[i] * vec2[i];
}
return sum;
} | [
"public",
"double",
"innerproduct",
"(",
"double",
"[",
"]",
"vec1",
",",
"double",
"[",
"]",
"vec2",
")",
"{",
"double",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"vec1",
".",
"length",
";",
"i",
"++",
")",
"{",
... | Calculate the dot product of two vectors | [
"Calculate",
"the",
"dot",
"product",
"of",
"two",
"vectors"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1364-L1372 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.