instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public void afterPropertiesSet() {
Assert.notNull(this.securityMetadataSource, "securityMetadataSource must be specified");
Assert.notNull(this.channelDecisionManager, "channelDecisionManager must be specified");
Collection<ConfigAttribute> attributes = this.securityMetadataSource.getAllConfigAttributes();
if (... | }
chain.doFilter(request, response);
}
protected @Nullable ChannelDecisionManager getChannelDecisionManager() {
return this.channelDecisionManager;
}
protected FilterInvocationSecurityMetadataSource getSecurityMetadataSource() {
return this.securityMetadataSource;
}
public void setChannelDecisionManager(... | repos\spring-security-main\access\src\main\java\org\springframework\security\web\access\channel\ChannelProcessingFilter.java | 1 |
请完成以下Java代码 | public class TitleCaseConverter {
private static final String WORD_SEPARATOR = " ";
public static String convertToTitleCaseIteratingChars(String text) {
if (text == null || text.isEmpty()) {
return text;
}
StringBuilder converted = new StringBuilder();
boolean con... | .collect(Collectors.joining(WORD_SEPARATOR));
}
public static String convertToTitleCaseIcu4j(String text) {
if (text == null || text.isEmpty()) {
return text;
}
return UCharacter.toTitleCase(text, BreakIterator.getTitleInstance());
}
public static String convertToT... | repos\tutorials-master\core-java-modules\core-java-string-conversions-4\src\main\java\com\baeldung\titlecase\TitleCaseConverter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void evict(TenantId tenantId, AssetProfileId profileId) {
AssetProfile oldProfile = assetProfilesMap.remove(profileId);
log.debug("[{}] evict asset profile from cache: {}", profileId, oldProfile);
AssetProfile newProfile = get(tenantId, profileId);
if (newProfile != null) {
... | ConcurrentMap<EntityId, Consumer<AssetProfile>> tenantListeners = profileListeners.get(tenantId);
if (tenantListeners != null) {
tenantListeners.remove(listenerId);
}
ConcurrentMap<EntityId, BiConsumer<AssetId, AssetProfile>> assetListeners = assetProfileListeners.get(tenantId);
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\profile\DefaultTbAssetProfileCache.java | 2 |
请完成以下Java代码 | protected void configureQuery(HistoricActivityInstanceQueryImpl query) {
getAuthorizationManager().configureHistoricActivityInstanceQuery(query);
getTenantManager().configureQuery(query);
}
public DbOperation addRemovalTimeToActivityInstancesByRootProcessInstanceId(String rootProcessInstanceId, Date remova... | .updatePreserveOrder(HistoricActivityInstanceEventEntity.class, "updateHistoricActivityInstancesByProcessInstanceId", parameters);
}
public DbOperation deleteHistoricActivityInstancesByRemovalTime(Date removalTime, int minuteFrom, int minuteTo, int batchSize) {
Map<String, Object> parameters = new HashMap<Stri... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\HistoricActivityInstanceManager.java | 1 |
请完成以下Java代码 | public class CamundaFieldImpl extends BpmnModelElementInstanceImpl implements CamundaField {
protected static Attribute<String> camundaNameAttribute;
protected static Attribute<String> camundaExpressionAttribute;
protected static Attribute<String> camundaStringValueAttribute;
protected static ChildElement<Camu... | return camundaExpressionAttribute.getValue(this);
}
public void setCamundaExpression(String camundaExpression) {
camundaExpressionAttribute.setValue(this, camundaExpression);
}
public String getCamundaStringValue() {
return camundaStringValueAttribute.getValue(this);
}
public void setCamundaStrin... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\camunda\CamundaFieldImpl.java | 1 |
请完成以下Java代码 | public String get(String key) {
try {
readLock.lock();
logger.info(Thread.currentThread().getName() + " reading");
return syncHashMap.get(key);
} finally {
readLock.unlock();
}
}
public String remove(String key) {
try {
... | Reader(SynchronizedHashMapWithRWLock object) {
this.object = object;
}
@Override
public void run() {
for (int i = 0; i < 10; i++) {
object.get("key" + i);
}
}
}
private static class Writer implements Runnable {
Synchr... | repos\tutorials-master\core-java-modules\core-java-concurrency-advanced\src\main\java\com\baeldung\concurrent\locks\SynchronizedHashMapWithRWLock.java | 1 |
请完成以下Java代码 | public boolean isFulfilled(PvmExecutionImpl element) {
return element == null || CompensationBehavior.isCompensationThrowing(element);
}
});
return walker.getCurrentElement();
}
/**
* See #CAM-10978
* Use case process instance with <code>asyncBefore</code> startEvent
* After unifyin... | public static void createMissingHistoricVariables(PvmExecutionImpl execution) {
Collection<VariableInstanceEntity> variables = ((ExecutionEntity) execution).getVariablesInternal();
if (variables != null && variables.size() > 0) {
// trigger historic creation if the history is not presented already
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\pvm\runtime\LegacyBehavior.java | 1 |
请完成以下Java代码 | private static OIRowUserInputParts extractInitialUserInput(final @NonNull CreateViewRequest request)
{
final OIRowUserInputParts initialUserInput = request.getParameterAs(VIEW_PARAM_InitialUserInput, OIRowUserInputParts.class);
return initialUserInput != null ? initialUserInput : OIRowUserInputParts.EMPTY;
}
@N... | }
private DocumentFilterDescriptor getFilterDescriptor()
{
DocumentFilterDescriptor filterDescriptor = this._filterDescriptor;
if (filterDescriptor == null)
{
final AcctSchema primaryAcctSchema = acctSchemaBL.getPrimaryAcctSchema(ClientId.METASFRESH);
final LookupDescriptorProviders lookupDescriptorProvi... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.webui\src\main\java\de\metas\acct\gljournal_sap\select_open_items\OIViewFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DataSource ordersDataSource() {
DataSourceProperties primaryDataSourceProperties = ordersDataSourceProperties();
return DataSourceBuilder.create()
.driverClassName(primaryDataSourceProperties.getDriverClassName())
.url(primaryDataSourceProperties.getUrl())
.username(pri... | return factory;
}
@Bean
public DataSourceInitializer ordersDataSourceInitializer()
{
DataSourceInitializer dataSourceInitializer = new DataSourceInitializer();
dataSourceInitializer.setDataSource(ordersDataSource());
ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopula... | repos\Spring-Boot-Advanced-Projects-main\springboot-multiple-datasources\src\main\java\net\alanbinu\springboot\springbootmultipledatasources\config\OrdersDataSourceConfig.java | 2 |
请完成以下Java代码 | private TableRecordReference getTableRecordReferenceFromEventDescriptor(final SupplyRequiredDescriptor descriptor)
{
final TableRecordReference recordReference = TableRecordReference.ofNullable(I_C_Order.Table_Name, descriptor.getOrderId());
if (recordReference == null)
{
Loggables.withLogger(log, Level.ERROR... | final UserId updatedByUserId = UserId.ofRepoIdOrNull(InterfaceWrapperHelper.getPO(order).getUpdatedBy());
if (updatedByUserId != null && updatedByUserId.isRegularUser())
{
userIds.add(updatedByUserId);
}
}
//deadletter recipient
if (userIds.isEmpty())
{
final UserId supervisorId = orgDAO.getOrg... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\planning\src\main\java\de\metas\material\planning\event\SupplyRequiredDecreasedNotificationProducer.java | 1 |
请完成以下Java代码 | public class BaseAuthor implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private Long id;
private int age;
private String name;
private String genre;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}... | }
public void setGenre(String genre) {
this.genre = genre;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return "Author{" + "name=" + name + "}";
}
} | repos\Hibernate-SpringBoot-master\HibernateSpringBootSubentities\src\main\java\com\bookstore\entity\BaseAuthor.java | 1 |
请完成以下Java代码 | public class User implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String userName;
private String password;
private String email;
private String nickname;
private String regTime;
public User() {
super();
}
public User(String email, String nickname, Strin... | public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
pu... | repos\spring-boot-leaning-master\1.x\第09课:如何玩转 Redis\spring-boot-redis\src\main\java\com\neo\domain\User.java | 1 |
请完成以下Java代码 | public void setPA_Measure_ID (int PA_Measure_ID)
{
if (PA_Measure_ID < 1)
set_ValueNoCheck (COLUMNNAME_PA_Measure_ID, null);
else
set_ValueNoCheck (COLUMNNAME_PA_Measure_ID, Integer.valueOf(PA_Measure_ID));
}
/** Get Measure.
@return Concrete Performance Measurement
*/
public int getPA_Measure_ID ... | @return Performace Ratio
*/
public int getPA_Ratio_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_PA_Ratio_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_R_RequestType getR_RequestType() throws RuntimeException
{
return (I_R_RequestType)MTable.get(getCtx(), I_R_RequestType.... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_Measure.java | 1 |
请完成以下Java代码 | public abstract class Processor {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/** 业务组件列表(当前处理器需要处理的组件列表) */
protected List<BaseComponent> componentList;
/**
* 处理函数
* @param orderProcessContext
*/
public void handle(OrderProcessContext orderProcessConte... | if (CollectionUtils.isEmpty(componentList)) {
logger.error(this.getClass().getSimpleName() + "中componentList为空!");
throw new CommonSysException(ExpCodeEnum.COMPONENT_NULL);
}
// 依次执行所有业务组件
for (BaseComponent component : componentList) {
component.handle(order... | repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Order\src\main\java\com\gaoxi\order\processor\Processor.java | 1 |
请完成以下Java代码 | public static String moveDown(XMLStreamReader xtr) {
try {
while (xtr.hasNext()) {
int event = xtr.next();
switch (event) {
case XMLStreamConstants.END_DOCUMENT:
return null;
case XMLStreamConstants.START... | public static boolean moveToEndOfElement(XMLStreamReader xtr, String elementName) {
try {
while (xtr.hasNext()) {
int event = xtr.next();
switch (event) {
case XMLStreamConstants.END_DOCUMENT:
return false;
... | repos\Activiti-develop\activiti-core\activiti-bpmn-converter\src\main\java\org\activiti\bpmn\converter\XMLStreamReaderUtil.java | 1 |
请完成以下Java代码 | public Optional<ProductPlanning> retrieveActiveProductPlanningByProductAndSchemaId(
@NonNull final ProductId productId,
@NonNull final ProductPlanningSchemaId schemaId)
{
return queryBL.createQueryBuilder(I_PP_Product_Planning.class)
.addOnlyActiveRecordsFilter()
.addOnlyContextClient()
.addEqualsF... | .addEqualsFilter(I_PP_Product_Planning.COLUMNNAME_IsTraded, X_PP_Product_Planning.ISTRADED_Yes);
final I_PP_Product_Planning record = queryBL.createQueryBuilder(I_PP_Product_Planning.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_PP_Product_Planning.COLUMNNAME_M_Product_ID, productId)
.addInArra... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\material\planning\impl\ProductPlanningDAO.java | 1 |
请完成以下Java代码 | public CustomPropertiesResolver createExpressionCustomPropertiesResolver(ActivitiListener activitiListener) {
return new ExpressionCustomPropertiesResolver(
expressionManager.createExpression(activitiListener.getCustomPropertiesResolverImplementation())
);
}
@Override
public Cus... | * @return
* @throws ActivitiIllegalArgumentException
* when the given entity name
*/
protected Class<?> getEntityType(String entityType) {
if (entityType != null) {
Class<?> entityClass = ENTITY_MAPPING.get(entityType.trim());
if (entityClass == null) {
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\parser\factory\DefaultListenerFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ConfigProperties {
@Validated
public static class Credentials {
@Length(max = 4, min = 1)
private String authMethod;
private String username;
private String password;
public String getAuthMethod() {
return authMethod;
}
public ... | public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public Credentials getCredentials() {
return credentials;
}
public void setCredentials(Credentials credentials) {
this.credentials = credentials;
}
public L... | repos\tutorials-master\spring-boot-modules\spring-boot-core\src\main\java\com\baeldung\configurationproperties\ConfigProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class PmsOperator extends PermissionBaseEntity {
/**
*
*/
private static final long serialVersionUID = 1L;
private String loginName;// 登录名
private String loginPwd; // 登录密码
private String realName; // 姓名
private String mobileNo; // 手机号
private String type; // 操作员类型(admin:超级管理员,common:普通操作员),超级管理员由系统初... | */
public void setMobileNo(String mobileNo) {
this.mobileNo = mobileNo;
}
/**
* 操作员类型
*
* @return
*/
public String getType() {
return type;
}
/**
* 操作员类型
*
* @return
*/
public void setType(String type) {
this.type = type;
}
/**
* 盐
*
* @return
*/
public String getsalt() {
... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\permission\entity\PmsOperator.java | 2 |
请完成以下Java代码 | default IEditablePricingContext setQty(@NonNull final Quantity qty)
{
setQty(qty.toBigDecimal());
setUomId(qty.getUomId());
return this;
}
IEditablePricingContext setBPartnerId(BPartnerId bpartnerId);
IEditablePricingContext setCurrencyId(@Nullable CurrencyId currencyId);
IEditablePricingContext setPriceD... | * @see IPricingContext#isConvertPriceToContextUOM()
*/
IEditablePricingContext setConvertPriceToContextUOM(boolean convertPriceToContextUOM);
IEditablePricingContext setProperty(String propertyName, Object value);
default IEditablePricingContext setProperty(final String propertyName)
{
return setProperty(prop... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\IEditablePricingContext.java | 1 |
请完成以下Java代码 | public class TbNodeUpgradeUtils {
public static void upgradeConfigurationAndVersion(RuleNode node, RuleNodeClassInfo nodeInfo) {
JsonNode oldConfiguration = node.getConfiguration();
int configurationVersion = node.getConfigurationVersion();
int currentVersion = nodeInfo.getCurrentVersion()... | }
} catch (Exception e) {
try {
JacksonUtil.treeToValue(oldConfiguration, configClass);
} catch (Exception ex) {
log.warn("Failed to upgrade rule node with id: {} type: {} fromVersion: {} toVersion: {}. " +
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\utils\TbNodeUpgradeUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public RpUserPayConfig checkParamAndGetUserPayConfig(Object object, BindingResult bindingResult, HttpServletRequest httpServletRequest)throws BizException{
validator.validate(object, bindingResult);
if (bindingResult.hasErrors()) {// 校验银行卡信息是否完整
String errorResponse = getErrorResponse(bindin... | throw new TradeBizException(TradeBizException.TRADE_ORDER_ERROR, "订单签名异常");
}
return rpUserPayConfig;
}
/**
* 获取错误返回信息
*
* @param bindingResult
* @return
*/
public String getErrorResponse(BindingResult bindingResult) {
StringBuffer sb = new StringBuffer();
... | repos\roncoo-pay-master\roncoo-pay-web-gateway\src\main\java\com\roncoo\pay\service\CnpPayService.java | 2 |
请完成以下Java代码 | public class C_Invoice_Candidate_ApproveForInvoicing extends C_Invoice_Candidate_ProcessHelper
{
@Override
protected boolean isApproveForInvoicing()
{
return true;
}
/**
* Implementation detail: during `checkPreconditionsApplicable` `getProcessInfo` throws exception because it is not configured for the Proces... | if (!selectedRowIds.isAll())
{
final Set<Integer> invoiceCandidateIds = selectedRowIds.toIntSet();
if (invoiceCandidateIds.isEmpty())
{
// shall not happen
throw new AdempiereException("@NoSelection@");
}
queryBuilder.addInArrayFilter(I_C_Invoice_Candidate.COLUMN_C_Invoice_Candidate_ID, invoic... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\invoicecandidate\process\C_Invoice_Candidate_ApproveForInvoicing.java | 1 |
请完成以下Java代码 | public void setCurrentProcessDefinition(ProcessDefinitionEntity currentProcessDefinition) {
this.currentProcessDefinition = currentProcessDefinition;
}
public FlowElement getCurrentFlowElement() {
return currentFlowElement;
}
public void setCurrentFlowElement(FlowElement currentFlowEle... | public ScopeImpl getCurrentScope() {
return currentScopeStack.peek();
}
public void removeCurrentScope() {
currentScopeStack.pop();
}
public BpmnParse setSourceSystemId(String systemId) {
sourceSystemId = systemId;
return this;
}
public String getSourceSystemId... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\bpmn\parser\BpmnParse.java | 1 |
请完成以下Java代码 | public ServerResponse.BodyBuilder varyBy(String... requestHeaders) {
this.headers.setVary(Arrays.asList(requestHeaders));
return this;
}
@Override
public ServerResponse build() {
return build((request, response) -> null);
}
@Override
public ServerResponse build(WriteFunction writeFunction) {
return new... | }
@Override
public ServerResponse render(String name, Map<String, ?> model) {
return new GatewayRenderingResponseBuilder(name).status(this.statusCode)
.headers(headers -> headers.putAll(this.headers))
.cookies(cookies -> cookies.addAll(this.cookies))
.modelAttributes(model)
.build();
}
@Override
pu... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\handler\GatewayServerResponseBuilder.java | 1 |
请完成以下Java代码 | public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final WeakPropertyChangeListener other = (WeakPropertyChangeListener)obj;
final PropertyChangeListener thisDelegate = getDel... | final PropertyChangeListener delegate = getDelegate();
if (delegate == null)
{
// delegate reference expired
if (DEBUG)
{
// TODO remove before integrating into base line!!
System.out.println(StringUtils.formatMessage("delegate of {0} is expired", this));
}
return;
}
final Object source ... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\beans\WeakPropertyChangeListener.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private List<String> processIgnoreAuthMethod(Class<?> clazz, Method method) {
RequestMapping base = clazz.getAnnotation(RequestMapping.class);
String[] baseUrl = Objects.nonNull(base) ? base.value() : new String[]{};
String[] uri = null;
if (method.isAnnotationPresent(RequestMap... | urls.add(prefix(base) + prefix(uri));
}
}
} else {
Arrays.stream(uris).forEach(uri -> {
urls.add(prefix(uri));
});
}
return urls;
}
private String prefix(String seg) {
return seg.startsWith("/") ? seg : "/"+seg;... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\config\shiro\ignore\IgnoreAuthPostProcessor.java | 2 |
请完成以下Java代码 | ClientGraphQlRequest getRequest() {
return this.request;
}
Encoder<?> getEncoder() {
return this.encoder;
}
Decoder<?> getDecoder() {
return this.decoder;
}
@Override
public ClientResponseField field(String path) {
return new DefaultClientResponseField(this, super.field(path));
}
@Override
public... | throw new FieldAccessException(getRequest(), this, field);
}
return entity;
}
@Override
public <D> D toEntity(ParameterizedTypeReference<D> type) {
ClientResponseField field = field("");
D entity = field.toEntity(type);
// should never happen because toEntity checks response.isValid
if (entity == null... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\client\DefaultClientGraphQlResponse.java | 1 |
请完成以下Java代码 | public DeploymentCache<Object> getKnowledgeBaseCache() {
return knowledgeBaseCache;
}
public void setKnowledgeBaseCache(DeploymentCache<Object> knowledgeBaseCache) {
this.knowledgeBaseCache = knowledgeBaseCache;
}
public ProcessEngineConfigurationImpl getProcessEngineConfiguration() {
... | public ProcessDefinitionEntityManager getProcessDefinitionEntityManager() {
return processDefinitionEntityManager;
}
public void setProcessDefinitionEntityManager(ProcessDefinitionEntityManager processDefinitionEntityManager) {
this.processDefinitionEntityManager = processDefinitionEntityManage... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\deploy\DeploymentManager.java | 1 |
请完成以下Java代码 | public final LUTUAssignBuilder setHUPlanningReceiptOwnerPM(final boolean isHUPlanningReceiptOwnerPM)
{
assertConfigurable();
_isHUPlanningReceiptOwnerPM = isHUPlanningReceiptOwnerPM;
return this;
}
private final boolean isHUPlanningReceiptOwnerPM()
{
return _isHUPlanningReceiptOwnerPM;
}
public LUTUAssi... | }
private final int getC_BPartner_Location_ID()
{
return _bpLocationId;
}
public LUTUAssignBuilder setM_Locator(final I_M_Locator locator)
{
assertConfigurable();
_locatorId = LocatorId.ofRecordOrNull(locator);
return this;
}
private LocatorId getLocatorId()
{
Check.assumeNotNull(_locatorId, "_loca... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\transfer\impl\LUTUAssignBuilder.java | 1 |
请完成以下Java代码 | public List<OrderCost> getByOrderId(@NonNull final OrderId orderId)
{
return newSession().getByOrderId(orderId);
}
public List<OrderCost> getByOrderIds(@NonNull final Set<OrderId> orderIds)
{
return newSession().getByOrderIds(orderIds);
}
public List<OrderCost> getByOrderLineIds(@NonNull final Set<OrderLine... | public void deleteDetails(@NonNull final OrderCostId orderCostId)
{
queryBL.createQueryBuilder(I_C_Order_Cost_Detail.class)
.addEqualsFilter(I_C_Order_Cost_Detail.COLUMNNAME_C_Order_Cost_ID, orderCostId)
.create()
.delete();
}
public boolean hasCostsByCreatedOrderLineIds(final ImmutableSet<OrderLineId... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\costs\OrderCostRepository.java | 1 |
请完成以下Java代码 | public class ResourceBundleELResolver extends ELResolver {
public ResourceBundleELResolver() {
super();
}
@Override
public Object getValue(ELContext context, Object base, Object property) {
Objects.requireNonNull(context);
if (base instanceof ResourceBundle) {
context.setPropertyResolved(base, property)... | }
}
@Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
Objects.requireNonNull(context);
if (base instanceof ResourceBundle) {
context.setPropertyResolved(base, property);
return true;
}
return false;
}
@Override
public Class<?> getCommonPropertyType(ELContext co... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\javax\el\ResourceBundleELResolver.java | 1 |
请在Spring Boot框架中完成以下Java代码 | JvmInfoMetrics jvmInfoMetrics() {
return new JvmInfoMetrics();
}
@Bean
@ConditionalOnMissingBean
JvmCompilationMetrics jvmCompilationMetrics() {
return new JvmCompilationMetrics();
}
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(name = VIRTUAL_THREAD_METRICS_CLASS)
static class VirtualThrea... | }
static final class VirtualThreadMetricsRuntimeHintsRegistrar implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
hints.reflection()
.registerTypeIfPresent(classLoader, VIRTUAL_THREAD_METRICS_CLASS,
MemberCategory.INVOKE_PU... | repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\jvm\JvmMetricsAutoConfiguration.java | 2 |
请完成以下Java代码 | public class RuleChainEntity extends BaseVersionedEntity<RuleChain> {
@Column(name = ModelConstants.RULE_CHAIN_TENANT_ID_PROPERTY)
private UUID tenantId;
@Column(name = ModelConstants.RULE_CHAIN_NAME_PROPERTY)
private String name;
@Enumerated(EnumType.STRING)
@Column(name = ModelConstants.RUL... | this.debugMode = ruleChain.isDebugMode();
this.configuration = ruleChain.getConfiguration();
this.additionalInfo = ruleChain.getAdditionalInfo();
if (ruleChain.getExternalId() != null) {
this.externalId = ruleChain.getExternalId().getId();
}
}
@Override
public Ru... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\model\sql\RuleChainEntity.java | 1 |
请完成以下Java代码 | public java.lang.String getName ()
{
return (java.lang.String)get_Value(COLUMNNAME_Name);
}
/** Set Externe Datensatz-ID.
@param RemoteRecordId Externe Datensatz-ID */
@Override
public void setRemoteRecordId (java.lang.String RemoteRecordId)
{
set_Value (COLUMNNAME_RemoteRecordId, RemoteRecordId);
}
... | */
@Override
public void setStartDate (java.sql.Timestamp StartDate)
{
set_Value (COLUMNNAME_StartDate, StartDate);
}
/** Get Anfangsdatum.
@return First effective day (inclusive)
*/
@Override
public java.sql.Timestamp getStartDate ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_StartDate);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.marketing\base\src\main\java-gen\de\metas\marketing\base\model\X_MKTG_Campaign.java | 1 |
请完成以下Java代码 | public PickingSlotRow getById(@NonNull final DocumentId id) throws EntityNotFoundException
{
return rows.getById(id);
}
@Override
public LookupValuesPage getFilterParameterDropdown(final String filterId, final String filterParameterName, final ViewFilterParameterLookupEvaluationCtx ctx)
{
throw new Unsupporte... | public Stream<? extends IViewRow> streamByIds(final DocumentIdsSelection rowIds)
{
return rows.streamByIds(rowIds);
}
@Override
public void notifyRecordsChanged(
@NonNull final TableRecordReferenceSet recordRefs,
final boolean watchedByFrontend)
{
// TODO Auto-generated method stub
}
@Override
publ... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\pickingslot\PickingSlotView.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private Map<String,Object> getCpuInfo(CentralProcessor processor) {
Map<String,Object> cpuInfo = new LinkedHashMap<>();
cpuInfo.put("name", processor.getProcessorIdentifier().getName());
cpuInfo.put("package", processor.getPhysicalPackageCount() + "个物理CPU");
cpuInfo.put("core", processor... | /**
* 获取系统相关信息,系统、运行天数、系统IP
* @param os /
* @return /
*/
private Map<String,Object> getSystemInfo(OperatingSystem os){
Map<String,Object> systemInfo = new LinkedHashMap<>();
// jvm 运行时间
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
Date date = n... | repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\system\service\impl\MonitorServiceImpl.java | 2 |
请完成以下Java代码 | public int getPP_Order_Receipt_ID()
{
return get_ValueAsInt(COLUMNNAME_PP_Order_Receipt_ID);
}
@Override
public void setQty (final @Nullable BigDecimal Qty)
{
set_ValueNoCheck (COLUMNNAME_Qty, Qty);
}
@Override
public BigDecimal getQty()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty);
... | @Override
public void setRV_M_Material_Tracking_HU_Details_ID (final int RV_M_Material_Tracking_HU_Details_ID)
{
if (RV_M_Material_Tracking_HU_Details_ID < 1)
set_ValueNoCheck (COLUMNNAME_RV_M_Material_Tracking_HU_Details_ID, null);
else
set_ValueNoCheck (COLUMNNAME_RV_M_Material_Tracking_HU_Details_ID, R... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_RV_M_Material_Tracking_HU_Details.java | 1 |
请完成以下Java代码 | protected static EntityLinkEntity copyAndCreateEntityLink(String subScopeId, String parentElementId,
String referenceScopeId, String referenceScopeType, String hierarchyType,
EntityLink parentEntityLink, EntityLinkService entityLinkService, CmmnHistoryManager historyManager) {
EntityLin... | EntityLinkEntity newEntityLink = (EntityLinkEntity) entityLinkService.createEntityLink();
newEntityLink.setLinkType(EntityLinkType.CHILD);
newEntityLink.setScopeId(scopeId);
newEntityLink.setSubScopeId(subScopeId);
newEntityLink.setScopeType(ScopeTypes.CMMN);
newEntityLink.setPar... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\util\EntityLinkUtil.java | 1 |
请完成以下Java代码 | public class MUserDefTab extends X_AD_UserDef_Tab
{
/**
*
*/
private static final long serialVersionUID = -1211944378938157092L;
@SuppressWarnings("unused")
public MUserDefTab(Properties ctx, int AD_UserDef_Tab_ID, String trxName)
{
super(ctx, AD_UserDef_Tab_ID, trxName);
}
@SuppressWarnings("unused")
... | }
}
return null;
}
public void apply(GridTabVO vo)
{
final String name = getName();
if (!Check.isEmpty(name) && name.length() > 1)
vo.setName(name);
if (!Check.isEmpty(getDescription()))
vo.setDescription(getDescription());
if (!Check.isEmpty(getHelp()))
vo.setHelp(getHelp());
//
vo.IsSingl... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\model\MUserDefTab.java | 1 |
请完成以下Java代码 | public Builder appendAllJoining(final String separator, final List<IStringExpression> expressionsToAppend)
{
if (expressionsToAppend.isEmpty())
{
return this;
}
final IStringExpression separatorExpr = Check.isEmpty(separator) ? null : createConstantExpression(separator);
boolean isFirstExpr = true... | return this;
}
/**
* Wraps the entire content of this builder using given wrapper.
* After this method invocation the builder will contain only the wrapped expression.
*/
public Builder wrap(final IStringExpressionWrapper wrapper)
{
Check.assumeNotNull(wrapper, "Parameter wrapper is not null");
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\impl\CompositeStringExpression.java | 1 |
请完成以下Java代码 | public int hashCode()
{
return 1;
}
@Override
public boolean equals(final Object other)
{
if (other instanceof AttachmentEntryDataResource)
{
return Arrays.equals(source, ((AttachmentEntryDataResource)other).source);
}
else
{
return false;
}
}
@Override
@NonNull
public String getFilename(... | return filename;
}
@Override
public String getDescription()
{
return description;
}
@Override
public long contentLength()
{
return source.length;
}
@Override
public InputStream getInputStream()
{
return new ByteArrayInputStream(source);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\attachments\AttachmentEntryDataResource.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ApiAuditConfig
{
@NonNull
ApiAuditConfigId apiAuditConfigId;
boolean active;
@NonNull
OrgId orgId;
int seqNo;
boolean isBypassAudit;
boolean forceProcessedAsync;
int keepRequestDays;
int keepRequestBodyDays;
int keepResponseDays;
int keepResponseBodyDays;
int keepErroredRequestDays;
@... | boolean wrapApiResponse;
@NonNull
@Builder.Default
@JsonIgnore // not needed in snapshot-testing
AntPathMatcher antPathMatcher = new AntPathMatcher();
public boolean matchesRequest(@NonNull final String requestPath, @NonNull final String httpMethod)
{
final boolean isPathMatching = this.pathPrefix == null
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\audit\apirequest\config\ApiAuditConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public NursingHome email(String email) {
this.email = email;
return this;
}
/**
* Get email
* @return email
**/
@Schema(example = "wagemann@berliner-stadtmission.de", description = "")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = ema... | Objects.equals(this.email, nursingHome.email) &&
Objects.equals(this.timestamp, nursingHome.timestamp);
}
@Override
public int hashCode() {
return Objects.hash(_id, name, address, postalCode, city, phone, fax, email, timestamp);
}
@Override
public String toString() {
StringBuilder sb = ne... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-patient-api\src\main\java\io\swagger\client\model\NursingHome.java | 2 |
请完成以下Java代码 | public void setHR_Department_ID (int HR_Department_ID)
{
if (HR_Department_ID < 1)
set_ValueNoCheck (COLUMNNAME_HR_Department_ID, null);
else
set_ValueNoCheck (COLUMNNAME_HR_Department_ID, Integer.valueOf(HR_Department_ID));
}
/** Get Payroll Department.
@return Payroll Department */
public int get... | /** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Search Key.
@param Value
Search key for the record in the format required - must be unique
*/
public void setValue (String... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_HR_Department.java | 1 |
请完成以下Java代码 | default Map<String, ViewEditorRenderMode> getViewEditorRenderModeByFieldName()
{
return ImmutableMap.of();
}
//
// Included documents (children)
// @formatter:off
default Collection<? extends IViewRow> getIncludedRows() { return ImmutableList.of(); }
// @formatter:on
//
// Attributes
// @formatter:off
de... | // Single column row
// @formatter:off
/** @return true if frontend shall display one single column */
default boolean isSingleColumn() { return false; }
/** @return text to be displayed if {@link #isSingleColumn()} */
default ITranslatableString getSingleColumnCaption() { return TranslatableStrings.empty(); }
//... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\IViewRow.java | 1 |
请完成以下Java代码 | public int getM_InOutLine_ID()
{
return get_ValueAsInt(COLUMNNAME_M_InOutLine_ID);
}
@Override
public void setM_MatchInv_ID (final int M_MatchInv_ID)
{
if (M_MatchInv_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_MatchInv_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_MatchInv_ID, M_MatchInv_ID);
}
@Ov... | public boolean isProcessed()
{
return get_ValueAsBoolean(COLUMNNAME_Processed);
}
@Override
public void setProcessing (final boolean Processing)
{
set_Value (COLUMNNAME_Processing, Processing);
}
@Override
public boolean isProcessing()
{
return get_ValueAsBoolean(COLUMNNAME_Processing);
}
@Overrid... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_MatchInv.java | 1 |
请完成以下Java代码 | public int retrieveTopLevelHuId(@NonNull final I_M_HU hu)
{
if (huStatusBL.isPhysicalHU(hu) || huStatusBL.isStatusShipped(hu))
{
return handlingUnitsBL.getTopLevelParent(hu).getM_HU_ID();
}
return -1;
}
public Optional<IPair<ProductId, Quantity>> retrieveProductAndQty(@NonNull final I_M_HU vhu)
{
fina... | {
return Optional.empty();
}
final I_C_UOM stockingUOM = productBL.getStockUOM(vhuProductId);
final Quantity qty = vhuStorage.getQuantity(vhuProductId, stockingUOM);
return Optional.of(ImmutablePair.of(vhuProductId, qty));
}
public Optional<Quantity> retrieveProductQty(final HuId huId, final ProductId p... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\trace\HUAccessService.java | 1 |
请完成以下Java代码 | public int getAD_Table_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Table_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Binärwert.
@param BinaryData
Binary Data
*/
@Override
public void setBinaryData (byte[] BinaryData)
{
set_ValueNoCheck (COLUMNNAME_BinaryData, Bin... | public void setTextMsg (java.lang.String TextMsg)
{
set_Value (COLUMNNAME_TextMsg, TextMsg);
}
/** Get Mitteilung.
@return Text Message
*/
@Override
public java.lang.String getTextMsg ()
{
return (java.lang.String)get_Value(COLUMNNAME_TextMsg);
}
/** Set Titel.
@param Title
Name this entity is ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Attachment.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public final class TransactionDescriptor
{
EventDescriptor eventDescriptor;
int transactionId;
ProductId productId;
WarehouseId warehouseId;
LocatorId locatorId;
PPCostCollectorId costCollectorId;
InOutLineId inoutLineId;
MovementLineId movementLineId;
InventoryLineId inventoryLineId;
Instant transactionD... | final LocatorId locatorId,
final Instant transactionDate,
final BigDecimal movementQty,
//
final PPCostCollectorId costCollectorId,
final InOutLineId inoutLineId,
final MovementLineId movementLineId,
final InventoryLineId inventoryLineId,
//
final String movementType,
@Singular final List<... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\material\interceptor\transactionevent\TransactionDescriptor.java | 2 |
请完成以下Java代码 | protected void dispatchExecutionCancelled(EventSubscriptionEntity eventSubscription, ExecutionEntity execution, CommandContext commandContext) {
// subprocesses
for (ExecutionEntity subExecution : execution.getExecutions()) {
dispatchExecutionCancelled(eventSubscription, subExecution, comman... | }
protected void dispatchActivityCancelled(EventSubscriptionEntity eventSubscription, ExecutionEntity execution, ActivityImpl activity, CommandContext commandContext) {
commandContext.getEventDispatcher().dispatchEvent(
ActivitiEventBuilder.createActivityCancelledEvent(activity.getId(),
... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\event\AbstractEventHandler.java | 1 |
请完成以下Java代码 | private RevolutPaymentExport toRevolutExport(@NonNull final I_Revolut_Payment_Export record)
{
final CurrencyId currencyId = CurrencyId.ofRepoId(record.getC_Currency_ID());
final CurrencyCode currencyCode = currencyDAO.getCurrencyCodeById(currencyId);
final Amount amount = Amount.of(record.getAmount(), currencyC... | .routingNo(record.getRoutingNo())
.IBAN(record.getIBAN())
.SwiftCode(record.getSwiftCode())
.amount(amount)
.recipientBankCountryId(CountryId.ofRepoIdOrNull(record.getRecipientBankCountryId()))
.paymentReference(record.getPaymentReference())
.recipientCountryId(CountryId.ofRepoIdOrNull(record.ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.revolut\src\main\java\de\metas\payment\revolut\RevolutExportRepo.java | 1 |
请完成以下Java代码 | public boolean isHandled(final Object model)
{
for (final IAttributeStorageFactory factory : factories)
{
if (factory.isHandled(model))
{
return true;
}
}
return false;
}
@Override
public IAttributeStorage getAttributeStorage(@NonNull final Object model)
{
final IAttributeStorage storage =... | @Override
public void setHUAttributesDAO(final IHUAttributesDAO huAttributesDAO)
{
this.huAttributesDAO = huAttributesDAO;
for (final IAttributeStorageFactory factory : factories)
{
factory.setHUAttributesDAO(huAttributesDAO);
}
}
@Override
public IHUStorageDAO getHUStorageDAO()
{
return getHUStora... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\storage\impl\CompositeAttributeStorageFactory.java | 1 |
请完成以下Java代码 | public class X_C_JobCategory extends PO implements I_C_JobCategory, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20090915L;
/** Standard Constructor */
public X_C_JobCategory (Properties ctx, int C_JobCategory_ID, String trxName)
{
super (ctx, C_JobCategory_ID, trxName... | public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Comment/Help.
@param Help
Comment or Hint
*/
public void setHelp (String Help)
{
set_Value (COLUMNNAME_Help, Help);
}
/** Get Comment/Help.
@return Comment or Hint
*/
public String getHelp ()
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_JobCategory.java | 1 |
请完成以下Java代码 | private static ClientRegistration.Builder withProviderConfiguration(AuthorizationServerMetadata metadata,
String issuer) {
String metadataIssuer = metadata.getIssuer().getValue();
Assert.state(issuer.equals(metadataIssuer),
() -> "The Issuer \"" + metadataIssuer + "\" provided in the configuration metadata d... | if (metadataAuthMethods == null || metadataAuthMethods
.contains(com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod.CLIENT_SECRET_BASIC)) {
// If null, the default includes client_secret_basic
return ClientAuthenticationMethod.CLIENT_SECRET_BASIC;
}
if (metadataAuthMethods.contains(com.nimbusds.oauth2... | repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\registration\ClientRegistrations.java | 1 |
请完成以下Java代码 | public Long getId() {
return this.id;
}
public String getContent() {
return this.content;
}
public User getAuthor() {
return this.author;
}
public void setId(Long id) {
this.id = id;
}
public void setContent(String content) {
this.content = con... | }
if (o == null || getClass() != o.getClass()) {
return false;
}
Post post = (Post) o;
return Objects.equals(id, post.id);
}
@Override
public int hashCode() {
return id != null ? id.hashCode() : 0;
}
public String toString() {
return "P... | repos\tutorials-master\persistence-modules\spring-boot-persistence-2\src\main\java\com\baeldung\listvsset\eager\list\moderatedomain\Post.java | 1 |
请完成以下Java代码 | protected void prepare()
{
ProcessInfoParameter[] para = getParametersAsArray();
for (int i = 0; i < para.length; i++)
{
String name = para[i].getParameterName();
if (para[i].getParameter() == null)
;
else
log.error("prepare - Unknown Parameter: " + name);
}
m_C_ProjectLine_ID = getRecord_ID... | boolean isSOTrx = true;
MProductPricing pp = new MProductPricing (
OrgId.ofRepoId(project.getAD_Org_ID()),
projectLine.getM_Product_ID(),
project.getC_BPartner_ID(),
null, /* countryId */
projectLine.getPlannedQty(),
isSOTrx);
pp.setM_PriceList_ID(project.getM_PriceList_ID());
pp.setPriceD... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\de\metas\project\process\legacy\ProjectLinePricing.java | 1 |
请完成以下Spring Boot application配置 | spring.application.name=Eurekaserver
eureka.client.registerWithEureka=false
eureka.client.fetchRegistry=false
server.port=8761
eureka.instance.hostname=localhost
eureka.server.expected-client-renewal-interval-seconds=30
eureka.instance.lease-expiration-duration-in-seconds=90
eureka.server.eviction-interval-timer-in-ms=... | ka.server.renewal-percent-threshold=0.85
eureka.server.renewal-threshold-update-interval-ms=900000
eureka.server.enable-self-preservation=true | repos\tutorials-master\spring-cloud-modules\spring-cloud-eureka-self-preservation\spring-cloud-eureka-server\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public void setAuthorizationEventPublisher(AuthorizationEventPublisher eventPublisher) {
Assert.notNull(eventPublisher, "eventPublisher cannot be null");
this.eventPublisher = eventPublisher;
}
/**
* Gets the {@link AuthorizationManager} used by this filter
* @return the {@link AuthorizationManager}
*/
pu... | }
/**
* If set to true, the filter will be applied to the async dispatcher. Defaults to
* {@code true}.
* @param filterAsyncDispatch whether the filter should be applied to async dispatch
*/
public void setFilterAsyncDispatch(boolean filterAsyncDispatch) {
this.filterAsyncDispatch = filterAsyncDispatch;
}... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\access\intercept\AuthorizationFilter.java | 1 |
请完成以下Java代码 | public class C_RecurrentPaymentCreateInvoice extends JavaProcess
{
/**
* Prepare - e.g., get Parameters.
*/
@Override
protected void prepare()
{
// nothing to do
}
/**
* Perform process.
*
* @return Message (clear text)
* @throws Exception
* if not successful
*/ | @Override
protected String doIt() throws Exception
{
final Timestamp startTime = SystemTime.asTimestamp();
final IBankingBL bankingBL = Services.get(IBankingBL.class);
final List<I_C_Invoice> invoices = bankingBL.createInvoicesForRecurrentPayments(get_TrxName());
addLog("Created " + invoices.size() + " inv... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\process\C_RecurrentPaymentCreateInvoice.java | 1 |
请完成以下Java代码 | public boolean existsByTenantIdAndTypeAndStatusOneOf(TenantId tenantId, JobType type, JobStatus... statuses) {
return jobRepository.existsByTenantIdAndTypeAndStatusIn(tenantId.getId(), type, Arrays.stream(statuses).toList());
}
@Override
public boolean existsByTenantIdAndEntityIdAndStatusOneOf(Tena... | }
@Override
public EntityType getEntityType() {
return EntityType.JOB;
}
@Override
protected Class<JobEntity> getEntityClass() {
return JobEntity.class;
}
@Override
protected JpaRepository<JobEntity, UUID> getRepository() {
return jobRepository;
}
} | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\job\JpaJobDao.java | 1 |
请完成以下Java代码 | private static String extractUrlOrNull(@NonNull final com.paypal.orders.Order apiOrder, @NonNull final String rel)
{
for (final LinkDescription link : apiOrder.links())
{
if (rel.contentEquals(link.rel()))
{
return link.href();
}
}
return null;
}
private static String toJson(final com.paypal.o... | {
logger.warn("Failed converting {} to JSON. Returning toString()", apiOrder, ex);
return apiOrder.toString();
}
}
public PayPalOrder markRemoteDeleted(@NonNull final PayPalOrderId id)
{
final I_PayPal_Order existingRecord = getRecordById(id);
final PayPalOrder order = toPayPalOrder(existingRecord)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.paypal\src\main\java\de\metas\payment\paypal\client\PayPalOrderRepository.java | 1 |
请完成以下Java代码 | public IView createView(@NonNull final CreateViewRequest request)
{
final ViewId viewId = request.getViewId();
viewId.assertWindowId(WINDOW_ID);
return OIView.builder()
.viewId(viewId)
.rowsData(getViewData(request))
.filterDescriptor(getFilterDescriptor())
.sapglJournalId(extractSAPGLJournalId(... | private static OIRowUserInputParts extractInitialUserInput(final @NonNull CreateViewRequest request)
{
final OIRowUserInputParts initialUserInput = request.getParameterAs(VIEW_PARAM_InitialUserInput, OIRowUserInputParts.class);
return initialUserInput != null ? initialUserInput : OIRowUserInputParts.EMPTY;
}
@N... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.webui\src\main\java\de\metas\acct\gljournal_sap\select_open_items\OIViewFactory.java | 1 |
请完成以下Java代码 | public static MixedMoney sumOf(@NonNull final Collection<Money> collection)
{
if (collection.isEmpty())
{
return MixedMoney.EMPTY;
}
final HashMap<CurrencyId, Money> map = new HashMap<>();
for (final Money money : collection)
{
map.compute(money.getCurrencyId(), (currencyId, currentMoney) -> current... | }
public Optional<Money> toNoneOrSingleValue()
{
if (map.isEmpty())
{
return Optional.empty();
}
else if (map.size() == 1)
{
return map.values().stream().findFirst();
}
else
{
throw new AdempiereException("Expected none or single value but got many: " + map.values());
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\money\MixedMoney.java | 1 |
请完成以下Java代码 | public int getAD_User_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_AD_Window getAD_Window() throws RuntimeException
{
return (I_AD_Window)MTable.get(getCtx(), I_AD_Window.Table_Name)
.getPO(getAD_Window_ID(), get_TrxNa... | public void setAttribute (String Attribute)
{
set_Value (COLUMNNAME_Attribute, Attribute);
}
/** Get Attribute.
@return Attribute */
public String getAttribute ()
{
return (String)get_Value(COLUMNNAME_Attribute);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Preference.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public final class DataNeo4jAutoConfiguration {
@Bean
@ConditionalOnMissingBean
Neo4jConversions neo4jConversions() {
return new Neo4jConversions();
}
@Bean
@ConditionalOnMissingBean
Neo4jManagedTypes neo4jManagedTypes(ApplicationContext applicationContext) throws ClassNotFoundException {
Set<Class<?>> ini... | return Neo4jClient.create(driver, databaseNameProvider);
}
@Bean(Neo4jRepositoryConfigurationExtension.DEFAULT_NEO4J_TEMPLATE_BEAN_NAME)
@ConditionalOnMissingBean(Neo4jOperations.class)
Neo4jTemplate neo4jTemplate(Neo4jClient neo4jClient, Neo4jMappingContext neo4jMappingContext) {
return new Neo4jTemplate(neo4jC... | repos\spring-boot-4.0.1\module\spring-boot-data-neo4j\src\main\java\org\springframework\boot\data\neo4j\autoconfigure\DataNeo4jAutoConfiguration.java | 2 |
请完成以下Java代码 | protected PeriodUnit getPeriodUnit() {
return periodUnit;
}
public String getReportType() {
return reportType;
}
@CamundaQueryParam("reportType")
public void setReportType(String reportType) {
if (!VALID_REPORT_TYPE_VALUES.contains(reportType)) {
throw new InvalidRequestException(Response.... | protected List<? extends ReportResult> executeReportQuery(T report) {
return report.duration(periodUnit);
}
public List<? extends ReportResult> executeReport(ProcessEngine engine) {
T reportQuery = createNewReportQuery(engine);
applyFilters(reportQuery);
try {
return executeReportQuery(repor... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\AbstractReportDto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public User getUserDefault2(Long id, Throwable e) {
System.out.println(e.getMessage());
User user = new User();
user.setId(-2L);
user.setUsername("defaultUser2");
user.setPassword("123456");
return user;
}
public List<User> getUsers() {
return this.restTe... | } else {
return "新增用户失败";
}
}
@CacheRemove(commandKey = "getUserById")
@HystrixCommand
public void updateUser(@CacheKey("id") User user) {
this.restTemplate.put("http://Server-Provider/user", user);
}
public void deleteUser(@PathVariable Long id) {
this.rest... | repos\SpringAll-master\30.Spring-Cloud-Hystrix-Circuit-Breaker\Ribbon-Consumer\src\main\java\com\example\demo\Service\UserService.java | 2 |
请完成以下Java代码 | public int getCM_Container_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_CM_Container_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Container URL.
@param CM_Container_URL_ID
Contains info on used URLs
*/
public void setCM_Container_URL_ID (int CM_Container_URL_ID)
{
if (... | }
/** Get Last Result.
@return Contains data on the last check result
*/
public String getLast_Result ()
{
return (String)get_Value(COLUMNNAME_Last_Result);
}
/** Set Status.
@param Status
Status of the currently running check
*/
public void setStatus (String Status)
{
set_Value (COLUMNNAME_S... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Container_URL.java | 1 |
请完成以下Java代码 | public CustomValueMapper createInstance() {
Class<?> valueMapperClass = lookupClass();
CustomValueMapper valueMapper = null;
if (valueMapperClass != null) {
valueMapper = newInstance(valueMapperClass);
if (valueMapper != null) {
LOGGER.logSpinValueMapperDetected();
}
} // el... | }
}
protected Class<?> lookupClass() {
try {
return Class.forName(SPIN_VALUE_MAPPER_CLASS_NAME);
} catch (ClassNotFoundException ignored) {
// engine plugin is not on class path => ignore
} catch (Throwable e) {
throw LOGGER.spinValueMapperException(e);
}
return null;
}
... | repos\camunda-bpm-platform-master\engine-dmn\feel-scala\src\main\java\org\camunda\bpm\dmn\feel\impl\scala\spin\SpinValueMapperFactory.java | 1 |
请完成以下Java代码 | String toString(int indentFactor, int indent) throws JSONException {
int len = length();
if (len == 0) {
return "[]";
}
int i;
StringBuilder sb = new StringBuilder("[");
if (len == 1) {
sb.append(JSONObject.valueToString(this.myArrayList.get(0), in... | * Warning: This method assumes that the signalData structure is acyclical.
*
* @return The writer.
* @throws JSONException
*/
public Writer write(Writer writer) throws JSONException {
try {
boolean b = false;
int len = length();
writer.write('[');
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\util\json\JSONArray.java | 1 |
请完成以下Java代码 | public void dispose()
{
final CacheMgt cacheManager = CacheMgt.get();
CACHE_RESET_TABLE_NAMES.forEach(tableName -> cacheManager.removeCacheResetListener(tableName, this));
}
@Override
public long reset(final CacheInvalidateMultiRequest multiRequest)
{
doConvert("cache reset on " + multiRequest);
return 1;... | setQtyConv(null);
final I_C_UOM uomFrom = getC_UOM();
final I_C_UOM uomTo = getC_UOM_To();
if (uomFrom == null || uomTo == null)
{
return;
}
final I_M_Product product = getM_Product();
final BigDecimal qty = getQty();
try
{
final BigDecimal qtyConv;
if (product != null)
{
final UOMC... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\de\metas\uom\form\UOMConversionCheckFormPanel.java | 1 |
请完成以下Java代码 | public void deleteDeployment(String deploymentId) {
deleteEventDefinitionsForDeployment(deploymentId);
deleteChannelDefinitionsForDeployment(deploymentId);
getResourceEntityManager().deleteResourcesByDeploymentId(deploymentId);
delete(findById(deploymentId));
}
protected void de... | @Override
public long findDeploymentCountByNativeQuery(Map<String, Object> parameterMap) {
return dataManager.findDeploymentCountByNativeQuery(parameterMap);
}
protected EventResourceEntityManager getResourceEntityManager() {
return engineConfiguration.getResourceEntityManager();
}
... | repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\persistence\entity\EventDeploymentEntityManagerImpl.java | 1 |
请完成以下Java代码 | public void setCategory(String category) {
this.category = category;
}
public String getTaskIdVariableName() {
return taskIdVariableName;
}
public void setTaskIdVariableName(String taskIdVariableName) {
this.taskIdVariableName = taskIdVariableName;
}
public String getT... | public void setTaskListeners(List<FlowableListener> taskListeners) {
this.taskListeners = taskListeners;
}
@Override
public HumanTask clone() {
HumanTask clone = new HumanTask();
clone.setValues(this);
return clone;
}
public void setValues(HumanTask otherElement) {
... | repos\flowable-engine-main\modules\flowable-cmmn-model\src\main\java\org\flowable\cmmn\model\HumanTask.java | 1 |
请完成以下Java代码 | private InvoiceChangedEvent createInvoiceChangedEvent(final I_C_Invoice invoice, final boolean reversal)
{
return InvoiceChangedEvent.builder()
.invoiceId(InvoiceId.ofRepoId(invoice.getC_Invoice_ID()))
.invoiceDate(TimeUtil.asLocalDate(invoice.getDateInvoiced()))
.bpartnerId(BPartnerId.ofRepoId(invoice.g... | return pricesByProductId.keySet()
.stream()
.map(productId -> ProductPrice.builder()
.productId(productId)
.price(pricesByProductId.get(productId))
.build())
.collect(ImmutableList.toImmutableList());
}
private boolean isCreditMemo(final I_C_Invoice invoice)
{
final IInvoiceBL invoic... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\bpartner\product\stats\interceptor\C_Invoice.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class AuthResource {
private final Logger log = LoggerFactory.getLogger(AuthResource.class);
private OAuth2AuthenticationService authenticationService;
public AuthResource(OAuth2AuthenticationService authenticationService) {
this.authenticationService = authenticationService;
}
/*... | return authenticationService.authenticate(request, response, params);
}
/**
* Logout current user deleting his cookies.
*
* @param request the HttpServletRequest holding - among others - the headers passed from the client.
* @param response the HttpServletResponse getting the cookies set u... | repos\tutorials-master\jhipster-modules\jhipster-uaa\gateway\src\main\java\com\baeldung\jhipster\gateway\web\rest\AuthResource.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Amount getTotalDueSeller()
{
return totalDueSeller;
}
public void setTotalDueSeller(Amount totalDueSeller)
{
this.totalDueSeller = totalDueSeller;
}
@Override
public boolean equals(Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return fals... | sb.append(" refunds: ").append(toIndentedString(refunds)).append("\n");
sb.append(" totalDueSeller: ").append(toIndentedString(totalDueSeller)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-ebay\ebay-api-client\src\main\java\de\metas\camel\externalsystems\ebay\api\model\PaymentSummary.java | 2 |
请完成以下Java代码 | public Object execute(CommandContext commandContext) {
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);
AttachmentEntity updateAttachment = processEngineConfiguration.getAttachmentEntityManager().findById(attachment.getId());
... | }
updateAttachment.setName(attachment.getName());
updateAttachment.setDescription(attachment.getDescription());
FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();
if (eventDispatcher != null && eventDispatcher.isEnabled()) {
eventDisp... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\cmd\SaveAttachmentCmd.java | 1 |
请完成以下Java代码 | public class ExpressionCaseLifecycleListener implements CaseInstanceLifecycleListener {
protected String sourceState;
protected String targetState;
protected Expression expression;
public ExpressionCaseLifecycleListener(String sourceState, String targetState, Expression expression) {
this.sour... | return targetState;
}
@Override
public void stateChanged(CaseInstance caseInstance, String oldState, String newState) {
expression.getValue((CaseInstanceEntity) caseInstance);
}
/**
* returns the expression text for this case instance lifecycle listener.
*/
public String getE... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\listener\ExpressionCaseLifecycleListener.java | 1 |
请完成以下Java代码 | public String getLoopDataOutputRef() {
return loopDataOutputRef;
}
public void setLoopDataOutputRef(String loopDataOutputRef) {
this.loopDataOutputRef = loopDataOutputRef;
}
public String getOutputDataItem() {
return outputDataItem;
}
public void setOutputDataItem(Stri... | public MultiInstanceLoopCharacteristics clone() {
MultiInstanceLoopCharacteristics clone = new MultiInstanceLoopCharacteristics();
clone.setValues(this);
return clone;
}
public void setValues(MultiInstanceLoopCharacteristics otherLoopCharacteristics) {
setInputDataItem(otherLoop... | repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\MultiInstanceLoopCharacteristics.java | 1 |
请完成以下Java代码 | public void validateSOTrx(@NonNull final I_C_DocType_Invoicing_Pool docTypeInvoicingPoolRecord)
{
validatePositiveAmountDocType(docTypeInvoicingPoolRecord);
validateNegativeAmountDocType(docTypeInvoicingPoolRecord);
}
@ModelChange(
timings = ModelValidator.TYPE_BEFORE_CHANGE,
ifColumnsChanged = I_C_DocTyp... | {
final DocTypeId negativeAmountDocTypeId = DocTypeId.ofRepoId(docTypeInvoicingPoolRecord.getNegative_Amt_C_DocType_ID());
validateDocType(negativeAmountDocTypeId, docTypeInvoicingPoolRecord);
}
private void validateDocType(
@NonNull final DocTypeId docTypeId,
@NonNull final I_C_DocType_Invoicing_Pool doc... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\document\invoicingpool\C_DocType_Invoicing_Pool.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Book implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
private String isbn;
private int price;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name ... | public void setIsbn(String isbn) {
this.isbn = isbn;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public Author getAuthor() {
return author;
}
public void setAuthor(Author author) {
this.auth... | repos\Hibernate-SpringBoot-master\HibernateSpringBootDtoViaFullJoins\src\main\java\com\bookstore\entity\Book.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class ShipperTransportationDocActionCustomizer implements IDocActionOptionsCustomizer
{
@Override
public String getAppliesToTableName()
{
return I_M_ShipperTransportation.Table_Name;
}
@Override
public void customizeValidActions(final DocActionOptionsContext optionsCtx)
{
final Set<String> docActions... | // remove the void option when Drafted
docActions.remove(IDocument.ACTION_Void);
}
// Complete .. CO
else if (IDocument.STATUS_Completed.equals(docStatus))
{
docActions.add(IDocument.ACTION_ReActivate);
}
//
// Correct options
optionsCtx.setDocActions(ImmutableSet.copyOf(docActions));
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\shipping\model\ShipperTransportationDocActionCustomizer.java | 2 |
请完成以下Java代码 | public void beforeComplete(final I_C_Flatrate_Conditions cond)
{
final IFlatrateDAO flatrateDB = Services.get(IFlatrateDAO.class);
final boolean matchingsAreRequired = X_C_Flatrate_Conditions.TYPE_CONDITIONS_HoldingFee.equals(cond.getType_Conditions())
|| X_C_Flatrate_Conditions.TYPE_CONDITIONS_Refundable.equa... | if (hasHoCompletedTransition)
{
throw new AdempiereException(MSG_CONDITIONS_ERROR_TRANSITION_NOT_CO_0P);
}
}
@DocValidate(timings = { ModelValidator.TIMING_BEFORE_REACTIVATE })
public void beforeReactivate(final I_C_Flatrate_Conditions cond)
{
// check if the conditions are already used somewhere
final ... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\interceptor\C_Flatrate_Conditions.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SecurityConfig {
@Bean
SecurityWebFilterChain filterChain(ServerHttpSecurity http) {
// @formatter:off
return http
.authorizeExchange(exchanges -> exchanges
.matchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
.anyExchange().authenticated())
.formLogin(Customize... | @Bean
<S extends Session> SpringSessionBackedReactiveSessionRegistry<S> sessionRegistry(
ReactiveSessionRepository<S> sessionRepository,
ReactiveFindByIndexNameSessionRepository<S> indexedSessionRepository) {
return new SpringSessionBackedReactiveSessionRegistry<>(sessionRepository, indexedSessionRepository);
... | repos\spring-session-main\spring-session-samples\spring-session-sample-boot-reactive-max-sessions\src\main\java\com\example\SecurityConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class JasperExecuteReportStrategy implements ExecuteReportStrategy
{
private static final String SYS_CONFIG_MOCK_REPORT_SERVICE = "de.metas.report.jasper.IsMockReportService";
private static final String MOCK_CUCUMBER_REPORT_FILENAME = "test_filename.pdf";
private static final String MOCK_CUCUMBER_REPORT_DATA... | final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
//dev-note: workaround to mock jasper reports during cucumber tests
if (sysConfigBL.getBooleanValue(SYS_CONFIG_MOCK_REPORT_SERVICE, false))
{
return ReportResult.builder()
.outputType(outputType)
.reportFilename(MOCK_CUCUMBER_REPORT_... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\de.metas.report.jasper.client\src\main\java\de\metas\report\jasper\client\process\JasperExecuteReportStrategy.java | 2 |
请完成以下Java代码 | public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.user... | }
public Date getStartTimestamp() {
return startTimestamp;
}
public void setStartTimestamp(Date startTimestamp) {
this.startTimestamp = startTimestamp;
}
public Date getLastAccessTime() {
return lastAccessTime;
}
public void setLastAccessTime(Date lastAccessTime) {
this.lastAccessTime = lastAccessTim... | repos\SpringAll-master\17.Spring-Boot-Shiro-Session\src\main\java\com\springboot\pojo\UserOnline.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CustomIpAuthenticationProvider implements AuthenticationProvider {
Set<String> whitelist = new HashSet<>();
public CustomIpAuthenticationProvider() {
whitelist.add("11.11.11.11");
whitelist.add("127.0.0.1");
}
@Override
public Authentication authenticate(Authenticatio... | final String name = auth.getName();
final String password = auth.getCredentials().toString();
if (name.equals("john") && password.equals("123")) {
List<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
return... | repos\tutorials-master\spring-security-modules\spring-security-web-boot-3\src\main\java\com\baeldung\roles\ip\config\CustomIpAuthenticationProvider.java | 2 |
请完成以下Java代码 | public String getRequestType ()
{
return (String)get_Value(COLUMNNAME_RequestType);
}
/** Set Status Code.
@param StatusCode Status Code */
public void setStatusCode (int StatusCode)
{
set_Value (COLUMNNAME_StatusCode, Integer.valueOf(StatusCode));
}
/** Get Status Code.
@return Status Code */
pu... | set_Value (COLUMNNAME_UserAgent, UserAgent);
}
/** Get User Agent.
@return Browser Used
*/
public String getUserAgent ()
{
return (String)get_Value(COLUMNNAME_UserAgent);
}
/** Set Web Session.
@param WebSession
Web Session ID
*/
public void setWebSession (String WebSession)
{
set_Value (COL... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_WebAccessLog.java | 1 |
请完成以下Java代码 | public void addSentence(String sentence)
{
T key = generateKey(sentence);
if (key == null) return;
Set<String> set = storage.get(key);
if (set == null)
{
set = new TreeSet<String>();
storage.put(key, set);
}
set.add(sentence);
}
... | Double score = keyOuter.similarity(key);
for (String sentence : entry.getValue())
{
result.put(sentence, score);
}
}
return result;
}
@Override
public void removeAllSentences()
{
storage.clear();
}
} | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\suggest\scorer\BaseScorer.java | 1 |
请完成以下Java代码 | public ReviewStatus getStatus() {
return status;
}
public void setStatus(ReviewStatus status) {
this.status = status;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (this == obj) {
retur... | }
if (!(obj instanceof BookReview)) {
return false;
}
return id != null && id.equals(((BookReview) obj).id);
}
@Override
public int hashCode() {
return 2021;
}
} | repos\Hibernate-SpringBoot-master\HibernateSpringBootDomainEvents\src\main\java\com\bookstore\entity\BookReview.java | 1 |
请完成以下Java代码 | public ProcessEngineException parseProcessException(String name, Throwable cause) {
return new ProcessEngineException(exceptionMessage("002", "Error while parsing process of resource '{}'.", name), cause);
}
public void ignoredSentryWithMissingCondition(String id) {
logInfo(
"003",
"Sentry with... | id
);
}
public CmmnTransformException nonMatchingVariableEvents(String id) {
return new CmmnTransformException(exceptionMessage(
"007",
"The variableOnPart of the sentry with id '{}' must have one valid variable event. ",
id
));
}
public CmmnTransformException emptyVariableName(S... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\transformer\CmmnTransformerLogger.java | 1 |
请完成以下Java代码 | public class TaskReportResourceImpl implements TaskReportResource {
public static final MediaType APPLICATION_CSV_TYPE = new MediaType("application", "csv");
public static final MediaType TEXT_CSV_TYPE = new MediaType("text", "csv");
public static final List<Variant> VARIANTS = Variant.mediaTypes(MediaType.APPLI... | .build();
}
}
throw new InvalidRequestException(Status.NOT_ACCEPTABLE, "No acceptable content-type found");
}
@SuppressWarnings("unchecked")
protected List<TaskCountByCandidateGroupResult> queryTaskCountByCandidateGroupReport() {
TaskCountByCandidateGroupResultDto reportDto = new TaskCountByCan... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\task\impl\TaskReportResourceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SpringQrtzScheduler {
Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private ApplicationContext applicationContext;
@PostConstruct
public void init() {
logger.info("Hello world from Spring...");
}
@Bean
public SpringBeanJobFactory springBeanJobFa... | public JobDetailFactoryBean jobDetail() {
JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean();
jobDetailFactory.setJobClass(SampleJob.class);
jobDetailFactory.setName("Qrtz_Job_Detail");
jobDetailFactory.setDescription("Invoke Sample Job service...");
jobDetailFac... | repos\tutorials-master\spring-quartz\src\main\java\org\baeldung\springquartz\basics\scheduler\SpringQrtzScheduler.java | 2 |
请完成以下Java代码 | public class CameraStream extends Application {
private VideoCapture capture;
public void start(Stage stage) throws Exception {
OpenCV.loadShared();
capture = new VideoCapture(0); // The number is the ID of the camera
ImageView imageView = new ImageView();
HBox hbox = new HBox(... | public static void main(String[] args) {
Application.launch(args);
}
public static Mat detectFace(Mat inputImage) {
MatOfRect facesDetected = new MatOfRect();
CascadeClassifier cascadeClassifier = new CascadeClassifier();
int minFaceSize = Math.round(inputImage.rows() * 0.1f);
... | repos\tutorials-master\image-processing\src\main\java\com\baeldung\imageprocessing\opencv\CameraStream.java | 1 |
请完成以下Java代码 | public String getGroupId() {
return groupId;
}
public String getEdgeNodeId() {
return edgeNodeId;
}
/**
* Returns a {@link String} representing the Edge Node's Descriptor of the form: "<groupId>/<edgeNodeId>".
*
* @return a {@link String} representing the Edge Node's Des... | public int hashCode() {
return this.getDescriptorString().hashCode();
}
@Override
public boolean equals(Object object) {
if (object instanceof EdgeNodeDescriptor) {
return this.getDescriptorString().equals(((EdgeNodeDescriptor) object).getDescriptorString());
}
r... | repos\thingsboard-master\common\transport\mqtt\src\main\java\org\thingsboard\server\transport\mqtt\util\sparkplug\EdgeNodeDescriptor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BankStatementImportFileId implements RepoIdAware
{
@NonNull
@JsonCreator
public static BankStatementImportFileId ofRepoId(final int repoId)
{
return new BankStatementImportFileId(repoId);
}
@Nullable
public static BankStatementImportFileId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ?... | int repoId;
private BankStatementImportFileId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "C_BankStatement_Import_File_ID");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\importfile\BankStatementImportFileId.java | 2 |
请完成以下Java代码 | public int getLevelHierarchy()
{
return get_ValueAsInt(COLUMNNAME_LevelHierarchy);
}
@Override
public void setPointsSum_Forecasted (final BigDecimal PointsSum_Forecasted)
{
set_Value (COLUMNNAME_PointsSum_Forecasted, PointsSum_Forecasted);
}
@Override
public BigDecimal getPointsSum_Forecasted()
{
fin... | @Override
public BigDecimal getPointsSum_Invoiced()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_PointsSum_Invoiced);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setPointsSum_Settled (final BigDecimal PointsSum_Settled)
{
set_Value (COLUMNNAME_PointsSum_Settled, PointsSum... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\commission\model\X_C_Commission_Share.java | 1 |
请完成以下Java代码 | public void setBill_User_ID(final int Bill_User_ID)
{
delegate.setBill_User_ID(Bill_User_ID);
}
@Override
public void setRenderedAddressAndCapturedLocation(final @NonNull RenderedAddressAndCapturedLocation from)
{
IDocumentBillLocationAdapter.super.setRenderedAddressAndCapturedLocation(from);
}
@Override
... | @Override
public ContractBillLocationAdapter toOldValues()
{
InterfaceWrapperHelper.assertNotOldValues(delegate);
return new ContractBillLocationAdapter(InterfaceWrapperHelper.createOld(delegate, I_C_Flatrate_Term.class));
}
public void setFrom(final @NonNull BPartnerLocationAndCaptureId billToLocationId, fina... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\location\adapter\ContractBillLocationAdapter.java | 1 |
请完成以下Java代码 | public class FixedOrderByKeyComparator<V, K> implements Comparator<V>
{
public static <V, K> FixedOrderByKeyComparator<V, K> of(final K notMatchedMarker, final List<K> fixedOrderList, final Function<V, K> keyMapper)
{
final int notMatchedMarkerIndex = fixedOrderList.indexOf(notMatchedMarker);
final int notMatched... | this.notMatchedMarkerIndex = notMatchedMarkerIndex;
this.keyMapper = keyMapper;
}
@Override
public int compare(final V o1, final V o2)
{
final int idx1 = getIndexOf(o1);
final int idx2 = getIndexOf(o2);
return idx1 - idx2;
}
private int getIndexOf(final V obj)
{
final K key = keyMapper.apply(obj);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\comparator\FixedOrderByKeyComparator.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.