instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public String getWorkerId() { return workerId; } public String getTopicName() { return topicName; } public String getTenantId() { return tenantId; } public Map<String, VariableValueDto> getVariables() { return variables; } public long getPriority() { return priority; } public String getErrorDetails() { return errorDetails; } public String getBusinessKey() { return businessKey; } public Map<String, String> getExtensionProperties(){ return extensionProperties; } public static LockedExternalTaskDto fromLockedExternalTask(LockedExternalTask task) { LockedExternalTaskDto dto = new LockedExternalTaskDto(); dto.activityId = task.getActivityId(); dto.activityInstanceId = task.getActivityInstanceId(); dto.errorMessage = task.getErrorMessage(); dto.errorDetails = task.getErrorDetails(); dto.executionId = task.getExecutionId(); dto.id = task.getId(); dto.lockExpirationTime = task.getLockExpirationTime(); dto.createTime = task.getCreateTime(); dto.processDefinitionId = task.getProcessDefinitionId(); dto.processDefinitionKey = task.getProcessDefinitionKey(); dto.processDefinitionVersionTag = task.getProcessDefinitionVersionTag(); dto.processInstanceId = task.getProcessInstanceId(); dto.retries = task.getRetries(); dto.topicName = task.getTopicName(); dto.workerId = task.getWorkerId(); dto.tenantId = task.getTenantId(); dto.variables = VariableValueDto.fromMap(task.getVariables()); dto.priority = task.getPriority(); dto.businessKey = task.getBusinessKey(); dto.extensionProperties = task.getExtensionProperties(); return dto; }
public static List<LockedExternalTaskDto> fromLockedExternalTasks(List<LockedExternalTask> tasks) { List<LockedExternalTaskDto> dtos = new ArrayList<>(); for (LockedExternalTask task : tasks) { dtos.add(LockedExternalTaskDto.fromLockedExternalTask(task)); } return dtos; } @Override public String toString() { return "LockedExternalTaskDto [activityId=" + activityId + ", activityInstanceId=" + activityInstanceId + ", errorMessage=" + errorMessage + ", errorDetails=" + errorDetails + ", executionId=" + executionId + ", id=" + id + ", lockExpirationTime=" + lockExpirationTime + ", createTime=" + createTime + ", processDefinitionId=" + processDefinitionId + ", processDefinitionKey=" + processDefinitionKey + ", processDefinitionVersionTag=" + processDefinitionVersionTag + ", processInstanceId=" + processInstanceId + ", retries=" + retries + ", suspended=" + suspended + ", workerId=" + workerId + ", topicName=" + topicName + ", tenantId=" + tenantId + ", variables=" + variables + ", priority=" + priority + ", businessKey=" + businessKey + "]"; } }
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\externaltask\LockedExternalTaskDto.java
1
请在Spring Boot框架中完成以下Java代码
public String getId() { return id; } public void setId(String id) { this.id = id; } @ApiModelProperty(example = "http://localhost:8182/management/batches/8") public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } @ApiModelProperty(example = "processMigration") public String getBatchType() { return batchType; } public void setBatchType(String batchType) { this.batchType = batchType; } @ApiModelProperty(example = "1:22:MP") public String getSearchKey() { return searchKey; } public void setSearchKey(String searchKey) { this.searchKey = searchKey; } @ApiModelProperty(example = "1:24:MP") public String getSearchKey2() { return searchKey2; } public void setSearchKey2(String searchKey2) { this.searchKey2 = searchKey2; } @ApiModelProperty(example = "2020-06-03T22:05:05.474+0000") public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } @ApiModelProperty(example = "2020-06-03T22:05:05.474+0000")
public Date getCompleteTime() { return completeTime; } public void setCompleteTime(Date completeTime) { this.completeTime = completeTime; } @ApiModelProperty(example = "completed") public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public void setTenantId(String tenantId) { this.tenantId = tenantId; } @ApiModelProperty(example = "null") public String getTenantId() { return tenantId; } }
repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\management\BatchResponse.java
2
请完成以下Java代码
public static OrgAndBPartnerCompositeLookupKeyList ofSingleLookupKey( @NonNull final OrgId orgId, @NonNull final BPartnerCompositeLookupKey bpartnerCompositeLookupKey) { return new OrgAndBPartnerCompositeLookupKeyList(orgId, ImmutableList.of(bpartnerCompositeLookupKey)); } ImmutableSet<BPartnerCompositeLookupKey> compositeLookupKeys; OrgId orgId; private OrgAndBPartnerCompositeLookupKeyList( @NonNull final OrgId orgId, @NonNull final Collection<BPartnerCompositeLookupKey> compositeLookupKeys) { this.compositeLookupKeys = ImmutableSet.copyOf(compositeLookupKeys); this.orgId = orgId; } public static OrgAndBPartnerCompositeLookupKeyList ofSingleLookupKeys( @NonNull final Collection<OrgAndBPartnerCompositeLookupKey> singleQueryLookupKeys) { if (singleQueryLookupKeys.isEmpty()) { throw new AdempiereException("singleQueryLookupKeys - given collection may not be empty"); } final ImmutableList.Builder<BPartnerCompositeLookupKey> result = ImmutableList.builder(); OrgId orgId = null; for (final OrgAndBPartnerCompositeLookupKey singleQueryLookupKey : singleQueryLookupKeys) { result.add(singleQueryLookupKey.getCompositeLookupKey()); if (orgId == null) { orgId = singleQueryLookupKey.getOrgId(); } else { if (!Objects.equals(singleQueryLookupKey.getOrgId(), orgId)) { throw new AdempiereException("ofSingleLookupKeys - all singleQueryLookupKeys need to have an equal orgId") .appendParametersToMessage() .setParameter("singleQueryLookupKeys", singleQueryLookupKeys); } } } return new OrgAndBPartnerCompositeLookupKeyList(orgId, result.build()); } /** * @param other list to add to the union. Its orgId has to be equal to this instance's orgId or has to be {@link OrgId#ANY}. * @return a list taht contains both this instances's lookup keys and the given {@code other}'s lookup keys.
*/ public OrgAndBPartnerCompositeLookupKeyList union(@NonNull final OrgAndBPartnerCompositeLookupKeyList other) { final OrgId otherOrgId = other.getOrgId(); if (!Objects.equals(otherOrgId, this.orgId) && !otherOrgId.isAny()) { throw new AdempiereException("union - other BPartnerCompositeLookupKeysWithOrg needs to have the same orgId") .appendParametersToMessage() .setParameter("this", this) .setParameter("other", other); } return new OrgAndBPartnerCompositeLookupKeyList( this.orgId, ImmutableSet.<BPartnerCompositeLookupKey>builder().addAll(compositeLookupKeys).addAll(other.getCompositeLookupKeys()).build() ); } public ImmutableList<OrgAndBPartnerCompositeLookupKey> asSingeKeys() { return compositeLookupKeys.stream() .map(lookupKey -> OrgAndBPartnerCompositeLookupKey.of(lookupKey, orgId)) .collect(ImmutableList.toImmutableList()); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\utils\OrgAndBPartnerCompositeLookupKeyList.java
1
请完成以下Java代码
public boolean isProcessInstanceType() { return processInstanceType; } @Override public boolean isScope() { return scope; } @Override public boolean isMultiInstanceRoot() { return multiInstanceRoot; } @Override public Object getVariable(String variableName) { return variables.get(variableName); } @Override public boolean hasVariable(String variableName) { return variables.containsKey(variableName); }
@Override public Set<String> getVariableNames() { return variables.keySet(); } @Override public String toString() { return new StringJoiner(", ", getClass().getSimpleName() + "[", "]") .add("id='" + id + "'") .add("currentActivityId='" + currentActivityId + "'") .add("processInstanceId='" + processInstanceId + "'") .add("processDefinitionId='" + processDefinitionId + "'") .add("tenantId='" + tenantId + "'") .toString(); } }
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\delegate\ReadOnlyDelegateExecutionImpl.java
1
请完成以下Java代码
public Element setLang(String lang) { addAttribute("lang",lang); addAttribute("xml:lang",lang); return this; } /** Adds an Element to the element. @param hashcode name of element for hash table @param element Adds an Element to the element. */ public iframe addElement(String hashcode,Element element) { addElementToRegistry(hashcode,element); return(this); } /** Adds an Element to the element. @param hashcode name of element for hash table @param element Adds an Element to the element. */ public iframe addElement(String hashcode,String element) { addElementToRegistry(hashcode,element); return(this); } /** Adds an Element to the element. @param element Adds an Element to the element. */ public iframe addElement(Element element) { addElementToRegistry(element); return(this);
} /** Adds an Element to the element. @param element Adds an Element to the element. */ public iframe addElement(String element) { addElementToRegistry(element); return(this); } /** Removes an Element from the element. @param hashcode the name of the element to be removed. */ public iframe removeElement(String hashcode) { removeElementFromRegistry(hashcode); return(this); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\xhtml\iframe.java
1
请完成以下Java代码
public void setPhone (final @Nullable java.lang.String Phone) { set_Value (COLUMNNAME_Phone, Phone); } @Override public java.lang.String getPhone() { return get_ValueAsString(COLUMNNAME_Phone); } @Override public void setPhone2 (final @Nullable java.lang.String Phone2) { set_Value (COLUMNNAME_Phone2, Phone2); } @Override public java.lang.String getPhone2() { return get_ValueAsString(COLUMNNAME_Phone2); } @Override public void setSetup_Place_No (final @Nullable java.lang.String Setup_Place_No)
{ set_Value (COLUMNNAME_Setup_Place_No, Setup_Place_No); } @Override public java.lang.String getSetup_Place_No() { return get_ValueAsString(COLUMNNAME_Setup_Place_No); } @Override public void setVisitorsAddress (final boolean VisitorsAddress) { set_Value (COLUMNNAME_VisitorsAddress, VisitorsAddress); } @Override public boolean isVisitorsAddress() { return get_ValueAsBoolean(COLUMNNAME_VisitorsAddress); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_BPartner_Location_QuickInput.java
1
请完成以下Java代码
public String getTenantId() { return tenantId; } public String getOverrideDefinitionTenantId() { return overrideDefinitionTenantId; } public String getPredefinedProcessInstanceId() { return predefinedProcessInstanceId; } public String getOwnerId() { return ownerId; } public String getAssigneeId() { return assigneeId; } public Map<String, Object> getVariables() { return variables; } public Map<String, Object> getTransientVariables() { return transientVariables; }
public Map<String, Object> getStartFormVariables() { return startFormVariables; } public String getOutcome() { return outcome; } public Map<String, Object> getExtraFormVariables() { return extraFormVariables; } public FormInfo getExtraFormInfo() { return extraFormInfo; } public String getExtraFormOutcome() { return extraFormOutcome; } public boolean isFallbackToDefaultTenant() { return fallbackToDefaultTenant; } }
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\runtime\ProcessInstanceBuilderImpl.java
1
请在Spring Boot框架中完成以下Java代码
public void addVariable(RestVariable variable) { variables.add(variable); } public void setTenantId(String tenantId) { this.tenantId = tenantId; } public String getTenantId() { return tenantId; } public void setCategory(String category) { this.category = category; } public String getCategory() { return category; } public String getCaseInstanceId() { return caseInstanceId; } public void setCaseInstanceId(String caseInstanceId) { this.caseInstanceId = caseInstanceId; } public String getCaseInstanceUrl() { return caseInstanceUrl; } public void setCaseInstanceUrl(String caseInstanceUrl) { this.caseInstanceUrl = caseInstanceUrl; } public String getCaseDefinitionId() { return caseDefinitionId; } public void setCaseDefinitionId(String caseDefinitionId) { this.caseDefinitionId = caseDefinitionId; } public String getCaseDefinitionUrl() { return caseDefinitionUrl; } public void setCaseDefinitionUrl(String caseDefinitionUrl) { this.caseDefinitionUrl = caseDefinitionUrl; } public String getScopeDefinitionId() { return scopeDefinitionId; } public void setScopeDefinitionId(String scopeDefinitionId) { this.scopeDefinitionId = scopeDefinitionId; } public String getScopeId() { return scopeId; } public void setScopeId(String scopeId) { this.scopeId = scopeId; } public String getSubScopeId() { return subScopeId; } public void setSubScopeId(String subScopeId) {
this.subScopeId = subScopeId; } public String getScopeType() { return scopeType; } public void setScopeType(String scopeType) { this.scopeType = scopeType; } public String getPropagatedStageInstanceId() { return propagatedStageInstanceId; } public void setPropagatedStageInstanceId(String propagatedStageInstanceId) { this.propagatedStageInstanceId = propagatedStageInstanceId; } public String getExecutionId() { return executionId; } public void setExecutionId(String executionId) { this.executionId = executionId; } public String getProcessInstanceId() { return processInstanceId; } public void setProcessInstanceId(String processInstanceId) { this.processInstanceId = processInstanceId; } public String getProcessDefinitionId() { return processDefinitionId; } public void setProcessDefinitionId(String processDefinitionId) { this.processDefinitionId = processDefinitionId; } }
repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\history\task\HistoricTaskInstanceResponse.java
2
请完成以下Java代码
protected String doIt() throws Exception { final I_AD_Column adColumn = getRecord(I_AD_Column.class); if (p_IsDeleteFields) { final int adColumnId = adColumn.getAD_Column_ID(); adWindowsRepo.deleteFieldsByColumnId(adColumnId); } if (p_IsDropDBColumn) { dropDBColumn(adColumn); } InterfaceWrapperHelper.delete(adColumn); addLog("AD_Column Deleted {}", adColumn);
return MSG_OK; } private void dropDBColumn(final I_AD_Column adColumn) { final String tableName = Services.get(IADTableDAO.class).retrieveTableName(adColumn.getAD_Table_ID()); final String columnName = adColumn.getColumnName(); final String sqlStatement = "ALTER TABLE " + tableName + " DROP COLUMN IF EXISTS " + columnName; final String sql = MigrationScriptFileLoggerHolder.DDL_PREFIX + "SELECT public.db_alter_table(" + DB.TO_STRING(tableName) + "," + DB.TO_STRING(sqlStatement) + ")"; final Object[] sqlParams = null; // IMPORTANT: don't use any parameters because we want to log this command to migration script file DB.executeFunctionCallEx(ITrx.TRXNAME_ThreadInherited, sql, sqlParams); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\table\process\AD_Column_Delete.java
1
请完成以下Java代码
public DocTypeId getOrderDocTypeId(@Nullable final JsonOrderDocType orderDocType, final OrgId orgId) { if (orderDocType == null) { return null; } final DocBaseType docBaseType = DocBaseType.SalesOrder; final DocSubType docSubType; if (JsonOrderDocType.PrepayOrder.equals(orderDocType)) { docSubType = DocSubType.PrepayOrder; } else { docSubType = DocSubType.StandardOrder; } final I_AD_Org orgRecord = orgsDAO.getById(orgId); final DocTypeQuery query = DocTypeQuery .builder() .docBaseType(docBaseType) .docSubType(docSubType) .adClientId(orgRecord.getAD_Client_ID()) .adOrgId(orgRecord.getAD_Org_ID())
.build(); return docTypeDAO.getDocTypeId(query); } @NonNull public Optional<JsonOrderDocType> getOrderDocType(@Nullable final DocTypeId docTypeId) { if (docTypeId == null) { return Optional.empty(); } final I_C_DocType docType = docTypeDAO.getById(docTypeId); final DocBaseType docBaseType = DocBaseType.ofCode(docType.getDocBaseType()); if (!docBaseType.isSalesOrder()) { throw new AdempiereException("Invalid base doc type!"); } return Optional.ofNullable(JsonOrderDocType.ofCodeOrNull(docType.getDocSubType())); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\impl\DocTypeService.java
1
请完成以下Java代码
public void hideBusyDialog() { // nothing } /** * This method does nothing. * * @deprecated please check out the deprecation notice in {@link IClientUIInstance#disableServerPush()}. */ @Deprecated @Override public void disableServerPush() { // nothing
} /** * This method throws an UnsupportedOperationException. * * @deprecated please check out the deprecation notice in {@link IClientUIInstance#infoNoWait(int, String)}. * @throws UnsupportedOperationException */ @Deprecated @Override public void infoNoWait(int WindowNo, String AD_Message) { throw new UnsupportedOperationException("not implemented"); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\adempiere\form\AbstractClientUIInstance.java
1
请在Spring Boot框架中完成以下Java代码
public String placeOrder(OrderInsertReq orderInsertReq, String buyerId) { // 参数校验 checkParam(orderInsertReq, ExpCodeEnum.ORDER_INSERT_REQ_NULL); // 构造受理上下文 orderInsertReq.setUserId(buyerId); OrderProcessContext<String> context = buildContext(null, buyerId, orderInsertReq, ProcessReqEnum.PlaceOrder); // 受理下单请求 processEngine.process(context); // 获取结果 return context.getOrderProcessRsp(); } @Override public String pay(String orderId, String userId) { // 构造受理上下文 OrderProcessContext<String> context = buildContext(orderId, userId,null, ProcessReqEnum.Pay); // 受理下单请求 processEngine.process(context); // 获取结果 return context.getOrderProcessRsp(); } @Override public void cancelOrder(String orderId, String userId) { // 构造受理上下文 OrderProcessContext<String> context = buildContext(orderId, userId,null, ProcessReqEnum.CancelOrder); // 受理下单请求 processEngine.process(context); } @Override public void confirmDelivery(String orderId, String expressNo, String userId) { // 构造受理上下文 OrderProcessContext<String> context = buildContext(orderId, userId, expressNo, ProcessReqEnum.ConfirmDelivery); // 受理下单请求 processEngine.process(context); } @Override public void confirmReceive(String orderId, String userId) { // 构造受理上下文
OrderProcessContext<String> context = buildContext(orderId, userId,null, ProcessReqEnum.ConfirmReceive); // 受理下单请求 processEngine.process(context); } /** * 请求参数校验 * @param req 请求参数 * @param expCodeEnum 异常枚举 * @param <T> 请求参数类型 */ private <T> void checkParam(T req, ExpCodeEnum expCodeEnum) { if (req == null) { throw new CommonBizException(expCodeEnum); } } private <T> OrderProcessContext<String> buildContext(String orderId, String userId, T reqData, ProcessReqEnum processReqEnum) { OrderProcessContext context = new OrderProcessContext(); // 受理请求 OrderProcessReq req = new OrderProcessReq(); req.setProcessReqEnum(processReqEnum); req.setUserId(userId); if (StringUtils.isNotEmpty(orderId)) { req.setOrderId(orderId); } if (reqData != null) { req.setReqData(reqData); } context.setOrderProcessReq(req); return context; } }
repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Order\src\main\java\com\gaoxi\order\service\OrderServiceImpl.java
2
请在Spring Boot框架中完成以下Java代码
public String getFirstName() { return firstName; } public void setFirstName(final String firstName) { this.firstName = firstName; } public String getSecondName() { return secondName; } public void setSecondName(final String secondName) { this.secondName = secondName; } public void setId(final Long id) { this.id = id; } public Long getId() { return id; } @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final User user = (User) o; if (!Objects.equals(id, user.id)) { return false;
} if (!Objects.equals(firstName, user.firstName)) { return false; } return Objects.equals(secondName, user.secondName); } @Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (firstName != null ? firstName.hashCode() : 0); result = 31 * result + (secondName != null ? secondName.hashCode() : 0); return result; } @Override public String toString() { return "User{" + "id=" + id + ", firstName='" + firstName + '\'' + ", secondName='" + secondName + '\'' + '}'; } }
repos\tutorials-master\spring-web-modules\spring-rest-http-3\src\main\java\com\baeldung\xml\controller\User.java
2
请完成以下Java代码
public void invalidateView(final ViewId viewId) { final StockDetailsView view = getByIdOrNull(viewId); if (view == null) { return; } view.invalidateAll(); } @Override public IView createView(@NonNull final CreateViewRequest request) { final StockDetailsRowsData stockDetailsRowData = createStockDetailsRowData(request); return new StockDetailsView( request.getViewId(), request.getParentViewId(), stockDetailsRowData, ImmutableDocumentFilterDescriptorsProvider.of(createEmptyFilterDescriptor())); } private DocumentFilterDescriptor createEmptyFilterDescriptor() { return ProductFilterUtil.createFilterDescriptor(); } private StockDetailsRowsData createStockDetailsRowData(@NonNull final CreateViewRequest request) { final DocumentFilterList filters = request.getStickyFilters(); final HUStockInfoQueryBuilder query = HUStockInfoQuery.builder(); for (final DocumentFilter filter : filters.toList()) { final HUStockInfoSingleQueryBuilder singleQuery = HUStockInfoSingleQuery.builder(); final int productRepoId = filter.getParameterValueAsInt(I_M_HU_Stock_Detail_V.COLUMNNAME_M_Product_ID, -1); singleQuery.productId(ProductId.ofRepoIdOrNull(productRepoId)); final int attributeRepoId = filter.getParameterValueAsInt(I_M_HU_Stock_Detail_V.COLUMNNAME_M_Attribute_ID, -1); singleQuery.attributeId(AttributeId.ofRepoIdOrNull(attributeRepoId)); final String attributeValue = filter.getParameterValueAsString(I_M_HU_Stock_Detail_V.COLUMNNAME_AttributeValue, null);
if (MaterialCockpitUtil.DONT_FILTER.equals(attributeValue)) { singleQuery.attributeValue(AttributeValue.DONT_FILTER); } else { singleQuery.attributeValue(AttributeValue.NOT_EMPTY); } query.singleQuery(singleQuery.build()); } final Stream<HUStockInfo> huStockInfos = huStockInfoRepository.getByQuery(query.build()); return StockDetailsRowsData.of(huStockInfos); } @Override public ViewLayout getViewLayout( @NonNull final WindowId windowId, @NonNull final JSONViewDataType viewDataType, final ViewProfileId profileId) { return ViewLayout.builder() .setWindowId(windowId) // .caption(caption) .setFilters(ImmutableList.of(createEmptyFilterDescriptor())) .addElementsFromViewRowClass(StockDetailsRow.class, viewDataType) .build(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\material\cockpit\stockdetails\StockDetailsViewFactory.java
1
请完成以下Java代码
public class EditPlugin implements Interceptor { /** * 拦截目标对象的目标方法的执行 * * @param invocation * @return * @throws Throwable */ @Override public Object intercept(Invocation invocation) throws Throwable { Object[] args = invocation.getArgs(); MappedStatement statement = (MappedStatement) args[0]; String sql = statement.getBoundSql(args[1]).getSql(); System.out.println("--------intercept method: " + statement.getId() + "\n-----sql: " + sql + "\n------args: " + JSON.toJSONString(args[1])); //执行目标方法 return invocation.proceed(); } /** * 包装目标对象:为目标对象创建一个代理对象 *
* @param target * @return */ @Override public Object plugin(Object target) { return Plugin.wrap(target, this); } /** * 将插件注册时的properties属性设置进来 * * @param properties */ @Override public void setProperties(Properties properties) { System.out.println("插件配置的信息 = " + properties); } }
repos\spring-boot-student-master\spring-boot-student-mybatis\src\main\java\com\xiaolyuh\mybatis\EditPlugin.java
1
请完成以下Java代码
protected void validateFieldDeclarationsForShell( org.activiti.bpmn.model.Process process, TaskWithFieldExtensions task, List<FieldExtension> fieldExtensions, List<ValidationError> errors ) { boolean shellCommandDefined = false; for (FieldExtension fieldExtension : fieldExtensions) { String fieldName = fieldExtension.getFieldName(); String fieldValue = fieldExtension.getStringValue(); if (fieldName.equals("command")) { shellCommandDefined = true; } if ( (fieldName.equals("wait") || fieldName.equals("redirectError") || fieldName.equals("cleanEnv")) && !fieldValue.toLowerCase().equals("true") && !fieldValue.toLowerCase().equals("false") ) { addError(errors, Problems.SHELL_TASK_INVALID_PARAM, process, task); } } if (!shellCommandDefined) { addError(errors, Problems.SHELL_TASK_NO_COMMAND, process, task); } } protected void validateFieldDeclarationsForDmn( org.activiti.bpmn.model.Process process, TaskWithFieldExtensions task, List<FieldExtension> fieldExtensions, List<ValidationError> errors
) { boolean keyDefined = false; for (FieldExtension fieldExtension : fieldExtensions) { String fieldName = fieldExtension.getFieldName(); String fieldValue = fieldExtension.getStringValue(); if (fieldName.equals("decisionTableReferenceKey") && fieldValue != null && fieldValue.length() > 0) { keyDefined = true; } } if (!keyDefined) { addError(errors, Problems.DMN_TASK_NO_KEY, process, task); } } }
repos\Activiti-develop\activiti-core\activiti-process-validation\src\main\java\org\activiti\validation\validator\impl\ExternalInvocationTaskValidator.java
1
请完成以下Java代码
public int getPOL_ID() { return get_ValueAsInt(COLUMNNAME_POL_ID); } @Override public void setProcessed (final boolean Processed) { set_Value (COLUMNNAME_Processed, Processed); } @Override 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); } @Override public void setSalesRep_ID (final int SalesRep_ID) { if (SalesRep_ID < 1) set_Value (COLUMNNAME_SalesRep_ID, null); else set_Value (COLUMNNAME_SalesRep_ID, SalesRep_ID); } @Override public int getSalesRep_ID() { return get_ValueAsInt(COLUMNNAME_SalesRep_ID); } @Override public void setShipper_BPartner_ID (final int Shipper_BPartner_ID) { if (Shipper_BPartner_ID < 1) set_Value (COLUMNNAME_Shipper_BPartner_ID, null); else set_Value (COLUMNNAME_Shipper_BPartner_ID, Shipper_BPartner_ID); } @Override public int getShipper_BPartner_ID() { return get_ValueAsInt(COLUMNNAME_Shipper_BPartner_ID); } @Override public void setShipper_Location_ID (final int Shipper_Location_ID)
{ if (Shipper_Location_ID < 1) set_Value (COLUMNNAME_Shipper_Location_ID, null); else set_Value (COLUMNNAME_Shipper_Location_ID, Shipper_Location_ID); } @Override public int getShipper_Location_ID() { return get_ValueAsInt(COLUMNNAME_Shipper_Location_ID); } @Override public void setTrackingID (final @Nullable java.lang.String TrackingID) { set_Value (COLUMNNAME_TrackingID, TrackingID); } @Override public java.lang.String getTrackingID() { return get_ValueAsString(COLUMNNAME_TrackingID); } @Override public void setVesselName (final @Nullable java.lang.String VesselName) { set_Value (COLUMNNAME_VesselName, VesselName); } @Override public java.lang.String getVesselName() { return get_ValueAsString(COLUMNNAME_VesselName); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\shipping\model\X_M_ShipperTransportation.java
1
请完成以下Java代码
protected <T> Set<T> asSet(T element, Set<T> elements){ Set<T> result = new HashSet<T>(); result.add(element); if (elements != null) { result.addAll(elements); } return result; } @Override public int hashCode() { return domElement.hashCode(); }
@Override public boolean equals(Object obj) { if(obj == null) { return false; } else if(obj == this) { return true; } else if(!(obj instanceof ModelElementInstanceImpl)) { return false; } else { ModelElementInstanceImpl other = (ModelElementInstanceImpl) obj; return other.domElement.equals(domElement); } } }
repos\camunda-bpm-platform-master\model-api\xml-model\src\main\java\org\camunda\bpm\model\xml\impl\instance\ModelElementInstanceImpl.java
1
请在Spring Boot框架中完成以下Java代码
public @Nullable InfluxApiVersion getApiVersion() { return this.apiVersion; } public void setApiVersion(@Nullable InfluxApiVersion apiVersion) { this.apiVersion = apiVersion; } public @Nullable String getOrg() { return this.org; } public void setOrg(@Nullable String org) { this.org = org; } public @Nullable String getBucket() {
return this.bucket; } public void setBucket(@Nullable String bucket) { this.bucket = bucket; } public @Nullable String getToken() { return this.token; } public void setToken(@Nullable String token) { this.token = token; } }
repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\influx\InfluxProperties.java
2
请完成以下Java代码
public String toString() { return MoreObjects.toStringHelper(this) .omitNullValues() .add("id", id) .add("caption", caption.getDefaultValue()) .toString(); } public String getCaption(final String adLanguage) { return caption.translate(adLanguage); } public String getDescription(final String adLanguage) { return description.translate(adLanguage); } public KPIField getGroupByField() { final KPIField groupByField = getGroupByFieldOrNull(); if (groupByField == null) { throw new IllegalStateException("KPI has no group by field defined"); } return groupByField; } @Nullable public KPIField getGroupByFieldOrNull() { return groupByField; } public boolean hasCompareOffset() { return compareOffset != null; } public Set<CtxName> getRequiredContextParameters() { if (elasticsearchDatasource != null)
{ return elasticsearchDatasource.getRequiredContextParameters(); } else if (sqlDatasource != null) { return sqlDatasource.getRequiredContextParameters(); } else { throw new AdempiereException("Unknown datasource type: " + datasourceType); } } public boolean isZoomToDetailsAvailable() { return sqlDatasource != null; } @NonNull public SQLDatasourceDescriptor getSqlDatasourceNotNull() { return Check.assumeNotNull(getSqlDatasource(), "Not an SQL data source: {}", this); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\kpi\descriptor\KPI.java
1
请完成以下Java代码
public JsonNode getAdditionalInfo() { return super.getAdditionalInfo(); } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("Asset [tenantId="); builder.append(tenantId); builder.append(", customerId="); builder.append(customerId); builder.append(", name="); builder.append(name); builder.append(", type="); builder.append(type);
builder.append(", label="); builder.append(label); builder.append(", assetProfileId="); builder.append(assetProfileId); builder.append(", additionalInfo="); builder.append(getAdditionalInfo()); builder.append(", createdTime="); builder.append(createdTime); builder.append(", id="); builder.append(id); builder.append("]"); return builder.toString(); } }
repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\asset\Asset.java
1
请完成以下Java代码
class FtpClient { private final String server; private final int port; private final String user; private final String password; private FTPClient ftp; FtpClient(String server, int port, String user, String password) { this.server = server; this.port = port; this.user = user; this.password = password; } void open() throws IOException { ftp = new FTPClient(); ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out))); ftp.connect(server, port); int reply = ftp.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { ftp.disconnect(); throw new IOException("Exception in connecting to FTP Server"); } ftp.login(user, password); }
void close() throws IOException { ftp.disconnect(); } Collection<String> listFiles(String path) throws IOException { FTPFile[] files = ftp.listFiles(path); return Arrays.stream(files) .map(FTPFile::getName) .collect(Collectors.toList()); } void putFileToPath(File file, String path) throws IOException { ftp.storeFile(path, new FileInputStream(file)); } void downloadFile(String source, String destination) throws IOException { FileOutputStream out = new FileOutputStream(destination); ftp.retrieveFile(source, out); out.close(); } }
repos\tutorials-master\libraries-apache-commons-2\src\main\java\com\baeldung\commons\ftp\FtpClient.java
1
请完成以下Java代码
public int getPP_Product_BOMLine_ID() { return get_ValueAsInt(COLUMNNAME_PP_Product_BOMLine_ID); } @Override public void setQtyBOM (final @Nullable BigDecimal QtyBOM) { set_Value (COLUMNNAME_QtyBOM, QtyBOM); } @Override public BigDecimal getQtyBOM() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyBOM); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setScrap (final @Nullable BigDecimal Scrap) { set_Value (COLUMNNAME_Scrap, Scrap); } @Override public BigDecimal getScrap() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Scrap); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setSeqNo (final int SeqNo) { set_Value (COLUMNNAME_SeqNo, SeqNo); } @Override public int getSeqNo() { return get_ValueAsInt(COLUMNNAME_SeqNo); } @Override public void setTM_Product_ID (final int TM_Product_ID) { if (TM_Product_ID < 1) set_Value (COLUMNNAME_TM_Product_ID, null); else set_Value (COLUMNNAME_TM_Product_ID, TM_Product_ID); } @Override
public int getTM_Product_ID() { return get_ValueAsInt(COLUMNNAME_TM_Product_ID); } @Override public void setValidFrom (final @Nullable java.sql.Timestamp ValidFrom) { set_Value (COLUMNNAME_ValidFrom, ValidFrom); } @Override public java.sql.Timestamp getValidFrom() { return get_ValueAsTimestamp(COLUMNNAME_ValidFrom); } @Override public void setValidTo (final @Nullable java.sql.Timestamp ValidTo) { set_Value (COLUMNNAME_ValidTo, ValidTo); } @Override public java.sql.Timestamp getValidTo() { return get_ValueAsTimestamp(COLUMNNAME_ValidTo); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_RV_PP_Cost_BOMLine.java
1
请完成以下Java代码
public IQueryFilter<I_M_HU> createHUsNotAssignedToShipmentsFilter(final IContextAware contextProvider) { final int inoutLineTableId = tableDAO.retrieveTableId(org.compiere.model.I_M_InOutLine.Table_Name); final IQuery<I_M_InOut> queryShipments = queryBL.createQueryBuilder(I_M_InOut.class, contextProvider) .addEqualsFilter(I_M_InOut.COLUMNNAME_IsSOTrx, true) .create(); final IQuery<I_M_InOutLine> queryShipmentLines = queryBL.createQueryBuilder(I_M_InOutLine.class, contextProvider) .addInSubQueryFilter(org.compiere.model.I_M_InOutLine.COLUMNNAME_M_InOut_ID, I_M_InOut.COLUMNNAME_M_InOut_ID, queryShipments) .create(); final IQuery<I_M_HU_Assignment> queryHUAssignments = queryBL.createQueryBuilder(I_M_HU_Assignment.class, contextProvider) .addEqualsFilter(I_M_HU_Assignment.COLUMNNAME_AD_Table_ID, inoutLineTableId) .addInSubQueryFilter(I_M_HU_Assignment.COLUMNNAME_Record_ID, org.compiere.model.I_M_InOutLine.COLUMNNAME_M_InOutLine_ID, queryShipmentLines) .create(); final IQueryFilter<I_M_HU> assignedQueryFilter = InSubQueryFilter.of(I_M_HU.COLUMN_M_HU_ID, I_M_HU_Assignment.COLUMNNAME_M_HU_ID, queryHUAssignments); return NotQueryFilter.of(assignedQueryFilter); } private void setHUStatus(final IHUContext huContext, final I_M_HU hu, final boolean shipped) { // // HU was shipped if (shipped) { // Change HU's status to Shipped // task 07617: Note: the HU context is not needed here, because the status Shipped // does not trigger a movement to/from the gebindelager // Calling this method with huContext null // To Be Changed in case the requirements change huStatusBL.setHUStatus(huContext, hu, X_M_HU.HUSTATUS_Shipped); hu.setIsActive(false); // deactivate it because it shall not be available in our system anymore
} // // HU was not shipped (i.e. it was shipped before shipment was reversed) else { huStatusBL.setHUStatus(huContext, hu, X_M_HU.HUSTATUS_Active); hu.setIsActive(true); final I_M_Locator locator = InterfaceWrapperHelper.create(warehouseBL.getLocatorByRepoId(hu.getM_Locator_ID()), I_M_Locator.class); if (locator.isAfterPickingLocator()) { final WarehouseId warehouseId = WarehouseId.ofRepoId(locator.getM_Warehouse_ID()); // Restore default locator hu.setM_Locator_ID(warehouseBL.getOrCreateDefaultLocatorId(warehouseId).getRepoId()); } } handlingUnitsDAO.saveHU(hu); } @NonNull public List<I_M_ShipmentSchedule_QtyPicked> retrieveAssignedQuantities(@NonNull final I_M_InOut shipment) { final List<I_M_InOutLine> lines = inOutDAO.retrieveLines(shipment, I_M_InOutLine.class); return lines .stream() .map(line -> shipmentScheduleAllocDAO.retrieveAllForInOutLine(line, I_M_ShipmentSchedule_QtyPicked.class)) .flatMap(List::stream) .collect(ImmutableList.toImmutableList()); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inout\impl\HUShipmentAssignmentBL.java
1
请完成以下Java代码
public final class ProductClassifier { public static ProductClassifier any() { return ANY; } public static ProductClassifier specific(final int productId) { Check.assumeGreaterThanZero(productId, "productId"); return new ProductClassifier(productId); } private static final ProductClassifier ANY = new ProductClassifier(-1); private int productId; private ProductClassifier(final int productId) { this.productId = productId > 0 ? productId : -1; } @Override
public String toString() { return MoreObjects.toStringHelper(this) .addValue(productId > 0 ? productId : "ANY") .toString(); } public boolean isMatching(@Nullable final int productId) { return this.productId <= 0 || this.productId == productId; } public boolean isAny() { return this.productId <= 0; } public int getProductId() { return productId; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.material\commons\src\main\java\de\metas\material\commons\attributes\clasifiers\ProductClassifier.java
1
请在Spring Boot框架中完成以下Java代码
static BeanMetadataElement getLogoutResponseResolver(Element element, BeanMetadataElement registrations) { String logoutResponseResolver = element.getAttribute(ATT_LOGOUT_RESPONSE_RESOLVER_REF); if (StringUtils.hasText(logoutResponseResolver)) { return new RuntimeBeanReference(logoutResponseResolver); } if (USE_OPENSAML_5) { return BeanDefinitionBuilder.rootBeanDefinition(OpenSaml5LogoutResponseResolver.class) .addConstructorArgValue(registrations) .getBeanDefinition(); } throw new IllegalArgumentException( "Spring Security does not support OpenSAML " + Version.getVersion() + ". Please use OpenSAML 5"); } static BeanMetadataElement getLogoutRequestValidator(Element element) { String logoutRequestValidator = element.getAttribute(ATT_LOGOUT_REQUEST_VALIDATOR_REF); if (StringUtils.hasText(logoutRequestValidator)) { return new RuntimeBeanReference(logoutRequestValidator); } if (USE_OPENSAML_5) { return BeanDefinitionBuilder.rootBeanDefinition(OpenSaml5LogoutRequestValidator.class).getBeanDefinition(); } throw new IllegalArgumentException( "Spring Security does not support OpenSAML " + Version.getVersion() + ". Please use OpenSAML 5"); } static BeanMetadataElement getLogoutResponseValidator(Element element) { String logoutResponseValidator = element.getAttribute(ATT_LOGOUT_RESPONSE_VALIDATOR_REF); if (StringUtils.hasText(logoutResponseValidator)) { return new RuntimeBeanReference(logoutResponseValidator); } if (USE_OPENSAML_5) { return BeanDefinitionBuilder.rootBeanDefinition(OpenSaml5LogoutResponseValidator.class).getBeanDefinition(); } throw new IllegalArgumentException(
"Spring Security does not support OpenSAML " + Version.getVersion() + ". Please use OpenSAML 5"); } static BeanMetadataElement getLogoutRequestRepository(Element element) { String logoutRequestRepository = element.getAttribute(ATT_LOGOUT_REQUEST_REPOSITORY_REF); if (StringUtils.hasText(logoutRequestRepository)) { return new RuntimeBeanReference(logoutRequestRepository); } return BeanDefinitionBuilder.rootBeanDefinition(HttpSessionLogoutRequestRepository.class).getBeanDefinition(); } static BeanMetadataElement getLogoutRequestResolver(Element element, BeanMetadataElement registrations) { String logoutRequestResolver = element.getAttribute(ATT_LOGOUT_REQUEST_RESOLVER_REF); if (StringUtils.hasText(logoutRequestResolver)) { return new RuntimeBeanReference(logoutRequestResolver); } if (USE_OPENSAML_5) { return BeanDefinitionBuilder.rootBeanDefinition(OpenSaml5LogoutRequestResolver.class) .addConstructorArgValue(registrations) .getBeanDefinition(); } throw new IllegalArgumentException( "Spring Security does not support OpenSAML " + Version.getVersion() + ". Please use OpenSAML 5"); } }
repos\spring-security-main\config\src\main\java\org\springframework\security\config\http\Saml2LogoutBeanDefinitionParserUtils.java
2
请完成以下Java代码
default String getTokenEndpointAuthenticationMethod() { return getClaimAsString(OAuth2ClientMetadataClaimNames.TOKEN_ENDPOINT_AUTH_METHOD); } /** * Returns the OAuth 2.0 {@code grant_type} values that the Client will restrict * itself to using {@code (grant_types)}. * @return the OAuth 2.0 {@code grant_type} values that the Client will restrict * itself to using */ default List<String> getGrantTypes() { return getClaimAsStringList(OAuth2ClientMetadataClaimNames.GRANT_TYPES); } /** * Returns the OAuth 2.0 {@code response_type} values that the Client will restrict * itself to using {@code (response_types)}. * @return the OAuth 2.0 {@code response_type} values that the Client will restrict * itself to using */ default List<String> getResponseTypes() { return getClaimAsStringList(OAuth2ClientMetadataClaimNames.RESPONSE_TYPES); }
/** * Returns the OAuth 2.0 {@code scope} values that the Client will restrict itself to * using {@code (scope)}. * @return the OAuth 2.0 {@code scope} values that the Client will restrict itself to * using */ default List<String> getScopes() { return getClaimAsStringList(OAuth2ClientMetadataClaimNames.SCOPE); } /** * Returns the {@code URL} for the Client's JSON Web Key Set {@code (jwks_uri)}. * @return the {@code URL} for the Client's JSON Web Key Set {@code (jwks_uri)} */ default URL getJwkSetUrl() { return getClaimAsURL(OAuth2ClientMetadataClaimNames.JWKS_URI); } }
repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\OAuth2ClientMetadataClaimAccessor.java
1
请完成以下Java代码
public void invalidateJustForOrderLine(@NonNull final I_C_OrderLine orderLine) { final OrderLineId orderLineId = OrderLineId.ofRepoId(orderLine.getC_OrderLine_ID()); final ShipmentScheduleId shipmentScheduleId = shipmentSchedulePA.getShipmentScheduleIdByOrderLineId(orderLineId); if (shipmentScheduleId == null) { return; } flagForRecompute(shipmentScheduleId); } @Override public void flagForRecompute(@NonNull final ProductId productId) { invalidSchedulesRepo.invalidateForProduct(productId); } @Override public void flagHeaderAggregationKeysForRecompute(@NonNull final Set<String> headerAggregationKeys) { invalidSchedulesRepo.invalidateForHeaderAggregationKeys(headerAggregationKeys); } @Override public void notifySegmentChanged(@NonNull final IShipmentScheduleSegment segment) { notifySegmentsChanged(ImmutableSet.of(segment)); } @Override public void notifySegmentsChanged(@NonNull final Collection<IShipmentScheduleSegment> segments) { if (segments.isEmpty()) { return; } final ImmutableList<IShipmentScheduleSegment> segmentsEffective = segments.stream() .filter(segment -> !segment.isInvalid()) .flatMap(this::explodeByPickingBOMs) .collect(ImmutableList.toImmutableList()); if (segmentsEffective.isEmpty()) { return; } final ShipmentScheduleSegmentChangedProcessor collector = ShipmentScheduleSegmentChangedProcessor.getOrCreateIfThreadInheritedElseNull(this); if (collector != null) { collector.addSegments(segmentsEffective); // they will be flagged for recompute after commit } else
{ final ITaskExecutorService taskExecutorService = Services.get(ITaskExecutorService.class); taskExecutorService.submit( () -> flagSegmentForRecompute(segmentsEffective), this.getClass().getSimpleName()); } } private Stream<IShipmentScheduleSegment> explodeByPickingBOMs(final IShipmentScheduleSegment segment) { if (segment.isAnyProduct()) { return Stream.of(segment); } final PickingBOMsReversedIndex pickingBOMsReversedIndex = pickingBOMService.getPickingBOMsReversedIndex(); final Set<ProductId> componentIds = ProductId.ofRepoIds(segment.getProductIds()); final ImmutableSet<ProductId> pickingBOMProductIds = pickingBOMsReversedIndex.getBOMProductIdsByComponentIds(componentIds); if (pickingBOMProductIds.isEmpty()) { return Stream.of(segment); } final ImmutableShipmentScheduleSegment pickingBOMsSegment = ImmutableShipmentScheduleSegment.builder() .productIds(ProductId.toRepoIds(pickingBOMProductIds)) .anyBPartner() .locatorIds(segment.getLocatorIds()) .build(); return Stream.of(segment, pickingBOMsSegment); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\invalidation\impl\ShipmentScheduleInvalidateBL.java
1
请完成以下Java代码
public void setEMURate (java.math.BigDecimal EMURate) { set_Value (COLUMNNAME_EMURate, EMURate); } /** Get EMU Rate. @return Official rate to the Euro */ @Override public java.math.BigDecimal getEMURate () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_EMURate); if (bd == null) return Env.ZERO; return bd; } /** Set EMU Member. @param IsEMUMember This currency is member if the European Monetary Union */ @Override public void setIsEMUMember (boolean IsEMUMember) { set_Value (COLUMNNAME_IsEMUMember, Boolean.valueOf(IsEMUMember)); } /** Get EMU Member. @return This currency is member if the European Monetary Union */ @Override public boolean isEMUMember () { Object oo = get_Value(COLUMNNAME_IsEMUMember); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set The Euro Currency. @param IsEuro This currency is the Euro */ @Override public void setIsEuro (boolean IsEuro) { set_Value (COLUMNNAME_IsEuro, Boolean.valueOf(IsEuro)); } /** Get The Euro Currency. @return This currency is the Euro */ @Override public boolean isEuro () { Object oo = get_Value(COLUMNNAME_IsEuro); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set ISO Währungscode. @param ISO_Code Three letter ISO 4217 Code of the Currency */ @Override public void setISO_Code (java.lang.String ISO_Code) { set_Value (COLUMNNAME_ISO_Code, ISO_Code); } /** Get ISO Währungscode. @return Three letter ISO 4217 Code of the Currency
*/ @Override public java.lang.String getISO_Code () { return (java.lang.String)get_Value(COLUMNNAME_ISO_Code); } /** Set Round Off Factor. @param RoundOffFactor Used to Round Off Payment Amount */ @Override public void setRoundOffFactor (java.math.BigDecimal RoundOffFactor) { set_Value (COLUMNNAME_RoundOffFactor, RoundOffFactor); } /** Get Round Off Factor. @return Used to Round Off Payment Amount */ @Override public java.math.BigDecimal getRoundOffFactor () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_RoundOffFactor); if (bd == null) return Env.ZERO; return bd; } /** Set Standardgenauigkeit. @param StdPrecision Rule for rounding calculated amounts */ @Override public void setStdPrecision (int StdPrecision) { set_Value (COLUMNNAME_StdPrecision, Integer.valueOf(StdPrecision)); } /** Get Standardgenauigkeit. @return Rule for rounding calculated amounts */ @Override public int getStdPrecision () { Integer ii = (Integer)get_Value(COLUMNNAME_StdPrecision); if (ii == null) return 0; return ii.intValue(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Currency.java
1
请完成以下Java代码
public HuId getHUId() { return huId; } @Override public BPartnerId getBPartnerId() { return bpartnerId; } @Override public HuUnitType getHUUnitType() { return huUnitType; } @Override
public boolean isTopLevel() { return Services.get(IHandlingUnitsBL.class).isTopLevel(hu); } @Override public List<HUToReport> getIncludedHUs() { if (_includedHUs == null) { final IHandlingUnitsDAO handlingUnitsDAO = Services.get(IHandlingUnitsDAO.class); this._includedHUs = handlingUnitsDAO.retrieveIncludedHUs(hu) .stream() .map(HUToReportWrapper::of) .collect(ImmutableList.toImmutableList()); } return _includedHUs; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\report\HUToReportWrapper.java
1
请在Spring Boot框架中完成以下Java代码
public BatchDataManager getBatchDataManager() { return batchDataManager; } public BatchServiceConfiguration setBatchDataManager(BatchDataManager batchDataManager) { this.batchDataManager = batchDataManager; return this; } public BatchPartDataManager getBatchPartDataManager() { return batchPartDataManager; } public BatchServiceConfiguration setBatchPartDataManager(BatchPartDataManager batchPartDataManager) { this.batchPartDataManager = batchPartDataManager; return this; } public BatchEntityManager getBatchEntityManager() { return batchEntityManager; } public BatchServiceConfiguration setBatchEntityManager(BatchEntityManager batchEntityManager) { this.batchEntityManager = batchEntityManager; return this; }
public BatchPartEntityManager getBatchPartEntityManager() { return batchPartEntityManager; } public BatchServiceConfiguration setBatchPartEntityManager(BatchPartEntityManager batchPartEntityManager) { this.batchPartEntityManager = batchPartEntityManager; return this; } @Override public ObjectMapper getObjectMapper() { return objectMapper; } @Override public BatchServiceConfiguration setObjectMapper(ObjectMapper objectMapper) { this.objectMapper = objectMapper; return this; } }
repos\flowable-engine-main\modules\flowable-batch-service\src\main\java\org\flowable\batch\service\BatchServiceConfiguration.java
2
请完成以下Java代码
public <V extends ModelElementInstance> AttributeReferenceBuilder<V> idAttributeReference(Class<V> referenceTargetElement) { AttributeImpl<String> attribute = (AttributeImpl<String>) build(); AttributeReferenceBuilderImpl<V> referenceBuilder = new AttributeReferenceBuilderImpl<V>(attribute, referenceTargetElement); setAttributeReference(referenceBuilder); return referenceBuilder; } @SuppressWarnings("rawtypes") public <V extends ModelElementInstance> AttributeReferenceCollectionBuilder<V> idAttributeReferenceCollection(Class<V> referenceTargetElement, Class<? extends AttributeReferenceCollection> attributeReferenceCollection) { AttributeImpl<String> attribute = (AttributeImpl<String>) build(); AttributeReferenceCollectionBuilder<V> referenceBuilder = new AttributeReferenceCollectionBuilderImpl<V>(attribute, referenceTargetElement, attributeReferenceCollection); setAttributeReference(referenceBuilder); return referenceBuilder; } protected <V extends ModelElementInstance> void setAttributeReference(AttributeReferenceBuilder<V> referenceBuilder) {
if (this.referenceBuilder != null) { throw new ModelException("An attribute cannot have more than one reference"); } this.referenceBuilder = referenceBuilder; } @Override public void performModelBuild(Model model) { super.performModelBuild(model); if (referenceBuilder != null) { ((ModelBuildOperation) referenceBuilder).performModelBuild(model); } } }
repos\camunda-bpm-platform-master\model-api\xml-model\src\main\java\org\camunda\bpm\model\xml\impl\type\attribute\StringAttributeBuilderImpl.java
1
请完成以下Java代码
public <T> void addListItem(PropertyListKey<T> property, T value) { List<T> list = get(property); list.add(value); if (!contains(property)) { set(property, list); } } /** * Insert the value to the map to which the specified property key is mapped. If * this properties contains no mapping for the property key, the value insert to * a new map witch is associate the the specified property key. * * @param <K> * the type of keys maintained by the map * @param <V> * the type of mapped values * @param property * the property key whose associated list is to be added * @param value * the value to be appended to list */ public <K, V> void putMapEntry(PropertyMapKey<K, V> property, K key, V value) { Map<K, V> map = get(property); if (!property.allowsOverwrite() && map.containsKey(key)) { throw new ProcessEngineException("Cannot overwrite property key " + key + ". Key already exists"); } map.put(key, value); if (!contains(property)) { set(property, map); } } /** * Returns <code>true</code> if this properties contains a mapping for the specified property key. * * @param property * the property key whose presence is to be tested * @return <code>true</code> if this properties contains a mapping for the specified property key
*/ public boolean contains(PropertyKey<?> property) { return properties.containsKey(property.getName()); } /** * Returns <code>true</code> if this properties contains a mapping for the specified property key. * * @param property * the property key whose presence is to be tested * @return <code>true</code> if this properties contains a mapping for the specified property key */ public boolean contains(PropertyListKey<?> property) { return properties.containsKey(property.getName()); } /** * Returns <code>true</code> if this properties contains a mapping for the specified property key. * * @param property * the property key whose presence is to be tested * @return <code>true</code> if this properties contains a mapping for the specified property key */ public boolean contains(PropertyMapKey<?, ?> property) { return properties.containsKey(property.getName()); } /** * Returns a map view of this properties. Changes to the map are not reflected * to the properties. * * @return a map view of this properties */ public Map<String, Object> toMap() { return new HashMap<String, Object>(properties); } @Override public String toString() { return "Properties [properties=" + properties + "]"; } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\core\model\Properties.java
1
请完成以下Java代码
public String getBankReferenz() { return bankReferenz; } public void setBankReferenz(String bankReferenz) { this.bankReferenz = bankReferenz; } public BigDecimal getUrsprungsbetrag() { return ursprungsbetrag; } public void setUrsprungsbetrag(BigDecimal ursprungsbetrag) { this.ursprungsbetrag = ursprungsbetrag; } public String getUrsprungsbetragWaehrung() { return ursprungsbetragWaehrung; } public void setUrsprungsbetragWaehrung(String ursprungsbetragWaehrung) { this.ursprungsbetragWaehrung = ursprungsbetragWaehrung; } public BigDecimal getGebuehrenbetrag() { return gebuehrenbetrag; } public void setGebuehrenbetrag(BigDecimal gebuehrenbetrag) { this.gebuehrenbetrag = gebuehrenbetrag; } public String getGebuehrenbetragWaehrung() { return gebuehrenbetragWaehrung; } public void setGebuehrenbetragWaehrung(String gebuehrenbetragWaehrung) { this.gebuehrenbetragWaehrung = gebuehrenbetragWaehrung; } public String getMehrzweckfeld() { return mehrzweckfeld; } public void setMehrzweckfeld(String mehrzweckfeld) { this.mehrzweckfeld = mehrzweckfeld; } public BigInteger getGeschaeftsvorfallCode() { return geschaeftsvorfallCode; } public void setGeschaeftsvorfallCode(BigInteger geschaeftsvorfallCode) { this.geschaeftsvorfallCode = geschaeftsvorfallCode; }
public String getBuchungstext() { return buchungstext; } public void setBuchungstext(String buchungstext) { this.buchungstext = buchungstext; } public String getPrimanotennummer() { return primanotennummer; } public void setPrimanotennummer(String primanotennummer) { this.primanotennummer = primanotennummer; } public String getVerwendungszweck() { return verwendungszweck; } public void setVerwendungszweck(String verwendungszweck) { this.verwendungszweck = verwendungszweck; } public String getPartnerBlz() { return partnerBlz; } public void setPartnerBlz(String partnerBlz) { this.partnerBlz = partnerBlz; } public String getPartnerKtoNr() { return partnerKtoNr; } public void setPartnerKtoNr(String partnerKtoNr) { this.partnerKtoNr = partnerKtoNr; } public String getPartnerName() { return partnerName; } public void setPartnerName(String partnerName) { this.partnerName = partnerName; } public String getTextschluessel() { return textschluessel; } public void setTextschluessel(String textschluessel) { this.textschluessel = textschluessel; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\schaeffer\compiere\mt940\BankstatementLine.java
1
请在Spring Boot框架中完成以下Java代码
public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) @JsonApiId private Long id; private String username; private String email; @ManyToMany(fetch = FetchType.EAGER) @JoinTable(name = "users_roles", joinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "role_id", referencedColumnName = "id")) @JsonApiRelation(serialize=SerializeType.EAGER) private Set<Role> roles; public User() { super(); } public User(String username, String email) { super(); this.username = username; this.email = email; } public Long getId() { return id; } public void setId(final Long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getEmail() { return email; } public void setEmail(final String email) { this.email = email; } public Set<Role> getRoles() { return roles; } public void setRoles(Set<Role> roles) { this.roles = roles; } @Override public int hashCode() {
final int prime = 31; int result = 1; result = prime * result + (email == null ? 0 : email.hashCode()); return result; } @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final User user = (User) obj; if (!email.equals(user.email)) { return false; } return true; } @Override public String toString() { final StringBuilder builder = new StringBuilder(); builder.append("User [id=").append(id).append(", username=").append(username).append(", email=").append(email).append(", roles=").append(roles).append("]"); return builder.toString(); } }
repos\tutorials-master\spring-katharsis\src\main\java\com\baeldung\persistence\model\User.java
2
请完成以下Java代码
public AvailabilityInfoResultForWebui retrieveAvailableStock(@NonNull final AvailableForSalesMultiQuery query) { final AvailableForSalesLookupResult commonsAvailableStock = availableForSalesRepository.retrieveAvailableStock(query); final AvailabilityInfoResultForWebuiBuilder clientResultBuilder = AvailabilityInfoResultForWebui.builder(); for (final AvailableForSalesLookupBucketResult commonsResultGroup : commonsAvailableStock.getAvailableForSalesResults()) { final AvailabilityInfoResultForWebui.Group clientResultGroup = createClientResultGroup(commonsResultGroup); clientResultBuilder.group(clientResultGroup); } return clientResultBuilder.build(); } private AvailabilityInfoResultForWebui.Group createClientResultGroup(@NonNull final AvailableForSalesLookupBucketResult commonsResultGroup) { try { return createClientResultGroup0(commonsResultGroup); } catch (final RuntimeException e) { throw AdempiereException.wrapIfNeeded(e).appendParametersToMessage() .setParameter("commonsResultGroup", commonsResultGroup); } } private AvailabilityInfoResultForWebui.Group createClientResultGroup0(final AvailableForSalesLookupBucketResult commonsResultGroup) { final Quantity quantity = extractQuantity(commonsResultGroup); final AttributesKeyPattern attributesKey = AttributesKeyPatternsUtil.ofAttributeKey(commonsResultGroup.getStorageAttributesKey()); final AvailabilityInfoResultForWebui.Group.Type type = extractGroupType(attributesKey); final ImmutableAttributeSet attributes = AvailabilityInfoResultForWebui.Group.Type.ATTRIBUTE_SET.equals(type) ? AttributesKeys.toImmutableAttributeSet(commonsResultGroup.getStorageAttributesKey())
: ImmutableAttributeSet.EMPTY; return AvailabilityInfoResultForWebui.Group.builder() .productId(commonsResultGroup.getProductId()) .qty(quantity) .type(type) .attributes(attributes) .build(); } private Quantity extractQuantity(final AvailableForSalesLookupBucketResult commonsResultGroup) { final AvailableForSalesLookupBucketResult.Quantities quantities = commonsResultGroup.getQuantities(); final BigDecimal qty = quantities.getQtyOnHandStock().subtract(quantities.getQtyToBeShipped()); final I_C_UOM uom = productsService.getStockUOM(commonsResultGroup.getProductId()); return Quantity.of(qty, uom); } public Set<AttributesKeyPattern> getPredefinedStorageAttributeKeys() { return availableForSalesRepository.getPredefinedStorageAttributeKeys(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\material\adapter\AvailableForSaleAdapter.java
1
请完成以下Java代码
public void setIsAmount (boolean IsAmount) { set_Value (COLUMNNAME_IsAmount, Boolean.valueOf(IsAmount)); } /** Get Betragsgrenze. @return Send invoices only if the amount exceeds the limit IMPORTANT: currently not used; */ @Override public boolean isAmount () { Object oo = get_Value(COLUMNNAME_IsAmount); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Standard. @param IsDefault Default value */ @Override public void setIsDefault (boolean IsDefault) { set_Value (COLUMNNAME_IsDefault, Boolean.valueOf(IsDefault)); } /** Get Standard. @return Default value */
@Override public boolean isDefault () { Object oo = get_Value(COLUMNNAME_IsDefault); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Name. @param Name Alphanumeric identifier of the entity */ @Override public void setName (java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ @Override public java.lang.String getName () { return (java.lang.String)get_Value(COLUMNNAME_Name); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_InvoiceSchedule.java
1
请完成以下Java代码
public String getOwner() { return owner; } public void setOwner(String owner) { this.owner = owner; } public Date getResponsedTime() { return responsedTime; } public void setResponsedTime(Date responsedTime) { this.responsedTime = responsedTime; } public String getResponsedBy() { return responsedBy; } public void setResponsedBy(String responsedBy) { this.responsedBy = responsedBy; } public Date getResolvedTime() { return resolvedTime; } public void setResolvedTime(Date resolvedTime) { this.resolvedTime = resolvedTime; } public String getResolvedBy() { return resolvedBy; } public void setResolvedBy(String resolvedBy) { this.resolvedBy = resolvedBy; } public Date getClosedTime() { return closedTime; } public void setClosedTime(Date closedTime) { this.closedTime = closedTime; } public String getClosedBy() { return closedBy; } public void setClosedBy(String closedBy) { this.closedBy = closedBy; }
@Override public String toString() { return "Event{" + "id=" + id + ", rawEventId=" + rawEventId + ", host=" + host + ", ip=" + ip + ", source=" + source + ", type=" + type + ", startTime=" + startTime + ", endTime=" + endTime + ", content=" + content + ", dataType=" + dataType + ", suggest=" + suggest + ", businessSystemId=" + businessSystemId + ", departmentId=" + departmentId + ", status=" + status + ", occurCount=" + occurCount + ", owner=" + owner + ", responsedTime=" + responsedTime + ", responsedBy=" + responsedBy + ", resolvedTime=" + resolvedTime + ", resolvedBy=" + resolvedBy + ", closedTime=" + closedTime + ", closedBy=" + closedBy + '}'; } }
repos\springBoot-master\springboot-shiro\src\main\java\com\us\bean\Event.java
1
请完成以下Java代码
public void setM_Picking_Job_Step_ID (final int M_Picking_Job_Step_ID) { if (M_Picking_Job_Step_ID < 1) set_Value (COLUMNNAME_M_Picking_Job_Step_ID, null); else set_Value (COLUMNNAME_M_Picking_Job_Step_ID, M_Picking_Job_Step_ID); } @Override public int getM_Picking_Job_Step_ID() { return get_ValueAsInt(COLUMNNAME_M_Picking_Job_Step_ID); } @Override public void setQtyReserved (final BigDecimal QtyReserved) { set_Value (COLUMNNAME_QtyReserved, QtyReserved); } @Override public BigDecimal getQtyReserved() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyReserved); return bd != null ? bd : BigDecimal.ZERO; }
@Override public de.metas.handlingunits.model.I_M_HU getVHU() { return get_ValueAsPO(COLUMNNAME_VHU_ID, de.metas.handlingunits.model.I_M_HU.class); } @Override public void setVHU(final de.metas.handlingunits.model.I_M_HU VHU) { set_ValueFromPO(COLUMNNAME_VHU_ID, de.metas.handlingunits.model.I_M_HU.class, VHU); } @Override public void setVHU_ID (final int VHU_ID) { if (VHU_ID < 1) set_Value (COLUMNNAME_VHU_ID, null); else set_Value (COLUMNNAME_VHU_ID, VHU_ID); } @Override public int getVHU_ID() { return get_ValueAsInt(COLUMNNAME_VHU_ID); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Reservation.java
1
请完成以下Java代码
public class VariableDefinition { private String id; private String name; private String description; private String type; private boolean required; private Boolean display; private String displayName; private boolean analytics; private boolean ephemeral; public String getId() { return id; } public String getName() { return name; } public String getDescription() { return description; } public String getType() { return type; } public boolean isRequired() { return required; } public Boolean getDisplay() { return display; } public String getDisplayName() { return displayName; } public void setId(String id) { this.id = id; } public void setName(String name) { this.name = name; } public void setDescription(String description) { this.description = description; } public void setType(String type) {
this.type = type; } public void setRequired(boolean required) { this.required = required; } public void setDisplay(Boolean display) { this.display = display; } public void setDisplayName(String displayName) { this.displayName = displayName; } public boolean isAnalytics() { return analytics; } public void setAnalytics(boolean analytics) { this.analytics = analytics; } public void setEphemeral(boolean ephemeral) { this.ephemeral = ephemeral; } public boolean isEphemeral() { return ephemeral; } }
repos\Activiti-develop\activiti-core-common\activiti-connector-model\src\main\java\org\activiti\core\common\model\connector\VariableDefinition.java
1
请完成以下Java代码
protected @NonNull Predicate<String> getRegionBeanName() { return this.regionBeanName; } /** * Returns the configured Spring Data {@link CrudRepository} adapted/wrapped as a {@link CacheLoader} * and used to load {@link Region} values on cache misses. * * @return the configured {@link CrudRepository} used to load {@link Region} values on cache misses. * @see org.springframework.data.repository.CrudRepository */ protected @NonNull CrudRepository<T, ID> getRepository() { return this.repository; } @Override @SuppressWarnings("unchecked") public void configure(String beanName, ClientRegionFactoryBean<?, ?> bean) { if (getRegionBeanName().test(beanName)) { bean.setCacheLoader(newRepositoryCacheLoader()); } } @Override @SuppressWarnings("unchecked") public void configure(String beanName, PeerRegionFactoryBean<?, ?> bean) {
if (getRegionBeanName().test(beanName)) { bean.setCacheLoader(newRepositoryCacheLoader()); } } /** * Constructs a new instance of {@link RepositoryCacheLoader} adapting the {@link CrudRepository} * as an instance of a {@link CacheLoader}. * * @return a new {@link RepositoryCacheLoader}. * @see org.springframework.geode.cache.RepositoryCacheLoader * @see org.springframework.data.repository.CrudRepository * @see org.apache.geode.cache.CacheLoader * @see #getRepository() */ @SuppressWarnings("rawtypes") protected RepositoryCacheLoader newRepositoryCacheLoader() { return new RepositoryCacheLoader<>(getRepository()); } }
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\cache\RepositoryCacheLoaderRegionConfigurer.java
1
请完成以下Java代码
public void init(final IModelValidationEngine engine) { CopyRecordFactory.enableForTableName(I_AD_Role.Table_Name); final IModelCacheService cachingService = Services.get(IModelCacheService.class); cachingService.createTableCacheConfigBuilder(I_AD_Role.class) .setEnabled(true) .setInitialCapacity(50) .setMaxCapacity(50) .setExpireMinutes(ITableCacheConfig.EXPIREMINUTES_Never) .setCacheMapType(CacheMapType.LRU) .setTrxLevel(TrxLevel.OutOfTransactionOnly) .register(); } @ModelChange(timings = { ModelValidator.TYPE_BEFORE_NEW, ModelValidator.TYPE_BEFORE_CHANGE }) public void beforeSave(final I_AD_Role role) { if (role.getAD_Client_ID() == Env.CTXVALUE_AD_Client_ID_System) { role.setUserLevel(X_AD_Role.USERLEVEL_System); } else if (role.getUserLevel().equals(X_AD_Role.USERLEVEL_System)) { throw new AdempiereException("@AccessTableNoUpdate@ @UserLevel@"); } } @ModelChange(timings = { ModelValidator.TYPE_AFTER_NEW, ModelValidator.TYPE_AFTER_CHANGE }) public void afterSave(final I_AD_Role role, final ModelChangeType changeType) { // services: final IRoleDAO roleDAO = Services.get(IRoleDAO.class); final RoleId roleId = RoleId.ofRepoId(role.getAD_Role_ID()); // // Automatically assign new role to SuperUser and to the user who created it.
if (changeType.isNew() && !InterfaceWrapperHelper.isCopying(role)) { // Add Role to SuperUser roleDAO.createUserRoleAssignmentIfMissing(UserId.METASFRESH, roleId); // Add Role to User which created this record final UserId createdByUserId = UserId.ofRepoId(role.getCreatedBy()); if (!createdByUserId.equals(UserId.METASFRESH)) { roleDAO.createUserRoleAssignmentIfMissing(createdByUserId, roleId); } } // // Update role access records final boolean userLevelChange = InterfaceWrapperHelper.isValueChanged(role, I_AD_Role.COLUMNNAME_UserLevel); final boolean notManual = !role.isManual(); if ((changeType.isNew() || userLevelChange) && notManual) { final UserId userId = UserId.ofRepoId(role.getUpdatedBy()); Services.get(IUserRolePermissionsDAO.class).updateAccessRecords(roleId, userId); } // // Reset the cached role permissions after the transaction is commited. // NOTE: not needed because it's performed automatically // Services.get(IUserRolePermissionsDAO.class).resetCacheAfterTrxCommit(); } // afterSave @ModelChange(timings = ModelValidator.TYPE_BEFORE_DELETE) public void deleteAccessRecords(final I_AD_Role role) { final RoleId roleId = RoleId.ofRepoId(role.getAD_Role_ID()); Services.get(IUserRolePermissionsDAO.class).deleteAccessRecords(roleId); } // afterDelete }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\model\interceptor\AD_Role.java
1
请完成以下Java代码
private IQuery<I_M_InOut_Cost> toSqlQuery(@NonNull final InOutCostQuery query) { final IQueryBuilder<I_M_InOut_Cost> queryBuilder = queryBL.createQueryBuilder(I_M_InOut_Cost.class) .setLimit(query.getLimit()) .addOnlyActiveRecordsFilter(); if (query.getBpartnerId() != null) { queryBuilder.addEqualsFilter(I_M_InOut_Cost.COLUMNNAME_C_BPartner_ID, query.getBpartnerId()); } if (query.getSoTrx() != null) { queryBuilder.addEqualsFilter(I_M_InOut_Cost.COLUMNNAME_IsSOTrx, query.getSoTrx().toBoolean()); } if (query.getOrderId() != null) { queryBuilder.addEqualsFilter(I_M_InOut_Cost.COLUMNNAME_C_Order_ID, query.getOrderId()); } if (query.getCostTypeId() != null) { queryBuilder.addEqualsFilter(I_M_InOut_Cost.COLUMNNAME_C_Cost_Type_ID, query.getCostTypeId()); } if (!query.isIncludeReversed()) { queryBuilder.addIsNull(I_M_InOut_Cost.COLUMNNAME_Reversal_ID); } if (query.isOnlyWithOpenAmountToInvoice()) { queryBuilder.addEqualsFilter(I_M_InOut_Cost.COLUMNNAME_IsInvoiced, false); } return queryBuilder.create(); } public void deleteAll(@NonNull final ImmutableList<InOutCost> inoutCosts) { if (inoutCosts.isEmpty()) { return;
} final ImmutableSet<InOutCostId> inoutCostIds = inoutCosts.stream().map(InOutCost::getId).collect(ImmutableSet.toImmutableSet()); if (inoutCostIds.isEmpty()) { return; } queryBL.createQueryBuilder(I_M_InOut_Cost.class) .addInArrayFilter(I_M_InOut_Cost.COLUMNNAME_M_InOut_Cost_ID, inoutCostIds) .create() .delete(); } public void updateInOutCostById(final InOutCostId inoutCostId, final Consumer<InOutCost> consumer) { final I_M_InOut_Cost record = InterfaceWrapperHelper.load(inoutCostId, I_M_InOut_Cost.class); final InOutCost inoutCost = fromRecord(record); consumer.accept(inoutCost); updateRecord(record, inoutCost); InterfaceWrapperHelper.save(record); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\costs\inout\InOutCostRepository.java
1
请完成以下Java代码
public void setMandatory (boolean mandatory) { m_mandatory = mandatory; setBackground(false); } // setMandatory /** * Is Field mandatory * @return true, if mandatory */ @Override public boolean isMandatory() { return m_mandatory; } // isMandatory /** * Enable Editor * @param rw true, if you can enter/select data */ @Override public void setReadWrite (boolean rw) { if (super.isEditable() != rw) super.setEditable (rw); setBackground(false); } // setEditable /** * Is it possible to edit * @return true, if editable */ @Override public boolean isReadWrite() { return super.isEditable(); } // isReadWrite /** * Set Background based on editable / mandatory / error * @param error if true, set background to error color, otherwise mandatory/editable */ @Override public void setBackground (boolean error) { if (error) setBackground(AdempierePLAF.getFieldBackground_Error()); else if (!isReadWrite()) setBackground(AdempierePLAF.getFieldBackground_Inactive()); else if (m_mandatory) setBackground(AdempierePLAF.getFieldBackground_Mandatory()); else setBackground(AdempierePLAF.getFieldBackground_Normal()); } // setBackground /** * Set Background * @param bg */ @Override public void setBackground (Color bg) {
if (bg.equals(getBackground())) return; super.setBackground(bg); } // setBackground /** * Set Editor to value * @param value value of the editor */ @Override public void setValue (Object value) { if (value == null) setText(""); else setText(value.toString()); } // setValue /** * Return Editor value * @return current value */ @Override public Object getValue() { return new String(super.getPassword()); } // getValue /** * Return Display Value * @return displayed String value */ @Override public String getDisplay() { return new String(super.getPassword()); } // getDisplay }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\swing\CPassword.java
1
请完成以下Java代码
public class FormDefinition { protected Expression formKey; // camunda form definition protected Expression camundaFormDefinitionKey; protected String camundaFormDefinitionBinding; protected Expression camundaFormDefinitionVersion; public Expression getFormKey() { return formKey; } public void setFormKey(Expression formKey) { this.formKey = formKey; } public Expression getCamundaFormDefinitionKey() { return camundaFormDefinitionKey; } public void setCamundaFormDefinitionKey(Expression camundaFormDefinitionKey) {
this.camundaFormDefinitionKey = camundaFormDefinitionKey; } public String getCamundaFormDefinitionBinding() { return camundaFormDefinitionBinding; } public void setCamundaFormDefinitionBinding(String camundaFormDefinitionBinding) { this.camundaFormDefinitionBinding = camundaFormDefinitionBinding; } public Expression getCamundaFormDefinitionVersion() { return camundaFormDefinitionVersion; } public void setCamundaFormDefinitionVersion(Expression camundaFormDefinitionVersion) { this.camundaFormDefinitionVersion = camundaFormDefinitionVersion; } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\form\FormDefinition.java
1
请在Spring Boot框架中完成以下Java代码
public static ServiceRepairProjectTaskId ofRepoId(final ProjectId projectId, final int repoId) { return new ServiceRepairProjectTaskId(projectId, repoId); } public static ServiceRepairProjectTaskId ofRepoId(final int projectRepoId, final int repoId) { return new ServiceRepairProjectTaskId(ProjectId.ofRepoId(projectRepoId), repoId); } @Nullable public static ServiceRepairProjectTaskId ofRepoIdOrNull(final int projectRepoId, final int repoId) { if (repoId <= 0) { return null; } final ProjectId projectId = ProjectId.ofRepoIdOrNull(projectRepoId); if (projectId == null) { return null; } return new ServiceRepairProjectTaskId(projectId, repoId); } @Nullable public static ServiceRepairProjectTaskId ofRepoIdOrNull(@Nullable final ProjectId projectId, final int repoId) { return projectId != null && repoId > 0 ? new ServiceRepairProjectTaskId(projectId, repoId) : null;
} public static int toRepoId(@Nullable final ServiceRepairProjectTaskId id) { return id != null ? id.getRepoId() : -1; } ProjectId projectId; int repoId; private ServiceRepairProjectTaskId(@NonNull final ProjectId projectId, final int repoId) { this.projectId = projectId; this.repoId = Check.assumeGreaterThanZero(repoId, "C_Project_Repair_Task_ID"); } public static boolean equals( @Nullable final ServiceRepairProjectTaskId id1, @Nullable final ServiceRepairProjectTaskId id2) { return Objects.equals(id1, id2); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.base\src\main\java\de\metas\servicerepair\project\model\ServiceRepairProjectTaskId.java
2
请完成以下Java代码
void operations_with_NaN_produce_NaN() { System.out.println("Operations with NaN produce NaN"); System.out.println("2 + NaN = " + (2 + Double.NaN)); System.out.println("2 - NaN = " + (2 - Double.NaN)); System.out.println("2 * NaN = " + (2 * Double.NaN)); System.out.println("2 / NaN = " + (2 / Double.NaN)); System.out.println(); } void assign_NaN_to_missing_values() { System.out.println("Assign NaN to Missing values"); double salaryRequired = Double.NaN; System.out.println(salaryRequired); System.out.println(); } void comparison_with_NaN() { System.out.println("Comparison with NaN"); final double NAN = Double.NaN; System.out.println("NaN == 1 = " + (NAN == 1)); System.out.println("NaN > 1 = " + (NAN > 1)); System.out.println("NaN < 1 = " + (NAN < 1)); System.out.println("NaN != 1 = " + (NAN != 1));
System.out.println("NaN == NaN = " + (NAN == NAN)); System.out.println("NaN > NaN = " + (NAN > NAN)); System.out.println("NaN < NaN = " + (NAN < NAN)); System.out.println("NaN != NaN = " + (NAN != NAN)); System.out.println(); } void check_if_a_value_is_NaN() { System.out.println("Check if a value is NaN"); double x = 1; System.out.println(x + " is NaN = " + (x != x)); System.out.println(x + " is NaN = " + (Double.isNaN(x))); x = Double.NaN; System.out.println(x + " is NaN = " + (x != x)); System.out.println(x + " is NaN = " + (Double.isNaN(x))); System.out.println(); } }
repos\tutorials-master\core-java-modules\core-java-numbers-2\src\main\java\com\baeldung\nan\NaNExample.java
1
请完成以下Java代码
public class DebeziumListener { private final Executor executor = Executors.newSingleThreadExecutor(); private final CustomerService customerService; private final DebeziumEngine<RecordChangeEvent<SourceRecord>> debeziumEngine; public DebeziumListener(Configuration customerConnectorConfiguration, CustomerService customerService) { this.debeziumEngine = DebeziumEngine.create(ChangeEventFormat.of(Connect.class)) .using(customerConnectorConfiguration.asProperties()) .notifying(this::handleChangeEvent) .build(); this.customerService = customerService; } private void handleChangeEvent(RecordChangeEvent<SourceRecord> sourceRecordRecordChangeEvent) { SourceRecord sourceRecord = sourceRecordRecordChangeEvent.record(); log.info("Key = '" + sourceRecord.key() + "' value = '" + sourceRecord.value() + "'"); Struct sourceRecordChangeValue= (Struct) sourceRecord.value(); if (sourceRecordChangeValue != null) { Operation operation = Operation.forCode((String) sourceRecordChangeValue.get(OPERATION)); if(operation != Operation.READ) { String record = operation == Operation.DELETE ? BEFORE : AFTER; // Handling Update & Insert operations. Struct struct = (Struct) sourceRecordChangeValue.get(record);
Map<String, Object> payload = struct.schema().fields().stream() .map(Field::name) .filter(fieldName -> struct.get(fieldName) != null) .map(fieldName -> Pair.of(fieldName, struct.get(fieldName))) .collect(toMap(Pair::getKey, Pair::getValue)); this.customerService.replicateData(payload, operation); log.info("Updated Data: {} with Operation: {}", payload, operation.name()); } } } @PostConstruct private void start() { this.executor.execute(debeziumEngine); } @PreDestroy private void stop() throws IOException { if (this.debeziumEngine != null) { this.debeziumEngine.close(); } } }
repos\tutorials-master\libraries-data-db\src\main\java\com\baeldung\libraries\debezium\listener\DebeziumListener.java
1
请在Spring Boot框架中完成以下Java代码
public CaseDefinitionQuery orderByCaseDefinitionId() { orderBy(CaseDefinitionQueryProperty.CASE_DEFINITION_ID); return this; } public CaseDefinitionQuery orderByCaseDefinitionVersion() { orderBy(CaseDefinitionQueryProperty.CASE_DEFINITION_VERSION); return this; } public CaseDefinitionQuery orderByCaseDefinitionName() { orderBy(CaseDefinitionQueryProperty.CASE_DEFINITION_NAME); return this; } public CaseDefinitionQuery orderByDeploymentId() { orderBy(CaseDefinitionQueryProperty.DEPLOYMENT_ID); return this; } public CaseDefinitionQuery orderByTenantId() { return orderBy(CaseDefinitionQueryProperty.TENANT_ID); } @Override protected boolean hasExcludingConditions() { return super.hasExcludingConditions() || CompareUtil.elementIsNotContainedInArray(id, ids); } //results //////////////////////////////////////////// @Override public long executeCount(CommandContext commandContext) { if (isCmmnEnabled(commandContext)) { checkQueryOk(); return commandContext .getCaseDefinitionManager() .findCaseDefinitionCountByQueryCriteria(this); } return 0; } @Override public List<CaseDefinition> executeList(CommandContext commandContext, Page page) { if (isCmmnEnabled(commandContext)) { checkQueryOk(); return commandContext .getCaseDefinitionManager() .findCaseDefinitionsByQueryCriteria(this, page); } return Collections.emptyList(); } @Override public void checkQueryOk() { super.checkQueryOk(); // latest() makes only sense when used with key() or keyLike() if (latest && ( (id != null) || (name != null) || (nameLike != null) || (version != null) || (deploymentId != null) ) ){ throw new NotValidException("Calling latest() can only be used in combination with key(String) and keyLike(String)"); } } private boolean isCmmnEnabled(CommandContext commandContext) { return commandContext .getProcessEngineConfiguration() .isCmmnEnabled(); } // getters //////////////////////////////////////////// public String getId() { return id; } public String[] getIds() { return ids; } public String getCategory() { return category; } public String getCategoryLike() { return categoryLike;
} public String getName() { return name; } public String getNameLike() { return nameLike; } public String getDeploymentId() { return deploymentId; } public String getKey() { return key; } public String getKeyLike() { return keyLike; } public String getResourceName() { return resourceName; } public String getResourceNameLike() { return resourceNameLike; } public Integer getVersion() { return version; } public boolean isLatest() { return latest; } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\entity\repository\CaseDefinitionQueryImpl.java
2
请完成以下Java代码
public final class ReservedHUsPolicy { public static final ReservedHUsPolicy CONSIDER_ALL = builder().vhuReservedStatus(OptionalBoolean.UNKNOWN).build(); public static final ReservedHUsPolicy CONSIDER_ONLY_NOT_RESERVED = builder().vhuReservedStatus(OptionalBoolean.FALSE).build(); public static ReservedHUsPolicy onlyNotReservedExceptVhuIds(@NonNull final Collection<HuId> vhuIdsToConsiderEvenIfReserved) { return vhuIdsToConsiderEvenIfReserved.isEmpty() ? CONSIDER_ONLY_NOT_RESERVED : builder().vhuReservedStatus(OptionalBoolean.FALSE).alwaysConsiderVhuIds(vhuIdsToConsiderEvenIfReserved).build(); } public static ReservedHUsPolicy onlyVHUIds(@NonNull final Collection<HuId> onlyVHUIds) { Check.assumeNotEmpty(onlyVHUIds, "onlyVHUIds shall not be empty"); return builder().vhuReservedStatus(OptionalBoolean.UNKNOWN).onlyConsiderVhuIds(onlyVHUIds).build(); } private final OptionalBoolean vhuReservedStatus; private final ImmutableSet<HuId> alwaysConsiderVhuIds; private final ImmutableSet<HuId> onlyConsiderVhuIds; @Builder private ReservedHUsPolicy( final OptionalBoolean vhuReservedStatus, @Nullable final Collection<HuId> alwaysConsiderVhuIds, @Nullable final Collection<HuId> onlyConsiderVhuIds) { this.vhuReservedStatus = vhuReservedStatus; this.alwaysConsiderVhuIds = alwaysConsiderVhuIds != null ? ImmutableSet.copyOf(alwaysConsiderVhuIds) : ImmutableSet.of(); this.onlyConsiderVhuIds = onlyConsiderVhuIds != null ? ImmutableSet.copyOf(onlyConsiderVhuIds) : ImmutableSet.of(); } public boolean isConsiderVHU(@NonNull final I_M_HU vhu) { final HuId vhuId = HuId.ofRepoId(vhu.getM_HU_ID()); if (!onlyConsiderVhuIds.isEmpty() && !onlyConsiderVhuIds.contains(vhuId))
{ return false; } if (alwaysConsiderVhuIds.contains(vhuId)) { return true; } return isHUReservedStatusMatches(vhu); } private boolean isHUReservedStatusMatches(@NonNull final I_M_HU vhu) { return vhuReservedStatus.isUnknown() || vhuReservedStatus.isTrue() == vhu.isReserved(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\transfer\ReservedHUsPolicy.java
1
请完成以下Java代码
default int getC_BP_Location_ID(final I_M_ShipmentSchedule sched) { return BPartnerLocationId.toRepoId(getBPartnerLocationId(sched)); } BPartnerLocationId getBPartnerLocationId(I_M_ShipmentSchedule sched); DocumentLocation getDocumentLocation(@NonNull I_M_ShipmentSchedule sched); /** * @deprecated please use {@link #getBPartnerContactId(I_M_ShipmentSchedule)} as this returns BAD data! */ @Deprecated I_AD_User getBPartnerContact(I_M_ShipmentSchedule sched); @Nullable BPartnerContactId getBPartnerContactId(@NonNull I_M_ShipmentSchedule sched);
/** * @return the effective {@code QtyOrdered}. Where it's coming from is determined from different values and flags of the given {@code sched}. */ BigDecimal computeQtyOrdered(@NonNull I_M_ShipmentSchedule sched); /** * Get the delivery date effective based on DeliveryDate and DeliveryDate_Override */ ZonedDateTime getDeliveryDate(I_M_ShipmentSchedule sched); /** * Get the preparation date effective based on PreparationDate and PreparationDate_Override. * If none of them is set, try to fallback to the given {@code sched}'s order's preparation date. If the order has no proparation date, falls back to the order's promised date. * If the given {@code sched} doesn't have an order, return the current time., */ ZonedDateTime getPreparationDate(@NonNull I_M_ShipmentSchedule sched); }
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\api\IShipmentScheduleEffectiveBL.java
1
请在Spring Boot框架中完成以下Java代码
public Object getPrincipal() { return null; } /** * Get the resolved {@link RelyingPartyRegistration} associated with the request * @return the resolved {@link RelyingPartyRegistration} * @since 5.4 */ public RelyingPartyRegistration getRelyingPartyRegistration() { return this.relyingPartyRegistration; } /** * Returns inflated and decoded XML representation of the SAML 2 Response * @return inflated and decoded XML representation of the SAML 2 Response */ public String getSaml2Response() { return this.saml2Response; } /** * @return false */ @Override public boolean isAuthenticated() { return false; } /** * The state of this object cannot be changed. Will always throw an exception
* @param authenticated ignored */ @Override public void setAuthenticated(boolean authenticated) { throw new IllegalArgumentException(); } /** * Returns the authentication request sent to the assertion party or {@code null} if * no authentication request is present * @return the authentication request sent to the assertion party * @since 5.6 */ public AbstractSaml2AuthenticationRequest getAuthenticationRequest() { return this.authenticationRequest; } }
repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\provider\service\authentication\Saml2AuthenticationToken.java
2
请完成以下Spring Boot application配置
# Make the application available at http://localhost:7070/authserver server: port: 7070 servlet: context-path: /authserver # Our certificate settings for enabling JWT tokens jwt: certificate: store: file: classpath:/certif
icate/mykeystore.jks password: abirkhan04 key: alias: myauthkey password: abirkhan04
repos\tutorials-master\spring-cloud-modules\spring-cloud-security\auth-server\src\main\resources\application.yml
2
请在Spring Boot框架中完成以下Java代码
public Boolean getIncludeProcessVariables() { return includeProcessVariables; } public void setIncludeProcessVariables(Boolean includeProcessVariables) { this.includeProcessVariables = includeProcessVariables; } public Collection<String> getIncludeProcessVariablesNames() { return includeProcessVariablesNames; } public void setIncludeProcessVariablesNames(Collection<String> includeProcessVariablesNames) { this.includeProcessVariablesNames = includeProcessVariablesNames; } @JsonTypeInfo(use = Id.CLASS, defaultImpl = QueryVariable.class) public List<QueryVariable> getVariables() { return variables; } public void setVariables(List<QueryVariable> variables) { this.variables = variables; } public String getCallbackId() { return callbackId; } public void setCallbackId(String callbackId) { this.callbackId = callbackId; } public String getCallbackType() { return callbackType; } public void setCallbackType(String callbackType) { this.callbackType = callbackType; } public String getParentCaseInstanceId() { return parentCaseInstanceId; } public void setParentCaseInstanceId(String parentCaseInstanceId) { this.parentCaseInstanceId = parentCaseInstanceId; } public Boolean getWithoutCallbackId() { return withoutCallbackId; } public void setWithoutCallbackId(Boolean withoutCallbackId) { this.withoutCallbackId = withoutCallbackId; } public String getTenantId() { return tenantId; } public void setTenantId(String tenantId) { this.tenantId = tenantId; } public String getTenantIdLike() { return tenantIdLike; } public void setTenantIdLike(String tenantIdLike) { this.tenantIdLike = tenantIdLike;
} public String getTenantIdLikeIgnoreCase() { return tenantIdLikeIgnoreCase; } public void setTenantIdLikeIgnoreCase(String tenantIdLikeIgnoreCase) { this.tenantIdLikeIgnoreCase = tenantIdLikeIgnoreCase; } public Boolean getWithoutTenantId() { return withoutTenantId; } public void setWithoutTenantId(Boolean withoutTenantId) { this.withoutTenantId = withoutTenantId; } public String getRootScopeId() { return rootScopeId; } public void setRootScopeId(String rootScopeId) { this.rootScopeId = rootScopeId; } public String getParentScopeId() { return parentScopeId; } public void setParentScopeId(String parentScopeId) { this.parentScopeId = parentScopeId; } public Set<String> getCallbackIds() { return callbackIds; } public void setCallbackIds(Set<String> callbackIds) { this.callbackIds = callbackIds; } }
repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\history\HistoricProcessInstanceQueryRequest.java
2
请完成以下Java代码
public void setTransientVariables(Map<String, Object> transientVariables) { this.transientVariables = transientVariables; } public String getInitialActivityId() { return initialActivityId; } public void setInitialActivityId(String initialActivityId) { this.initialActivityId = initialActivityId; } public FlowElement getInitialFlowElement() { return initialFlowElement; } public void setInitialFlowElement(FlowElement initialFlowElement) { this.initialFlowElement = initialFlowElement; }
public Process getProcess() { return process; } public void setProcess(Process process) { this.process = process; } public ProcessDefinition getProcessDefinition() { return processDefinition; } public void setProcessDefinition(ProcessDefinition processDefinition) { this.processDefinition = processDefinition; } }
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\interceptor\AbstractStartProcessInstanceBeforeContext.java
1
请完成以下Java代码
public DocumentLineType1Choice getCdOrPrtry() { return cdOrPrtry; } /** * Sets the value of the cdOrPrtry property. * * @param value * allowed object is * {@link DocumentLineType1Choice } * */ public void setCdOrPrtry(DocumentLineType1Choice value) { this.cdOrPrtry = value; } /** * Gets the value of the issr property. * * @return * possible object is * {@link String } * */ public String getIssr() {
return issr; } /** * Sets the value of the issr property. * * @param value * allowed object is * {@link String } * */ public void setIssr(String value) { this.issr = value; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java-xjc_camt054_001_06\de\metas\payment\camt054_001_06\DocumentLineType1.java
1
请完成以下Java代码
public void setIncludeFinished(Boolean includeFinished) { this.includeFinished = includeFinished; } @CamundaQueryParam(value = "completeScope", converter = BooleanConverter.class) public void setIncludeCompleteScope(Boolean includeCompleteScope) { this.includeCompleteScope = includeCompleteScope; } @CamundaQueryParam(value = "incidents", converter = BooleanConverter.class) public void setIncludeIncidents(Boolean includeClosedIncidents) { this.includeIncidents = includeClosedIncidents; } @CamundaQueryParam(value = "startedAfter", converter = DateConverter.class) public void setStartedAfter(Date startedAfter) { this.startedAfter = startedAfter; } @CamundaQueryParam(value = "startedBefore", converter = DateConverter.class) public void setStartedBefore(Date startedBefore) { this.startedBefore = startedBefore; } @CamundaQueryParam(value = "finishedAfter", converter = DateConverter.class) public void setFinishedAfter(Date finishedAfter) { this.finishedAfter = finishedAfter; } @CamundaQueryParam(value = "finishedBefore", converter = DateConverter.class) public void setFinishedBefore(Date finishedBefore) { this.finishedBefore = finishedBefore; } @CamundaQueryParam(value = "processInstanceIdIn", converter = StringArrayConverter.class) public void setProcessInstanceIdIn(String[] processInstanceIdIn) { this.processInstanceIdIn = processInstanceIdIn; } @Override protected boolean isValidSortByValue(String value) { return SORT_ORDER_ACTIVITY_ID.equals(value); } @Override protected HistoricActivityStatisticsQuery createNewQuery(ProcessEngine engine) { return engine.getHistoryService().createHistoricActivityStatisticsQuery(processDefinitionId); } @Override protected void applyFilters(HistoricActivityStatisticsQuery query) {
if (includeCanceled != null && includeCanceled) { query.includeCanceled(); } if (includeFinished != null && includeFinished) { query.includeFinished(); } if (includeCompleteScope != null && includeCompleteScope) { query.includeCompleteScope(); } if (includeIncidents !=null && includeIncidents) { query.includeIncidents(); } if (startedAfter != null) { query.startedAfter(startedAfter); } if (startedBefore != null) { query.startedBefore(startedBefore); } if (finishedAfter != null) { query.finishedAfter(finishedAfter); } if (finishedBefore != null) { query.finishedBefore(finishedBefore); } if (processInstanceIdIn != null) { query.processInstanceIdIn(processInstanceIdIn); } } @Override protected void applySortBy(HistoricActivityStatisticsQuery query, String sortBy, Map<String, Object> parameters, ProcessEngine engine) { if (SORT_ORDER_ACTIVITY_ID.equals(sortBy)) { query.orderByActivityId(); } } }
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\history\HistoricActivityStatisticsQueryDto.java
1
请完成以下Java代码
public class DivisionDTO { public DivisionDTO() { } public DivisionDTO(int id, String name) { super(); this.id = id; this.name = name; } private int id; private String name; public int getId() {
return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
repos\tutorials-master\mapstruct\src\main\java\com\baeldung\dto\DivisionDTO.java
1
请完成以下Java代码
public IndentedStringBuilder incrementIndent() { return setIndent(indent + 1); } public IndentedStringBuilder decrementIndent() { return setIndent(indent - 1); } private IndentedStringBuilder setIndent(int indent) { Check.assume(indent >= 0, "indent >= 0"); this.indent = indent; this._linePrefix = null; // reset return this; } private final String getLinePrefix() { if (_linePrefix == null) { final int indent = getIndent(); final String token = getIndentToken(); final StringBuilder prefix = new StringBuilder(); for (int i = 1; i <= indent; i++) { prefix.append(token); } _linePrefix = prefix.toString(); } return _linePrefix; } public StringBuilder getInnerStringBuilder() { return sb; } @Override public String toString()
{ return sb.toString(); } public IndentedStringBuilder appendLine(final Object obj) { final String linePrefix = getLinePrefix(); sb.append(linePrefix).append(obj).append(getNewlineToken()); return this; } public IndentedStringBuilder append(final Object obj) { sb.append(obj); return this; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\text\IndentedStringBuilder.java
1
请完成以下Java代码
public <T> T evaluateSimpleExpression(String simpleExpression, VariableContext variableContext) { throw LOG.simpleExpressionNotSupported(); } public boolean evaluateSimpleUnaryTests(String simpleUnaryTests, String inputName, VariableContext variableContext) { try { ELContext elContext = createContext(variableContext); ValueExpression valueExpression = transformSimpleUnaryTests(simpleUnaryTests, inputName, elContext); return (Boolean) valueExpression.getValue(elContext); } catch (FeelMissingFunctionException e) { throw LOG.unknownFunction(simpleUnaryTests, e); } catch (FeelMissingVariableException e) { if (inputName.equals(e.getVariable())) { throw LOG.unableToEvaluateExpressionAsNotInputIsSet(simpleUnaryTests, e); } else { throw LOG.unknownVariable(simpleUnaryTests, e); } } catch (FeelConvertException e) { throw LOG.unableToConvertValue(simpleUnaryTests, e); } catch (ELException e) { if (e.getCause() instanceof FeelMethodInvocationException) { throw LOG.unableToInvokeMethod(simpleUnaryTests, (FeelMethodInvocationException) e.getCause()); } else { throw LOG.unableToEvaluateExpression(simpleUnaryTests, e); } } } protected ELContext createContext(VariableContext variableContext) { return elContextFactory.createContext(expressionFactory, variableContext); }
protected ValueExpression transformSimpleUnaryTests(String simpleUnaryTests, String inputName, ELContext elContext) { String juelExpression = transformToJuelExpression(simpleUnaryTests, inputName); try { return expressionFactory.createValueExpression(elContext, juelExpression, Object.class); } catch (ELException e) { throw LOG.invalidExpression(simpleUnaryTests, e); } } protected String transformToJuelExpression(String simpleUnaryTests, String inputName) { TransformExpressionCacheKey cacheKey = new TransformExpressionCacheKey(simpleUnaryTests, inputName); String juelExpression = transformExpressionCache.get(cacheKey); if (juelExpression == null) { juelExpression = transform.transformSimpleUnaryTests(simpleUnaryTests, inputName); transformExpressionCache.put(cacheKey, juelExpression); } return juelExpression; } }
repos\camunda-bpm-platform-master\engine-dmn\feel-juel\src\main\java\org\camunda\bpm\dmn\feel\impl\juel\FeelEngineImpl.java
1
请完成以下Java代码
public ViewHeaderProperties getHeaderProperties() { return headerProperties; } @Override public DocumentQueryOrderByList getDefaultOrderBys() { return rowsData.getOrderBys(); } @Override public boolean isAllowClosingPerUserRequest() { // don't allow closing per user request because the same view is used the Picker and the Reviewer. // So the first one which is closing the view would delete it. return false; } @Override public String getTableNameOrNull(final DocumentId documentId) { return null; } @Override public List<RelatedProcessDescriptor> getAdditionalRelatedProcessDescriptors() { return relatedProcessDescriptors; } public boolean isEligibleForReview() { if (size() == 0) { return false; } final boolean allApproved = streamByIds(DocumentIdsSelection.ALL).allMatch(ProductsToPickRow::isApproved); if (allApproved) { return false; }
return streamByIds(DocumentIdsSelection.ALL) .allMatch(ProductsToPickRow::isEligibleForReview); } public void updateViewRowFromPickingCandidate(@NonNull final DocumentId rowId, @NonNull final PickingCandidate pickingCandidate) { rowsData.updateViewRowFromPickingCandidate(rowId, pickingCandidate); } public boolean isApproved() { if (size() == 0) { return false; } return streamByIds(DocumentIdsSelection.ALL) .allMatch(ProductsToPickRow::isApproved); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pickingV2\productsToPick\ProductsToPickView.java
1
请完成以下Java代码
public int getRecord_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_Record_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Remote Addr. @param Remote_Addr Remote Address */ public void setRemote_Addr (String Remote_Addr) { set_Value (COLUMNNAME_Remote_Addr, Remote_Addr); } /** Get Remote Addr. @return Remote Address */ public String getRemote_Addr () { return (String)get_Value(COLUMNNAME_Remote_Addr); } /** Set Remote Host. @param Remote_Host Remote host Info */ public void setRemote_Host (String Remote_Host) { set_Value (COLUMNNAME_Remote_Host, Remote_Host); } /** Get Remote Host. @return Remote host Info */ public String getRemote_Host () { return (String)get_Value(COLUMNNAME_Remote_Host); } /** Set Reply. @param Reply Reply or Answer */ public void setReply (String Reply) { set_Value (COLUMNNAME_Reply, Reply); } /** Get Reply.
@return Reply or Answer */ public String getReply () { return (String)get_Value(COLUMNNAME_Reply); } /** Set Text Message. @param TextMsg Text Message */ public void setTextMsg (String TextMsg) { set_Value (COLUMNNAME_TextMsg, TextMsg); } /** Get Text Message. @return Text Message */ public String getTextMsg () { return (String)get_Value(COLUMNNAME_TextMsg); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_AccessLog.java
1
请在Spring Boot框架中完成以下Java代码
public void setId(String id) { this.id = id; } public void setKey(String key) { this.key = key; } public void setCategory(String category) { this.category = category; } public void setDescription(String description) { this.description = description; } public void setName(String name) { this.name = name; }
public void setVersion(int version) { this.version = version; } public void setResource(String resource) { this.resource = resource; } public void setDeploymentId(String deploymentId) { this.deploymentId = deploymentId; } public void setDiagram(String diagram) { this.diagram = diagram; } public void setSuspended(boolean suspended) { this.suspended = suspended; } }
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\repository\StubProcessDefinitionDto.java
2
请完成以下Java代码
public CaseFileItemDefinition getDefinitionRef() { return definitionRefAttribute.getReferenceTargetElement(this); } public void setDefinitionRef(CaseFileItemDefinition caseFileItemDefinition) { definitionRefAttribute.setReferenceTargetElement(this, caseFileItemDefinition); } public CaseFileItem getSourceRef() { return sourceRefAttribute.getReferenceTargetElement(this); } public void setSourceRef(CaseFileItem sourceRef) { sourceRefAttribute.setReferenceTargetElement(this, sourceRef); } public Collection<CaseFileItem> getSourceRefs() { return sourceRefCollection.getReferenceTargetElements(this); } public Collection<CaseFileItem> getTargetRefs() { return targetRefCollection.getReferenceTargetElements(this); } public Children getChildren() { return childrenChild.getChild(this); } public void setChildren(Children children) { childrenChild.setChild(this, children); } public static void registerType(ModelBuilder modelBuilder) { ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFileItem.class, CMMN_ELEMENT_CASE_FILE_ITEM) .namespaceUri(CMMN11_NS) .extendsType(CmmnElement.class) .instanceProvider(new ModelTypeInstanceProvider<CaseFileItem>() { public CaseFileItem newInstance(ModelTypeInstanceContext instanceContext) { return new CaseFileItemImpl(instanceContext); } }); nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) .build();
multiplicityAttribute = typeBuilder.enumAttribute(CMMN_ATTRIBUTE_MULTIPLICITY, MultiplicityEnum.class) .defaultValue(MultiplicityEnum.Unspecified) .build(); definitionRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_DEFINITION_REF) .qNameAttributeReference(CaseFileItemDefinition.class) .build(); sourceRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REF) .namespace(CMMN10_NS) .idAttributeReference(CaseFileItem.class) .build(); sourceRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REFS) .idAttributeReferenceCollection(CaseFileItem.class, CmmnAttributeElementReferenceCollection.class) .build(); targetRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TARGET_REFS) .idAttributeReferenceCollection(CaseFileItem.class, CmmnAttributeElementReferenceCollection.class) .build(); SequenceBuilder sequence = typeBuilder.sequence(); childrenChild = sequence.element(Children.class) .build(); typeBuilder.build(); } }
repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\CaseFileItemImpl.java
1
请完成以下Java代码
public static ModelCacheInvalidationTiming ofModelChangeType(@NonNull final ModelChangeType modelChangeType, final ModelCacheInvalidationTiming defaultValue) { switch (modelChangeType) { case BEFORE_NEW: return BEFORE_NEW; case AFTER_NEW: return AFTER_NEW; case BEFORE_CHANGE: return BEFORE_CHANGE; case AFTER_CHANGE: return AFTER_CHANGE; case BEFORE_DELETE: return defaultValue; case AFTER_DELETE: return AFTER_DELETE; case AFTER_NEW_REPLICATION: return defaultValue; case AFTER_CHANGE_REPLICATION: return defaultValue; case BEFORE_DELETE_REPLICATION: return defaultValue; case BEFORE_SAVE_TRX: return defaultValue; default:
return defaultValue; } } public boolean isBefore() {return this == BEFORE_NEW || this == BEFORE_CHANGE;} public boolean isAfter() {return !isBefore();} public boolean isNew() {return this == BEFORE_NEW || this == AFTER_NEW;} public boolean isAfterNew() {return this == AFTER_NEW;} public boolean isChange() {return this == BEFORE_CHANGE || this == AFTER_CHANGE;} public boolean isDelete() {return this == AFTER_DELETE;} public boolean isAfterDelete() {return this == AFTER_DELETE;} }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\model\ModelCacheInvalidationTiming.java
1
请完成以下Java代码
public DocStatus getOrderDocStatus() { return DocStatus.ofCode(getSalesOrderLine().getC_Order().getDocStatus()); } public I_M_ShipmentSchedule getSched() { return shipmentSchedule; } public ShipmentScheduleId getShipmentScheduleId() { return ShipmentScheduleId.ofRepoId(shipmentSchedule.getM_ShipmentSchedule_ID()); } /** * @return shipment schedule's QtyToDeliver_Override or <code>null</code> */ public BigDecimal getQtyOverride() { return InterfaceWrapperHelper.getValueOrNull(shipmentSchedule, I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliver_Override); } public BigDecimal getInitialSchedQtyDelivered() { return initialSchedQtyDelivered; } public void setShipmentScheduleLineNetAmt(final BigDecimal lineNetAmt) { shipmentSchedule.setLineNetAmt(lineNetAmt);
} @Nullable public String getSalesOrderPORef() { return salesOrder.map(I_C_Order::getPOReference).orElse(null); } @Nullable public InputDataSourceId getSalesOrderADInputDatasourceID() { if(!salesOrder.isPresent()) { return null; } final I_C_Order orderRecord = salesOrder.get(); return InputDataSourceId.ofRepoIdOrNull(orderRecord.getAD_InputDataSource_ID()); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\api\OlAndSched.java
1
请完成以下Java代码
protected void stopExecutingJobs() { // nothing to do } public void executeJobs(List<String> jobIds, ProcessEngineImpl processEngine) { final RuntimeContainerDelegate runtimeContainerDelegate = getRuntimeContainerDelegate(); final ExecutorService executorService = runtimeContainerDelegate.getExecutorService(); Runnable executeJobsRunnable = getExecuteJobsRunnable(jobIds, processEngine); // delegate job execution to runtime container if(!executorService.schedule(executeJobsRunnable, false)) { logRejectedExecution(processEngine, jobIds.size()); rejectedJobsHandler.jobsRejected(jobIds, processEngine, this); } if (executorService instanceof JmxManagedThreadPool) { int totalQueueCapacity = calculateTotalQueueCapacity(((JmxManagedThreadPool) executorService).getQueueCount(), ((JmxManagedThreadPool) executorService).getQueueAddlCapacity());
logJobExecutionInfo(processEngine, ((JmxManagedThreadPool) executorService).getQueueCount(), totalQueueCapacity, ((JmxManagedThreadPool) executorService).getMaximumPoolSize(), ((JmxManagedThreadPool) executorService).getActiveCount()); } } protected RuntimeContainerDelegate getRuntimeContainerDelegate() { return RuntimeContainerDelegate.INSTANCE.get(); } @Override public Runnable getExecuteJobsRunnable(List<String> jobIds, ProcessEngineImpl processEngine) { final RuntimeContainerDelegate runtimeContainerDelegate = getRuntimeContainerDelegate(); final ExecutorService executorService = runtimeContainerDelegate.getExecutorService(); return executorService.getExecuteJobsRunnable(jobIds, processEngine); } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\RuntimeContainerJobExecutor.java
1
请完成以下Java代码
public class DueDateBusinessCalendar implements BusinessCalendar { private final static EngineUtilLogger LOG = ProcessEngineLogger.UTIL_LOGGER; public static final String NAME = "dueDate"; public Date resolveDuedate(String duedate, Task task) { return resolveDuedate(duedate); } public Date resolveDuedate(String duedate) { return resolveDuedate(duedate, (Date)null); } public Date resolveDuedate(String duedate, Date startDate) { try { if (duedate.startsWith("P")){ DateTime start = null;
if (startDate == null) { start = DateTimeUtil.now(); } else { start = new DateTime(startDate); } return start.plus(ISOPeriodFormat.standard().parsePeriod(duedate)).toDate(); } return DateTimeUtil.parseDateTime(duedate).toDate(); } catch (Exception e) { throw LOG.exceptionWhileResolvingDuedate(duedate, e); } } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\calendar\DueDateBusinessCalendar.java
1
请完成以下Java代码
public I_C_UOM getC_UOM() { return null; } @Override public IAttributeValueCallout getAttributeValueCallout() { return NullAttributeValueCallout.instance; } @Override public IAttributeValueGenerator getAttributeValueGeneratorOrNull() { return null; } @Override public void removeAttributeValueListener(final IAttributeValueListener listener) { // nothing } @Override public boolean isReadonlyUI() { return true; } @Override public boolean isDisplayedUI() { return false; } @Override
public boolean isMandatory() { return false; } @Override public int getDisplaySeqNo() { return 0; } @Override public NamePair getNullAttributeValue() { return null; } /** * @return true; we consider Null attributes as always generated */ @Override public boolean isNew() { return true; } @Override public boolean isOnlyIfInProductAttributeSet() { return false; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\impl\NullAttributeValue.java
1
请在Spring Boot框架中完成以下Java代码
public class InMemoryOrderStore implements CustomerOrderRepository, ShippingOrderRepository { private Map<Integer, PersistenceOrder> ordersDb = new HashMap<>(); private volatile static InMemoryOrderStore instance = new InMemoryOrderStore(); @Override public void saveCustomerOrder(CustomerOrder order) { this.ordersDb.put(order.getOrderId(), new PersistenceOrder(order.getOrderId(), order.getPaymentMethod(), order.getAddress(), order .getOrderItems() .stream() .map(orderItem -> new PersistenceOrder.OrderItem(orderItem.getProductId(), orderItem.getQuantity(), orderItem.getUnitWeight(), orderItem.getUnitPrice())) .collect(Collectors.toList()) )); } @Override public Optional<ShippableOrder> findShippableOrder(int orderId) { if (!this.ordersDb.containsKey(orderId)) return Optional.empty(); PersistenceOrder orderRecord = this.ordersDb.get(orderId); return Optional.of( new ShippableOrder(orderRecord.orderId, orderRecord.orderItems .stream().map(orderItem -> new PackageItem(orderItem.productId, orderItem.itemWeight, orderItem.quantity * orderItem.unitPrice) ).collect(Collectors.toList()))); } public static InMemoryOrderStore provider() { return instance; } public static class PersistenceOrder {
public int orderId; public String paymentMethod; public String address; public List<OrderItem> orderItems; public PersistenceOrder(int orderId, String paymentMethod, String address, List<OrderItem> orderItems) { this.orderId = orderId; this.paymentMethod = paymentMethod; this.address = address; this.orderItems = orderItems; } public static class OrderItem { public int productId; public float unitPrice; public float itemWeight; public int quantity; public OrderItem(int productId, int quantity, float unitWeight, float unitPrice) { this.itemWeight = unitWeight; this.quantity = quantity; this.unitPrice = unitPrice; this.productId = productId; } } } }
repos\tutorials-master\patterns-modules\ddd-contexts\ddd-contexts-infrastructure\src\main\java\com\baeldung\dddcontexts\infrastructure\db\InMemoryOrderStore.java
2
请完成以下Java代码
public CompositeAggregationKeyBuilder<ModelType> addAggregationKeyBuilder(final IAggregationKeyBuilder<ModelType> aggregationKeyBuilder) { Check.assumeNotNull(aggregationKeyBuilder, "aggregationKeyBuilder not null"); if (!aggregationKeyBuilders.addIfAbsent(aggregationKeyBuilder)) { return this; } for (final String columnName : aggregationKeyBuilder.getDependsOnColumnNames()) { if (columnNames.contains(columnName)) { continue; } columnNames.add(columnName); } return this; } @Override public String getTableName() { return tableName; } @Override public List<String> getDependsOnColumnNames() { return columnNamesRO; } @Override public String buildKey(final ModelType model) { return buildAggregationKey(model) .getAggregationKeyString(); } @Override public AggregationKey buildAggregationKey(final ModelType model) { if (aggregationKeyBuilders.isEmpty()) { throw new AdempiereException("No aggregation key builders added"); } final List<String> keyParts = new ArrayList<>();
final Set<AggregationId> aggregationIds = new HashSet<>(); for (final IAggregationKeyBuilder<ModelType> aggregationKeyBuilder : aggregationKeyBuilders) { final AggregationKey keyPart = aggregationKeyBuilder.buildAggregationKey(model); keyParts.add(keyPart.getAggregationKeyString()); aggregationIds.add(keyPart.getAggregationId()); } final AggregationId aggregationId = CollectionUtils.singleElementOrDefault(aggregationIds, null); return new AggregationKey(Util.mkKey(keyParts.toArray()), aggregationId); } @Override public boolean isSame(final ModelType model1, final ModelType model2) { if (model1 == model2) { return true; } final String key1 = buildKey(model1); final String key2 = buildKey(model2); return Objects.equals(key1, key2); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.aggregation\src\main\java\de\metas\aggregation\api\CompositeAggregationKeyBuilder.java
1
请完成以下Java代码
public static MHRConcept[] getConcepts (int payroll_id, int department_id, int employee_id, String sqlWhere) { Properties ctx = Env.getCtx(); List<Object> params = new ArrayList<>(); StringBuffer whereClause = new StringBuffer(); whereClause.append("AD_Client_ID in (?,?)"); params.add(0); params.add(Env.getAD_Client_ID(Env.getCtx())); whereClause.append(" AND (" + COLUMNNAME_HR_Payroll_ID + " =? OR " +COLUMNNAME_HR_Payroll_ID +" IS NULL)"); params.add(payroll_id); if (department_id != 0 ) { whereClause.append(" AND HR_Concept.HR_Department_ID=?"); params.add(department_id); } if (!Check.isEmpty(sqlWhere)) { whereClause.append(sqlWhere); } List<MHRConcept> list = new Query(ctx, Table_Name, whereClause.toString(), null) .setParameters(params) .setOnlyActiveRecords(true) .setOrderBy("COALESCE("+COLUMNNAME_SeqNo + ",999999999999) DESC, " + COLUMNNAME_Value) .list(MHRConcept.class); return list.toArray(new MHRConcept[list.size()]); } // getConcept /** * Standard Constructor * @param ctx context * @param HR_Concept_ID * @param trxName */ public MHRConcept (Properties ctx, int HR_Concept_ID, String trxName) { super (ctx, HR_Concept_ID, trxName); if (HR_Concept_ID == 0) { setValue(""); setName(""); setDescription("");
setIsEmployee(false); setIsPrinted(false); setHR_Payroll_ID(0); setHR_Job_ID(0); setHR_Department_ID(0); } } // HRConcept /** * Load Constructor * @param ctx context * @param rs result set * @param trxName */ public MHRConcept (Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } public int getConceptAccountCR() { String sql = " HR_Expense_Acct FROM HR_Concept c " + " INNER JOIN HR_Concept_Acct ca ON (c.HR_Concept_ID=ca.HR_Concept_ID)" + " WHERE c.HR_Concept_ID " + getHR_Concept_ID(); int result = DB.getSQLValue("ConceptCR", sql); if (result > 0) return result; return 0; } public int getConceptAccountDR() { String sql = " HR_Revenue_Acct FROM HR_Concept c " + " INNER JOIN HR_Concept_Acct ca ON (c.HR_Concept_ID=ca.HR_Concept_ID)" + " WHERE c.HR_Concept_ID " + getHR_Concept_ID(); int result = DB.getSQLValue("ConceptCR", sql); if (result > 0) return result; return 0; } } // HRConcept
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.libero.liberoHR\src\main\java\org\eevolution\model\MHRConcept.java
1
请在Spring Boot框架中完成以下Java代码
public class ProfileService { private final UserFindService userFindService; ProfileService(UserFindService userFindService) { this.userFindService = userFindService; } @Transactional(readOnly = true) public Profile viewProfile(long viewerId, UserName usernameToView) { final var viewer = userFindService.findById(viewerId).orElseThrow(NoSuchElementException::new); return userFindService.findByUsername(usernameToView) .map(viewer::viewProfile) .orElseThrow(NoSuchElementException::new); } @Transactional(readOnly = true) public Profile viewProfile(UserName userName) { return userFindService.findByUsername(userName) .map(User::getProfile) .orElseThrow(NoSuchElementException::new); } @Transactional public Profile followAndViewProfile(long followerId, UserName followeeUserName) { final var followee = userFindService.findByUsername(followeeUserName).orElseThrow(NoSuchElementException::new);
return userFindService.findById(followerId) .map(follower -> follower.followUser(followee)) .map(follower -> follower.viewProfile(followee)) .orElseThrow(NoSuchElementException::new); } @Transactional public Profile unfollowAndViewProfile(long followerId, UserName followeeUserName) { final var followee = userFindService.findByUsername(followeeUserName).orElseThrow(NoSuchElementException::new); return userFindService.findById(followerId) .map(follower -> follower.unfollowUser(followee)) .map(follower -> follower.viewProfile(followee)) .orElseThrow(NoSuchElementException::new); } }
repos\realworld-springboot-java-master\src\main\java\io\github\raeperd\realworld\domain\user\ProfileService.java
2
请完成以下Java代码
public void beforeFlatrateTermReactivate(@NonNull final I_C_Flatrate_Term term) { // Delete subscription progress entries final ISubscriptionDAO subscriptionBL = Services.get(ISubscriptionDAO.class); final List<I_C_SubscriptionProgress> entries = subscriptionBL.retrieveSubscriptionProgresses(SubscriptionProgressQuery.builder() .term(term).build()); for (final I_C_SubscriptionProgress entry : entries) { if (entry.getM_ShipmentSchedule_ID() > 0) { throw new AdempiereException("@" + MSG_TERM_ERROR_DELIVERY_ALREADY_HAS_SHIPMENT_SCHED_0P + "@"); } InterfaceWrapperHelper.delete(entry); } } @Override public void beforeSaveOfNextTermForPredecessor( @NonNull final I_C_Flatrate_Term next, @NonNull final I_C_Flatrate_Term predecessor) { final I_C_Flatrate_Conditions conditions = next.getC_Flatrate_Conditions(); if (X_C_Flatrate_Conditions.ONFLATRATETERMEXTEND_CalculatePrice.equals(conditions.getOnFlatrateTermExtend())) { final IPricingResult pricingInfo = FlatrateTermPricing.builder() .termRelatedProductId(ProductId.ofRepoIdOrNull(next.getM_Product_ID())) .term(next) .priceDate(TimeUtil.asLocalDate(next.getStartDate())) .qty(next.getPlannedQtyPerUnit()) .build() .computeOrThrowEx(); next.setPriceActual(pricingInfo.getPriceStd()); next.setC_Currency_ID(pricingInfo.getCurrencyRepoId()); next.setC_UOM_ID(UomId.toRepoId(pricingInfo.getPriceUomId()));
next.setC_TaxCategory_ID(TaxCategoryId.toRepoId(pricingInfo.getTaxCategoryId())); next.setIsTaxIncluded(pricingInfo.isTaxIncluded()); } else if (X_C_Flatrate_Conditions.ONFLATRATETERMEXTEND_CopyPrice.equals(conditions.getOnFlatrateTermExtend())) { next.setPriceActual(predecessor.getPriceActual()); next.setC_Currency_ID(predecessor.getC_Currency_ID()); next.setC_UOM_ID(predecessor.getC_UOM_ID()); next.setC_TaxCategory_ID(predecessor.getC_TaxCategory_ID()); next.setIsTaxIncluded(predecessor.isTaxIncluded()); } else { throw new AdempiereException("Unexpected OnFlatrateTermExtend=" + conditions.getOnFlatrateTermExtend()) .appendParametersToMessage() .setParameter("conditions", conditions) .setParameter("predecessor", predecessor) .setParameter("next", next); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\impl\SubscriptionTermEventListener.java
1
请完成以下Java代码
public List<HistoricCaseInstance> findIdsByCriteria(HistoricCaseInstanceQueryImpl query) { setSafeInValueLists(query); return getDbSqlSession().selectList("selectHistoricCaseInstanceIdsByQueryCriteria", query, getManagedEntityClass()); } @Override public void deleteByCaseDefinitionId(String caseDefinitionId) { getDbSqlSession().delete("deleteHistoricCaseInstanceByCaseDefinitionId", caseDefinitionId, getManagedEntityClass()); } @Override public void deleteHistoricCaseInstances(HistoricCaseInstanceQueryImpl historicCaseInstanceQuery) { getDbSqlSession().delete("bulkDeleteHistoricCaseInstances", historicCaseInstanceQuery, getManagedEntityClass()); } @Override public void bulkDeleteHistoricCaseInstances(Collection<String> caseInstanceIds) { getDbSqlSession().delete("bulkDeleteHistoricCaseInstancesByIds", createSafeInValuesList(caseInstanceIds), getManagedEntityClass()); }
protected void setSafeInValueLists(HistoricCaseInstanceQueryImpl caseInstanceQuery) { if (caseInstanceQuery.getCaseInstanceIds() != null) { caseInstanceQuery.setSafeCaseInstanceIds(createSafeInValuesList(caseInstanceQuery.getCaseInstanceIds())); } if (caseInstanceQuery.getInvolvedGroups() != null) { caseInstanceQuery.setSafeInvolvedGroups(createSafeInValuesList(caseInstanceQuery.getInvolvedGroups())); } if (caseInstanceQuery.getOrQueryObjects() != null && !caseInstanceQuery.getOrQueryObjects().isEmpty()) { for (HistoricCaseInstanceQueryImpl orCaseInstanceQuery : caseInstanceQuery.getOrQueryObjects()) { setSafeInValueLists(orCaseInstanceQuery); } } } }
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\persistence\entity\data\impl\MybatisHistoricCaseInstanceDataManagerImpl.java
1
请完成以下Java代码
public I_C_Campaign getC_Campaign() throws RuntimeException { return (I_C_Campaign)MTable.get(getCtx(), I_C_Campaign.Table_Name) .getPO(getC_Campaign_ID(), get_TrxName()); } /** Set Campaign. @param C_Campaign_ID Marketing Campaign */ public void setC_Campaign_ID (int C_Campaign_ID) { if (C_Campaign_ID < 1) set_Value (COLUMNNAME_C_Campaign_ID, null); else set_Value (COLUMNNAME_C_Campaign_ID, Integer.valueOf(C_Campaign_ID)); } /** Get Campaign. @return Marketing Campaign */ public int getC_Campaign_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Campaign_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Description. @param Description Optional short description of the record */ public void setDescription (String Description) { set_Value (COLUMNNAME_Description, Description); } /** Get Description. @return Optional short description of the record */ public String getDescription () { return (String)get_Value(COLUMNNAME_Description); } /** Set Promotion. @param M_Promotion_ID Promotion */ public void setM_Promotion_ID (int M_Promotion_ID) { if (M_Promotion_ID < 1) set_ValueNoCheck (COLUMNNAME_M_Promotion_ID, null); else set_ValueNoCheck (COLUMNNAME_M_Promotion_ID, Integer.valueOf(M_Promotion_ID)); } /** Get Promotion. @return Promotion */ public int getM_Promotion_ID () {
Integer ii = (Integer)get_Value(COLUMNNAME_M_Promotion_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ public String getName () { return (String)get_Value(COLUMNNAME_Name); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getName()); } /** Set Relative Priority. @param PromotionPriority Which promotion should be apply to a product */ public void setPromotionPriority (int PromotionPriority) { set_Value (COLUMNNAME_PromotionPriority, Integer.valueOf(PromotionPriority)); } /** Get Relative Priority. @return Which promotion should be apply to a product */ public int getPromotionPriority () { Integer ii = (Integer)get_Value(COLUMNNAME_PromotionPriority); if (ii == null) return 0; return ii.intValue(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Promotion.java
1
请完成以下Java代码
public List<ImmutableAttributeSet> run() { if (attributeListValues.isEmpty()) { // get this corner-case out of the way first return ImmutableList.of(); } // group our attribute values final MultiValueMap<AttributeId, AttributeListValue> attributeId2Values = new MultiValueMap<>(); final LinkedHashSet<AttributeId> attributeIdsSet = new LinkedHashSet<>(); for (final AttributeListValue attributeListValue : attributeListValues) { attributeId2Values.add(attributeListValue.getAttributeId(), attributeListValue); attributeIdsSet.add(attributeListValue.getAttributeId()); } final ImmutableList<AttributeId> attributeIds = attributeIdsSet.stream().collect(ImmutableList.toImmutableList()); // we will create plenty of builders & eventually sets from this first one final ImmutableAttributeSet.Builder builder = ImmutableAttributeSet.builder(); final List<ImmutableAttributeSet.Builder> builderList = recurse(0, attributeIds, attributeId2Values, builder); return builderList.stream() .map(ImmutableAttributeSet.Builder::build) .collect(ImmutableList.toImmutableList()); } private List<ImmutableAttributeSet.Builder> recurse( final int currendAttributeIdIdx, @NonNull final List<AttributeId> attributeIds, @NonNull final MultiValueMap<AttributeId, AttributeListValue> attributeId2Values, @NonNull final ImmutableAttributeSet.Builder builder) { final LinkedList<ImmutableAttributeSet.Builder> result = new LinkedList<>();
final AttributeId currentAttributeId = attributeIds.get(currendAttributeIdIdx); final List<AttributeListValue> valuesForCurrentAttribute = attributeId2Values.get(currentAttributeId); for (final AttributeListValue attributeListValue : valuesForCurrentAttribute) { final ImmutableAttributeSet.Builder copy = builder.createCopy(); copy.attributeValue(attributeListValue); final int nextAttributeIdIdx = currendAttributeIdIdx + 1; final boolean listContainsMore = attributeIds.size() > nextAttributeIdIdx; if (listContainsMore) { result.addAll(recurse(nextAttributeIdIdx, attributeIds, attributeId2Values, copy)); } else { result.add(copy); } } return result; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\flatrate\dataEntry\CreateAllAttributeSetsCommand.java
1
请完成以下Java代码
public void collectValueChanged(final IDocumentFieldView documentField, final ReasonSupplier reason) { // do nothing } @Override public void collectValueIfChanged(final IDocumentFieldView documentField, final Object valueOld, final ReasonSupplier reason) { // do nothing } @Override public void collectReadonlyIfChanged(final IDocumentFieldView documentField, final LogicExpressionResult valueOld, final ReasonSupplier reason) { // do nothing } @Override public void collectMandatoryIfChanged(final IDocumentFieldView documentField, final LogicExpressionResult valueOld, final ReasonSupplier reason) { // do nothing } @Override public void collectDisplayedIfChanged(final IDocumentFieldView documentField, final LogicExpressionResult valueOld, final ReasonSupplier reason) { // do nothing } @Override public void collectLookupValuesStaled(final IDocumentFieldView documentField, final ReasonSupplier reason) { // do nothing } @Override public void collectFieldWarning(final IDocumentFieldView documentField, final DocumentFieldWarning fieldWarning) { // do nothing } @Override public void collectFrom(final IDocumentChangesCollector fromCollector) { // do nothing } @Override public Set<String> collectFrom(final Document document, final ReasonSupplier reason) { return ImmutableSet.of(); // nothing collected } @Override public void collectDocumentValidStatusChanged(final DocumentPath documentPath, final DocumentValidStatus documentValidStatus) { // do nothing
} @Override public void collectValidStatus(final IDocumentFieldView documentField) { // do nothing } @Override public void collectDocumentSaveStatusChanged(final DocumentPath documentPath, final DocumentSaveStatus documentSaveStatus) { // do nothing } @Override public void collectDeleted(final DocumentPath documentPath) { // do nothing } @Override public void collectStaleDetailId(final DocumentPath rootDocumentPath, final DetailId detailId) { // do nothing } @Override public void collectAllowNew(final DocumentPath rootDocumentPath, final DetailId detailId, final LogicExpressionResult allowNew) { // do nothing } @Override public void collectAllowDelete(final DocumentPath rootDocumentPath, final DetailId detailId, final LogicExpressionResult allowDelete) { // do nothing } @Override public void collectEvent(final IDocumentFieldChangedEvent event) { // do nothing } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\NullDocumentChangesCollector.java
1
请完成以下Java代码
public PublicKeyCredentialCreationOptionsBuilder pubKeyCredParams( List<PublicKeyCredentialParameters> pubKeyCredParams) { this.pubKeyCredParams = pubKeyCredParams; return this; } /** * Sets the {@link #getTimeout()} property. * @param timeout the timeout * @return the PublicKeyCredentialCreationOptionsBuilder */ public PublicKeyCredentialCreationOptionsBuilder timeout(Duration timeout) { this.timeout = timeout; return this; } /** * Sets the {@link #getExcludeCredentials()} property. * @param excludeCredentials the excluded credentials. * @return the PublicKeyCredentialCreationOptionsBuilder */ public PublicKeyCredentialCreationOptionsBuilder excludeCredentials( List<PublicKeyCredentialDescriptor> excludeCredentials) { this.excludeCredentials = excludeCredentials; return this; } /** * Sets the {@link #getAuthenticatorSelection()} property. * @param authenticatorSelection the authenticator selection * @return the PublicKeyCredentialCreationOptionsBuilder */ public PublicKeyCredentialCreationOptionsBuilder authenticatorSelection( AuthenticatorSelectionCriteria authenticatorSelection) { this.authenticatorSelection = authenticatorSelection; return this; } /** * Sets the {@link #getAttestation()} property. * @param attestation the attestation * @return the PublicKeyCredentialCreationOptionsBuilder */ public PublicKeyCredentialCreationOptionsBuilder attestation(AttestationConveyancePreference attestation) { this.attestation = attestation; return this; } /** * Sets the {@link #getExtensions()} property. * @param extensions the extensions * @return the PublicKeyCredentialCreationOptionsBuilder
*/ public PublicKeyCredentialCreationOptionsBuilder extensions(AuthenticationExtensionsClientInputs extensions) { this.extensions = extensions; return this; } /** * Allows customizing the builder using the {@link Consumer} that is passed in. * @param customizer the {@link Consumer} that can be used to customize the * {@link PublicKeyCredentialCreationOptionsBuilder} * @return the PublicKeyCredentialCreationOptionsBuilder */ public PublicKeyCredentialCreationOptionsBuilder customize( Consumer<PublicKeyCredentialCreationOptionsBuilder> customizer) { customizer.accept(this); return this; } /** * Builds a new {@link PublicKeyCredentialCreationOptions} * @return the new {@link PublicKeyCredentialCreationOptions} */ public PublicKeyCredentialCreationOptions build() { return new PublicKeyCredentialCreationOptions(this.rp, this.user, this.challenge, this.pubKeyCredParams, this.timeout, this.excludeCredentials, this.authenticatorSelection, this.attestation, this.extensions); } } }
repos\spring-security-main\webauthn\src\main\java\org\springframework\security\web\webauthn\api\PublicKeyCredentialCreationOptions.java
1
请完成以下Java代码
protected void addTo(Email email, String to) { String[] tos = splitAndTrim(to); if (tos != null) { for (String t : tos) { try { email.addTo(t); } catch (EmailException e) { throw LOG.addRecipientException(t, e); } } } else { throw LOG.missingRecipientsException(); } } protected void setFrom(Email email, String from) { String fromAddress = null; if (from != null) { fromAddress = from; } else { // use default configured from address in process engine config fromAddress = Context.getProcessEngineConfiguration().getMailServerDefaultFrom(); } try { email.setFrom(fromAddress); } catch (EmailException e) { throw LOG.addSenderException(from, e); } } protected void addCc(Email email, String cc) { String[] ccs = splitAndTrim(cc); if (ccs != null) { for (String c : ccs) { try { email.addCc(c); } catch (EmailException e) { throw LOG.addCcException(c, e); } } } } protected void addBcc(Email email, String bcc) { String[] bccs = splitAndTrim(bcc); if (bccs != null) { for (String b : bccs) { try { email.addBcc(b); } catch (EmailException e) { throw LOG.addBccException(b, e); } } } } protected void setSubject(Email email, String subject) { email.setSubject(subject != null ? subject : ""); }
protected void setMailServerProperties(Email email) { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); String host = processEngineConfiguration.getMailServerHost(); ensureNotNull("Could not send email: no SMTP host is configured", "host", host); email.setHostName(host); int port = processEngineConfiguration.getMailServerPort(); email.setSmtpPort(port); email.setTLS(processEngineConfiguration.getMailServerUseTLS()); String user = processEngineConfiguration.getMailServerUsername(); String password = processEngineConfiguration.getMailServerPassword(); if (user != null && password != null) { email.setAuthentication(user, password); } } protected void setCharset(Email email, String charSetStr) { if (charset != null) { email.setCharset(charSetStr); } } protected String[] splitAndTrim(String str) { if (str != null) { String[] splittedStrings = str.split(","); for (int i = 0; i < splittedStrings.length; i++) { splittedStrings[i] = splittedStrings[i].trim(); } return splittedStrings; } return null; } protected String getStringFromField(Expression expression, DelegateExecution execution) { if(expression != null) { Object value = expression.getValue(execution); if(value != null) { return value.toString(); } } return null; } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\behavior\MailActivityBehavior.java
1
请完成以下Java代码
public I_C_Charge getC_Charge() throws RuntimeException { return (I_C_Charge)MTable.get(getCtx(), I_C_Charge.Table_Name) .getPO(getC_Charge_ID(), get_TrxName()); } /** Set Charge. @param C_Charge_ID Additional document charges */ public void setC_Charge_ID (int C_Charge_ID) { if (C_Charge_ID < 1) set_ValueNoCheck (COLUMNNAME_C_Charge_ID, null); else set_ValueNoCheck (COLUMNNAME_C_Charge_ID, Integer.valueOf(C_Charge_ID)); } /** Get Charge. @return Additional document charges */ public int getC_Charge_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Charge_ID); if (ii == null) return 0; return ii.intValue(); } public I_C_ValidCombination getCh_Expense_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) .getPO(getCh_Expense_Acct(), get_TrxName()); } /** Set Charge Expense. @param Ch_Expense_Acct Charge Expense Account */ public void setCh_Expense_Acct (int Ch_Expense_Acct) { set_Value (COLUMNNAME_Ch_Expense_Acct, Integer.valueOf(Ch_Expense_Acct)); } /** Get Charge Expense. @return Charge Expense Account */
public int getCh_Expense_Acct () { Integer ii = (Integer)get_Value(COLUMNNAME_Ch_Expense_Acct); if (ii == null) return 0; return ii.intValue(); } public I_C_ValidCombination getCh_Revenue_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) .getPO(getCh_Revenue_Acct(), get_TrxName()); } /** Set Charge Revenue. @param Ch_Revenue_Acct Charge Revenue Account */ public void setCh_Revenue_Acct (int Ch_Revenue_Acct) { set_Value (COLUMNNAME_Ch_Revenue_Acct, Integer.valueOf(Ch_Revenue_Acct)); } /** Get Charge Revenue. @return Charge Revenue Account */ public int getCh_Revenue_Acct () { Integer ii = (Integer)get_Value(COLUMNNAME_Ch_Revenue_Acct); if (ii == null) return 0; return ii.intValue(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Charge_Acct.java
1
请完成以下Java代码
public static Quantity of(final int value) { if (value == 0) { return ZERO; } return new Quantity(value); } public static Quantity of(@NonNull final BigDecimal qty) { return of(qty.intValueExact()); } public static final Quantity ZERO = new Quantity(0); private static final int MAX_VALUE = 99999; private final int valueAsInt; private Quantity(final int value) { if (value < 0) { throw new IllegalArgumentException("Quantity shall be greater than " + value); } if (value > MAX_VALUE) { throw new IllegalArgumentException("The MSV3 standard allows a maximum quantity of " + value); } valueAsInt = value; } public Quantity min(final Quantity otherQty) { return valueAsInt <= otherQty.valueAsInt ? this : otherQty; } public Quantity min(final int otherQty) { return valueAsInt <= otherQty ? this : Quantity.of(otherQty); }
public BigDecimal getValueAsBigDecimal() { return BigDecimal.valueOf(valueAsInt); } @JsonValue public int toJson() { return valueAsInt; } public boolean isZero() { return valueAsInt == 0; } @Override public int compareTo(@NonNull final Quantity other) { return this.valueAsInt - other.valueAsInt; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.commons\src\main\java\de\metas\vertical\pharma\msv3\protocol\types\Quantity.java
1
请在Spring Boot框架中完成以下Java代码
JdbcSessionDataSourceScriptDatabaseInitializer jdbcSessionDataSourceScriptDatabaseInitializer( @SpringSessionDataSource ObjectProvider<DataSource> sessionDataSource, ObjectProvider<DataSource> dataSource, JdbcSessionProperties properties) { DataSource dataSourceToInitialize = sessionDataSource.getIfAvailable(dataSource::getObject); return new JdbcSessionDataSourceScriptDatabaseInitializer(dataSourceToInitialize, properties); } @Bean @Order(Ordered.HIGHEST_PRECEDENCE) SessionRepositoryCustomizer<JdbcIndexedSessionRepository> springBootSessionRepositoryCustomizer( JdbcSessionProperties jdbcSessionProperties, SessionTimeout sessionTimeout) { return (sessionRepository) -> { PropertyMapper map = PropertyMapper.get(); map.from(sessionTimeout::getTimeout).to(sessionRepository::setDefaultMaxInactiveInterval); map.from(jdbcSessionProperties::getTableName).to(sessionRepository::setTableName);
map.from(jdbcSessionProperties::getFlushMode).to(sessionRepository::setFlushMode); map.from(jdbcSessionProperties::getSaveMode).to(sessionRepository::setSaveMode); map.from(jdbcSessionProperties::getCleanupCron).to(sessionRepository::setCleanupCron); }; } static class OnJdbcSessionDatasourceInitializationCondition extends OnDatabaseInitializationCondition { OnJdbcSessionDatasourceInitializationCondition() { super("Jdbc Session", "spring.session.jdbc.initialize-schema"); } } }
repos\spring-boot-4.0.1\module\spring-boot-session-jdbc\src\main\java\org\springframework\boot\session\jdbc\autoconfigure\JdbcSessionAutoConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
static class WarPackagingConfiguration { @Bean ServletInitializerCustomizer<GroovyTypeDeclaration> javaServletInitializerCustomizer( ProjectDescription description) { return (typeDeclaration) -> { GroovyMethodDeclaration configure = GroovyMethodDeclaration.method("configure") .modifiers(Modifier.PROTECTED) .returning("org.springframework.boot.builder.SpringApplicationBuilder") .parameters( Parameter.of("application", "org.springframework.boot.builder.SpringApplicationBuilder")) .body(CodeBlock.ofStatement("application.sources($L)", description.getApplicationName())); configure.annotations().addSingle(ClassName.of(Override.class)); typeDeclaration.addMethodDeclaration(configure); }; } }
/** * Configuration for Groovy projects built with Maven. */ @Configuration @ConditionalOnBuildSystem(MavenBuildSystem.ID) static class GroovyMavenProjectConfiguration { @Bean GroovyMavenBuildCustomizer groovyBuildCustomizer() { return new GroovyMavenBuildCustomizer(); } } }
repos\initializr-main\initializr-generator-spring\src\main\java\io\spring\initializr\generator\spring\code\groovy\GroovyProjectGenerationDefaultContributorsConfiguration.java
2
请完成以下Java代码
public boolean hasVariables() { return hasVariablesLocal(); } public boolean hasVariablesLocal() { return wrappedScope.hasVariablesLocal(); } public boolean hasVariable(String variableName) { return hasVariableLocal(variableName); } public boolean hasVariableLocal(String variableName) { return wrappedScope.hasVariableLocal(variableName); } public void removeVariable(String variableName) { removeVariableLocal(variableName); } public void removeVariableLocal(String variableName) { wrappedScope.removeVariableLocal(variableName); }
public void removeVariables(Collection<String> variableNames) { removeVariablesLocal(variableNames); } public void removeVariablesLocal(Collection<String> variableNames) { wrappedScope.removeVariablesLocal(variableNames); } public void removeVariables() { removeVariablesLocal(); } public void removeVariablesLocal() { wrappedScope.removeVariablesLocal(); } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\core\variable\scope\VariableScopeLocalAdapter.java
1
请完成以下Java代码
/* visible for testing */ void addForwardedBy(Forwarded forwarded, InetAddress localAddress) { if (localAddress != null) { String byValue = localAddress.getHostAddress(); if (localAddress instanceof Inet6Address) { byValue = "[" + byValue + "]"; } if (serverPort != null && serverPort > 0) { byValue = byValue + ":" + serverPort; } forwarded.put("by", byValue); } } /* for testing */ static class Forwarded { private static final char EQUALS = '='; private static final char SEMICOLON = ';'; private final Map<String, String> values; Forwarded() { this.values = new HashMap<>(); } Forwarded(Map<String, String> values) { this.values = values; } public Forwarded put(String key, String value) { this.values.put(key, quoteIfNeeded(value)); return this; } private String quoteIfNeeded(String s) { if (s != null && s.contains(":")) { // TODO: broaded quote return "\"" + s + "\""; } return s; } public @Nullable String get(String key) { return this.values.get(key); } /* for testing */ Map<String, String> getValues() {
return this.values; } @Override public String toString() { return "Forwarded{" + "values=" + this.values + '}'; } public String toHeaderValue() { StringBuilder builder = new StringBuilder(); for (Map.Entry<String, String> entry : this.values.entrySet()) { if (!builder.isEmpty()) { builder.append(SEMICOLON); } builder.append(entry.getKey()).append(EQUALS).append(entry.getValue()); } return builder.toString(); } } }
repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\headers\ForwardedHeadersFilter.java
1
请完成以下Java代码
public String getDiagramResourceName() { return null; } public String getDeploymentId() { return null; } public void addLaneSet(LaneSet newLaneSet) { getLaneSets().add(newLaneSet); } public Lane getLaneForId(String id) { if(laneSets != null && laneSets.size() > 0) { Lane lane; for(LaneSet set : laneSets) { lane = set.getLaneForId(id); if(lane != null) { return lane; } } } return null; } @Override public CoreActivityBehavior<? extends BaseDelegateExecution> getActivityBehavior() { // unsupported in PVM return null; } // getters and setters ////////////////////////////////////////////////////// public ActivityImpl getInitial() { return initial; } public void setInitial(ActivityImpl initial) { this.initial = initial; } @Override public String toString() { return "ProcessDefinition("+id+")"; } public String getDescription() { return (String) getProperty("documentation"); } /** * @return all lane-sets defined on this process-instance. Returns an empty list if none are defined. */ public List<LaneSet> getLaneSets() { if(laneSets == null) { laneSets = new ArrayList<LaneSet>(); } return laneSets; } public void setParticipantProcess(ParticipantProcess participantProcess) { this.participantProcess = participantProcess;
} public ParticipantProcess getParticipantProcess() { return participantProcess; } public boolean isScope() { return true; } public PvmScope getEventScope() { return null; } public ScopeImpl getFlowScope() { return null; } public PvmScope getLevelOfSubprocessScope() { return null; } @Override public boolean isSubProcessScope() { return true; } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\pvm\process\ProcessDefinitionImpl.java
1
请完成以下Java代码
private CreateWarehouseRequest getCreateWarehouseRequest( @NonNull final JsonRequestWarehouse jsonRequestWarehouse, @NonNull final I_AD_Org org) { final OrgId orgId = OrgId.ofRepoId(org.getAD_Org_ID()); final ExternalIdentifier externalIdentifier = ExternalIdentifier.of(jsonRequestWarehouse.getBpartnerLocationIdentifier()); return CreateWarehouseRequest.builder() .orgId(orgId) .name(jsonRequestWarehouse.getName()) .value(jsonRequestWarehouse.getCode()) .partnerLocationId(getOrgBPartnerLocationId(externalIdentifier, orgId)) .active(Optional.ofNullable(jsonRequestWarehouse.getActive()).orElse(true)) .build(); } private static void validateCreateSyncAdvise( @NonNull final Object parentResource, @NonNull final ExternalIdentifier externalIdentifier, @NonNull final SyncAdvise effectiveSyncAdvise) { if (effectiveSyncAdvise.isFailIfNotExists()) { throw MissingResourceException.builder() .resourceName("Warehouse") .resourceIdentifier(externalIdentifier.getRawValue()) .parentResource(parentResource) .build() .setParameter("effectiveSyncAdvise", effectiveSyncAdvise); } else if (ExternalIdentifier.Type.METASFRESH_ID.equals(externalIdentifier.getType())) { throw MissingResourceException.builder() .resourceName("Warehouse")
.resourceIdentifier(externalIdentifier.getRawValue()) .parentResource(parentResource) .detail(TranslatableStrings.constant("With this type, only updates are allowed.")) .build() .setParameter("effectiveSyncAdvise", effectiveSyncAdvise); } } @NonNull public JsonLocator resolveLocatorScannedCode(@NonNull final ScannedCode scannedCode) { final LocatorScannedCodeResolverResult result = locatorScannedCodeResolver.resolve(scannedCode); return toJsonLocator(result.getLocatorQRCode()); } private static JsonLocator toJsonLocator(final LocatorQRCode locatorQRCode) { return JsonLocator.builder() .caption(locatorQRCode.getCaption()) .qrCode(locatorQRCode.toGlobalQRCodeJsonString()) .build(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\warehouse\WarehouseRestService.java
1
请完成以下Java代码
public long getMissCount() { return missCount.longValue(); } @Override public void incrementMissCount() { missCount.incrementAndGet(); } @Override public long getMissInTrxCount() { return missInTrxCount.longValue(); } @Override
public void incrementMissInTrxCount() { missInTrxCount.incrementAndGet(); } @Override public boolean isCacheEnabled() { if (cacheConfig != null) { return cacheConfig.isEnabled(); } // if no caching config is provided, it means we are dealing with an overall statistics // so we consider caching as Enabled return true; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\model\impl\TableCacheStatistics.java
1
请完成以下Java代码
public void setName (java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Name */ @Override public java.lang.String getName () { return (java.lang.String)get_Value(COLUMNNAME_Name); } /** Set Suchschlüssel. @param Value Suchschlüssel für den Eintrag im erforderlichen Format - muss eindeutig sein */
@Override public void setValue (java.lang.String Value) { set_Value (COLUMNNAME_Value, Value); } /** Get Suchschlüssel. @return Suchschlüssel für den Eintrag im erforderlichen Format - muss eindeutig sein */ @Override public java.lang.String getValue () { return (java.lang.String)get_Value(COLUMNNAME_Value); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_CountryArea.java
1
请在Spring Boot框架中完成以下Java代码
public String getImageUrl() { return imageUrl; } public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; } public boolean isActivated() { return activated; } public void setActivated(boolean activated) { this.activated = activated; } public String getLangKey() { return langKey; } public void setLangKey(String langKey) { this.langKey = langKey; } public String getCreatedBy() { return createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public Instant getCreatedDate() { return createdDate; } public void setCreatedDate(Instant createdDate) { this.createdDate = createdDate; } public String getLastModifiedBy() { return lastModifiedBy; } public void setLastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } public Instant getLastModifiedDate() { return lastModifiedDate;
} public void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } public Set<String> getAuthorities() { return authorities; } public void setAuthorities(Set<String> authorities) { this.authorities = authorities; } @Override public String toString() { return "UserDTO{" + "login='" + login + '\'' + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", email='" + email + '\'' + ", imageUrl='" + imageUrl + '\'' + ", activated=" + activated + ", langKey='" + langKey + '\'' + ", createdBy=" + createdBy + ", createdDate=" + createdDate + ", lastModifiedBy='" + lastModifiedBy + '\'' + ", lastModifiedDate=" + lastModifiedDate + ", authorities=" + authorities + "}"; } }
repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\service\dto\UserDTO.java
2
请完成以下Java代码
public void setAD_User_ToPrint_ID (int AD_User_ToPrint_ID) { if (AD_User_ToPrint_ID < 1) set_Value (COLUMNNAME_AD_User_ToPrint_ID, null); else set_Value (COLUMNNAME_AD_User_ToPrint_ID, Integer.valueOf(AD_User_ToPrint_ID)); } @Override public int getAD_User_ToPrint_ID() { return get_ValueAsInt(COLUMNNAME_AD_User_ToPrint_ID); } @Override public de.metas.printing.model.I_C_Printing_Queue getC_Printing_Queue() { return get_ValueAsPO(COLUMNNAME_C_Printing_Queue_ID, de.metas.printing.model.I_C_Printing_Queue.class); } @Override public void setC_Printing_Queue(de.metas.printing.model.I_C_Printing_Queue C_Printing_Queue) { set_ValueFromPO(COLUMNNAME_C_Printing_Queue_ID, de.metas.printing.model.I_C_Printing_Queue.class, C_Printing_Queue); } @Override public void setC_Printing_Queue_ID (int C_Printing_Queue_ID) { if (C_Printing_Queue_ID < 1) set_ValueNoCheck (COLUMNNAME_C_Printing_Queue_ID, null); else
set_ValueNoCheck (COLUMNNAME_C_Printing_Queue_ID, Integer.valueOf(C_Printing_Queue_ID)); } @Override public int getC_Printing_Queue_ID() { return get_ValueAsInt(COLUMNNAME_C_Printing_Queue_ID); } @Override public void setC_Printing_Queue_Recipient_ID (int C_Printing_Queue_Recipient_ID) { if (C_Printing_Queue_Recipient_ID < 1) set_ValueNoCheck (COLUMNNAME_C_Printing_Queue_Recipient_ID, null); else set_ValueNoCheck (COLUMNNAME_C_Printing_Queue_Recipient_ID, Integer.valueOf(C_Printing_Queue_Recipient_ID)); } @Override public int getC_Printing_Queue_Recipient_ID() { return get_ValueAsInt(COLUMNNAME_C_Printing_Queue_Recipient_ID); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java-gen\de\metas\printing\model\X_C_Printing_Queue_Recipient.java
1
请在Spring Boot框架中完成以下Java代码
public Predicate isStoreFileOnDisk() { return exchange -> { final ExportPPOrderRouteContext context = ProcessorHelper.getPropertyOrThrowError(exchange, ROUTE_PROPERTY_EXPORT_PP_ORDER_CONTEXT, ExportPPOrderRouteContext.class); return context.getDestinationDetails().isStoreFileOnDisk(); }; } @NonNull public Predicate isPluFileExportAuditEnabled() { return exchange -> { final ExportPPOrderRouteContext context = ProcessorHelper.getPropertyOrThrowError(exchange, ROUTE_PROPERTY_EXPORT_PP_ORDER_CONTEXT, ExportPPOrderRouteContext.class); return context.isPluFileExportAuditEnabled(); }; } public static Integer getPPOrderMetasfreshId(@NonNull final Map<String, String> parameters) {
final String ppOrderStr = parameters.get(ExternalSystemConstants.PARAM_PP_ORDER_ID); if (Check.isBlank(ppOrderStr)) { throw new RuntimeException("Missing mandatory param: " + ExternalSystemConstants.PARAM_PP_ORDER_ID); } try { return Integer.parseInt(ppOrderStr); } catch (final NumberFormatException e) { throw new RuntimeException("Unable to parse PP_Order_ID from string=" + ppOrderStr); } } }
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-leichundmehl\src\main\java\de\metas\camel\externalsystems\leichundmehl\to_leichundmehl\pporder\ExportPPOrderHelper.java
2
请完成以下Java代码
public class RecordChangeLogs { public static <T> RecordChangeLog of( @NonNull final T model, @NonNull final Class<T> modelClass, @NonNull final List<RecordChangeLogEntry> entries) { final RecordChangeLog.RecordChangeLogBuilder builder = RecordChangeLog.builder().entries(entries); final Integer createdBy = InterfaceWrapperHelper.getValueOrNull(model, InterfaceWrapperHelper.COLUMNNAME_Created); builder.createdByUserId(UserId.ofRepoId(createdBy)); final Timestamp created = InterfaceWrapperHelper.getValueOrNull(model, InterfaceWrapperHelper.COLUMNNAME_Created); builder.createdTimestamp(TimeUtil.asInstant(created));
final Integer updatedBy = InterfaceWrapperHelper.getValueOrNull(model, InterfaceWrapperHelper.COLUMNNAME_UpdatedBy); builder.lastChangedByUserId(UserId.ofRepoId(updatedBy)); final Timestamp updated = InterfaceWrapperHelper.getValueOrNull(model, InterfaceWrapperHelper.COLUMNNAME_Updated); builder.createdTimestamp(TimeUtil.asInstant(updated)); final String tableName = InterfaceWrapperHelper.getTableName(modelClass); builder.tableName(tableName); final int id = InterfaceWrapperHelper.getId(model); final ComposedRecordId recordId = ComposedRecordId.singleKey(InterfaceWrapperHelper.getKeyColumnName(modelClass), id); builder.recordId(recordId); return builder.build(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\table\RecordChangeLogs.java
1
请完成以下Java代码
public List<Object> getValues(@NonNull final I_M_ReceiptSchedule rs) { final IReceiptScheduleBL receiptScheduleBL = Services.get(IReceiptScheduleBL.class); final List<Object> values = new ArrayList<>(); values.add(rs.getC_DocType_ID()); values.add(receiptScheduleBL.getC_BPartner_Effective_ID(rs)); values.add(receiptScheduleBL.getC_BPartner_Location_Effective_ID(rs)); values.add(receiptScheduleBL.getWarehouseEffectiveId(rs).getRepoId()); final BPartnerContactId bPartnerContactID = receiptScheduleBL.getBPartnerContactID(rs); if (bPartnerContactID != null) { values.add(bPartnerContactID); } values.add(rs.getAD_Org_ID()); values.add(rs.getDateOrdered()); values.add(rs.getC_Order_ID());
if (Check.isNotBlank(rs.getExternalResourceURL())) { //remove any `org.compiere.util.Util.ArrayKey.SEPARATOR` that may be present in the URL final String externalResourceURL = rs.getExternalResourceURL().replaceAll(SEPARATOR, ""); values.add(externalResourceURL); } values.add(rs.getExternalHeaderId()); if (rs.getExternalSystem_ID() > 0) { values.add(rs.getExternalSystem_ID()); } return values; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\agg\key\impl\ReceiptScheduleKeyValueHandler.java
1
请在Spring Boot框架中完成以下Java代码
public void setRedisNamespace(String namespace) { Assert.hasText(namespace, "namespace must not be empty"); this.redisNamespace = namespace; } protected String getRedisNamespace() { return this.redisNamespace; } public void setFlushMode(FlushMode flushMode) { Assert.notNull(flushMode, "flushMode must not be null"); this.flushMode = flushMode; } protected FlushMode getFlushMode() { return this.flushMode; } public void setSaveMode(SaveMode saveMode) { Assert.notNull(saveMode, "saveMode must not be null"); this.saveMode = saveMode; } protected SaveMode getSaveMode() { return this.saveMode; } @Autowired public void setRedisConnectionFactory( @SpringSessionRedisConnectionFactory ObjectProvider<RedisConnectionFactory> springSessionRedisConnectionFactory, ObjectProvider<RedisConnectionFactory> redisConnectionFactory) { this.redisConnectionFactory = springSessionRedisConnectionFactory .getIfAvailable(redisConnectionFactory::getObject); } protected RedisConnectionFactory getRedisConnectionFactory() { return this.redisConnectionFactory; } @Autowired(required = false) @Qualifier("springSessionDefaultRedisSerializer") public void setDefaultRedisSerializer(RedisSerializer<Object> defaultRedisSerializer) { this.defaultRedisSerializer = defaultRedisSerializer; }
protected RedisSerializer<Object> getDefaultRedisSerializer() { return this.defaultRedisSerializer; } @Autowired(required = false) public void setSessionRepositoryCustomizer( ObjectProvider<SessionRepositoryCustomizer<T>> sessionRepositoryCustomizers) { this.sessionRepositoryCustomizers = sessionRepositoryCustomizers.orderedStream().collect(Collectors.toList()); } protected List<SessionRepositoryCustomizer<T>> getSessionRepositoryCustomizers() { return this.sessionRepositoryCustomizers; } @Override public void setBeanClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } protected RedisTemplate<String, Object> createRedisTemplate() { RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); redisTemplate.setKeySerializer(RedisSerializer.string()); redisTemplate.setHashKeySerializer(RedisSerializer.string()); if (getDefaultRedisSerializer() != null) { redisTemplate.setDefaultSerializer(getDefaultRedisSerializer()); } redisTemplate.setConnectionFactory(getRedisConnectionFactory()); redisTemplate.setBeanClassLoader(this.classLoader); redisTemplate.afterPropertiesSet(); return redisTemplate; } }
repos\spring-session-main\spring-session-data-redis\src\main\java\org\springframework\session\data\redis\config\annotation\web\http\AbstractRedisHttpSessionConfiguration.java
2
请完成以下Java代码
public class TtlThreadPoolTaskExecutor extends ThreadPoolTaskExecutor { @Override public void execute(Runnable task) { super.execute(Objects.requireNonNull(TtlRunnable.get(task))); } @Override public void execute(Runnable task, long startTimeout) { super.execute(Objects.requireNonNull(TtlRunnable.get(task)), startTimeout); } @Override public Future<?> submit(Runnable task) { return super.submit(Objects.requireNonNull(TtlRunnable.get(task))); }
@Override public <T> Future<T> submit(Callable<T> task) { return super.submit(Objects.requireNonNull(TtlCallable.get(task))); } @Override public ListenableFuture<?> submitListenable(Runnable task) { return super.submitListenable(Objects.requireNonNull(TtlRunnable.get(task))); } @Override public <T> ListenableFuture<T> submitListenable(Callable<T> task) { return super.submitListenable(Objects.requireNonNull(TtlCallable.get(task))); } }
repos\SpringBoot-Labs-master\lab-12-mybatis\lab-12-mybatis-plus-tenant\src\main\java\cn\iocoder\springboot\lab12\mybatis\core\TtlThreadPoolTaskExecutor.java
1
请完成以下Java代码
public void setDescription (final @Nullable java.lang.String Description) { set_Value (COLUMNNAME_Description, Description); } @Override public java.lang.String getDescription() { return get_ValueAsString(COLUMNNAME_Description); } @Override public void setDocument_Currency_ID (final int Document_Currency_ID) { if (Document_Currency_ID < 1) set_Value (COLUMNNAME_Document_Currency_ID, null); else set_Value (COLUMNNAME_Document_Currency_ID, Document_Currency_ID); } @Override public int getDocument_Currency_ID() { return get_ValueAsInt(COLUMNNAME_Document_Currency_ID); } @Override public void setFact_Acct_UserChange_ID (final int Fact_Acct_UserChange_ID) { if (Fact_Acct_UserChange_ID < 1) set_ValueNoCheck (COLUMNNAME_Fact_Acct_UserChange_ID, null); else set_ValueNoCheck (COLUMNNAME_Fact_Acct_UserChange_ID, Fact_Acct_UserChange_ID); } @Override public int getFact_Acct_UserChange_ID() { return get_ValueAsInt(COLUMNNAME_Fact_Acct_UserChange_ID); } @Override public void setLocal_Currency_ID (final int Local_Currency_ID) { if (Local_Currency_ID < 1) set_Value (COLUMNNAME_Local_Currency_ID, null); else set_Value (COLUMNNAME_Local_Currency_ID, Local_Currency_ID); } @Override public int getLocal_Currency_ID() { return get_ValueAsInt(COLUMNNAME_Local_Currency_ID); } @Override public void setMatchKey (final @Nullable java.lang.String MatchKey) { set_Value (COLUMNNAME_MatchKey, MatchKey); } @Override public java.lang.String getMatchKey() { return get_ValueAsString(COLUMNNAME_MatchKey); } @Override public void setM_Product_ID (final int M_Product_ID) { if (M_Product_ID < 1) set_Value (COLUMNNAME_M_Product_ID, null); else set_Value (COLUMNNAME_M_Product_ID, M_Product_ID); } @Override
public int getM_Product_ID() { return get_ValueAsInt(COLUMNNAME_M_Product_ID); } /** * PostingSign AD_Reference_ID=541699 * Reference name: PostingSign */ public static final int POSTINGSIGN_AD_Reference_ID=541699; /** DR = D */ public static final String POSTINGSIGN_DR = "D"; /** CR = C */ public static final String POSTINGSIGN_CR = "C"; @Override public void setPostingSign (final java.lang.String PostingSign) { set_Value (COLUMNNAME_PostingSign, PostingSign); } @Override public java.lang.String getPostingSign() { return get_ValueAsString(COLUMNNAME_PostingSign); } @Override public void setUserElementString1 (final @Nullable java.lang.String UserElementString1) { set_Value (COLUMNNAME_UserElementString1, UserElementString1); } @Override public java.lang.String getUserElementString1() { return get_ValueAsString(COLUMNNAME_UserElementString1); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-gen\de\metas\acct\model\X_Fact_Acct_UserChange.java
1
请在Spring Boot框架中完成以下Java代码
public Users getUser(String albertaApiKey, String _id) throws ApiException { ApiResponse<Users> resp = getUserWithHttpInfo(albertaApiKey, _id); return resp.getData(); } /** * Daten eines einzelnen Benutzers abrufen * Szenario - das WaWi fragt bei Alberta nach, wie die Daten eines Benutzers mit der angegebenen Id sind * @param albertaApiKey (required) * @param _id eindeutige id des Benutzers (required) * @return ApiResponse&lt;Users&gt; * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */ public ApiResponse<Users> getUserWithHttpInfo(String albertaApiKey, String _id) throws ApiException { com.squareup.okhttp.Call call = getUserValidateBeforeCall(albertaApiKey, _id, null, null); Type localVarReturnType = new TypeToken<Users>(){}.getType(); return apiClient.execute(call, localVarReturnType); } /** * Daten eines einzelnen Benutzers abrufen (asynchronously) * Szenario - das WaWi fragt bei Alberta nach, wie die Daten eines Benutzers mit der angegebenen Id sind * @param albertaApiKey (required) * @param _id eindeutige id des Benutzers (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object */ public com.squareup.okhttp.Call getUserAsync(String albertaApiKey, String _id, final ApiCallback<Users> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; if (callback != null) { progressListener = new ProgressResponseBody.ProgressListener() { @Override
public void update(long bytesRead, long contentLength, boolean done) { callback.onDownloadProgress(bytesRead, contentLength, done); } }; progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { @Override public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { callback.onUploadProgress(bytesWritten, contentLength, done); } }; } com.squareup.okhttp.Call call = getUserValidateBeforeCall(albertaApiKey, _id, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken<Users>(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } }
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-patient-api\src\main\java\io\swagger\client\api\UserApi.java
2
请完成以下Java代码
public class Person { @Id private long id; private String firstName; private String lastName; public Person() { super(); } public Person(long id, String firstName, String lastName) { super(); this.id = id; this.firstName = firstName; this.lastName = lastName; } public Person(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } public long getId() { return id; } public void setId(long id) {
this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } @Override public String toString() { return "Person [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + "]"; } }
repos\tutorials-master\persistence-modules\spring-data-jdbc\src\main\java\com\baeldung\springdatajdbcintro\entity\Person.java
1