instruction
string
input
string
output
string
source_file
string
priority
int64
请在Spring Boot框架中完成以下Java代码
public PersonV1 getFirstVersionOfPersonRequestParameter() { return new PersonV1("Bob Charlie"); } @GetMapping(path = "/person", params = "version=2") public PersonV2 getSecondVersionOfPersonRequestParameter() { return new PersonV2(new Name("Bob", "Charlie")); } @GetMapping(path = "/person/header", headers = ...
public PersonV2 getSecondVersionOfPersonRequestHeader() { return new PersonV2(new Name("Bob", "Charlie")); } @GetMapping(path = "/person/accept", produces = "application/vnd.company.app-v1+json") public PersonV1 getFirstVersionOfPersonAcceptHeader() { return new PersonV1("Bob Charlie"); } @GetMapping(path = ...
repos\master-spring-and-spring-boot-main\12-rest-api\src\main\java\com\in28minutes\rest\webservices\restfulwebservices\versioning\VersioningPersonController.java
2
请完成以下Java代码
public Map<Class<?>, String> getDeleteStatements() { return deleteStatements; } public void setDeleteStatements(Map<Class<?>, String> deleteStatements) { this.deleteStatements = deleteStatements; } public Map<Class<?>, String> getBulkDeleteStatements() { return bulkDeleteStatem...
} public void setDatabaseCatalog(String databaseCatalog) { this.databaseCatalog = databaseCatalog; } public String getDatabaseSchema() { return databaseSchema; } public void setDatabaseSchema(String databaseSchema) { this.databaseSchema = databaseSchema; } public ...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\db\DbSqlSessionFactory.java
1
请完成以下Java代码
public static CoNLLSentence compute(List<Term> termList) { return new MaxEntDependencyParser().parse(termList); } /** * 分析句子的依存句法 * * @param sentence 句子 * @return CoNLL格式的依存句法树 */ public static CoNLLSentence compute(String sentence) { return new MaxEntDepend...
context.add(nodeArray[from].compiledWord + '→' + wordBeforeJ.compiledWord + '@' + nodeArray[to].compiledWord); context.add(wordBeforeI.label + '@' + nodeArray[from].label + '→' + nodeArray[to].label); context.add(nodeArray[from].label + '→' + wordBeforeJ.label + '@' + nodeArray[to].label); List<...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dependency\MaxEntDependencyParser.java
1
请完成以下Java代码
default LocalDate getPreviousBusinessDay(@NonNull final LocalDate date) { final int targetWorkingDays = 0; return getPreviousBusinessDay(date, targetWorkingDays); } default LocalDateTime getPreviousBusinessDay(@NonNull final LocalDateTime dateTime, final int targetWorkingDays) { final LocalDate previousDate ...
while (true) { currentDate = currentDate.minusDays(1); final boolean isBusinessDay = isBusinessDay(currentDate); if (isBusinessDay) { workingDays++; } if (workingDays >= targetWorkingDays && isBusinessDay) { return currentDate; } } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\calendar\IBusinessDayMatcher.java
1
请完成以下Java代码
final class JWKS { private JWKS() { } static OctetSequenceKey.Builder signing(SecretKey key) throws JOSEException { Date issued = new Date(); return new OctetSequenceKey.Builder(key).keyOperations(Set.of(KeyOperation.SIGN)) .keyUse(KeyUse.SIGNATURE) .algorithm(JWSAlgorithm.HS256) .keyIDFromThumbprint...
} } static RSAKey.Builder signingWithRsa(RSAPublicKey pub, RSAPrivateKey key) throws JOSEException { Date issued = new Date(); return new RSAKey.Builder(pub).privateKey(key) .keyUse(KeyUse.SIGNATURE) .keyOperations(Set.of(KeyOperation.SIGN)) .algorithm(JWSAlgorithm.RS256) .keyIDFromThumbprint() .i...
repos\spring-security-main\oauth2\oauth2-jose\src\main\java\org\springframework\security\oauth2\jwt\JWKS.java
1
请完成以下Java代码
static <RES, REQ> DataResponse<RES> paginateList(PaginateRequest paginateRequest, Query<?, REQ> query, String defaultSort, Map<String, QueryProperty> properties, ListProcessor<REQ, RES> listProcessor) { // Use defaults for paging, if not set in the PaginationRequest, nor in the URL Integer start...
query.asc(); } else if ("desc".equals(order)) { query.desc(); } else { throw new FlowableIllegalArgumentException("Value for param 'order' is not valid : '" + order + "', must be 'asc' or 'desc'"); } } DataResponse<RES> response = new ...
repos\flowable-engine-main\modules\flowable-common-rest\src\main\java\org\flowable\common\rest\api\PaginateListUtil.java
1
请完成以下Spring Boot application配置
spring.datasource.url=jdbc:mysql://localhost:3306/db_users?cachePrepStmts=true&useServerPrepStmts=true&rewriteBatchedStatements=true&createDatabaseIfNotExist=true spring.datasource.username=root spring.datasource.password=root spring.jpa.hibernate.ddl-auto=create spring.jpa.show-sql=true spring.jpa.properties.hiberna...
=org.hibernate.dialect.MySQL5Dialect spring.jpa.properties.hibernate.format-sql=true spring.jpa.properties.hibernate.generate_statistics=true
repos\Hibernate-SpringBoot-master\HibernateSpringBootBatchInsertsViaSession\src\main\resources\application.properties
2
请完成以下Java代码
public DocumentPath getDocumentPath() { // TODO i think we shall make this method not mandatory in interface return null; } @Override public boolean isProcessed() { return !editable; } @Override public ImmutableSet<String> getFieldNames() { return values.getFieldNames(); } @Override public ViewRo...
} return toBuilder().editable(true).build(); } public LookupValuesPage getFieldTypeahead(final String fieldName, final String query) { return lookups.getFieldTypeahead(fieldName, query); } public LookupValuesList getFieldDropdown(final String fieldName) { return lookups.getFieldDropdown(fieldName); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\pricingconditions\view\PricingConditionsRow.java
1
请完成以下Java代码
private boolean atLeastOneMetadata(TbMsg msg) { if (!metadataNamesList.isEmpty()) { Map<String, String> metadataMap = metadataToMap(msg); return processAtLeastOne(metadataNamesList, metadataMap); } return false; } private boolean processAllKeys(List<String> data,...
return true; } } return false; } private Map<String, String> metadataToMap(TbMsg msg) { return msg.getMetaData().getData(); } @SuppressWarnings("unchecked") private Map<String, String> dataToMap(TbMsg msg) { return (Map<String, String>) gson.fromJson(msg...
repos\thingsboard-master\rule-engine\rule-engine-components\src\main\java\org\thingsboard\rule\engine\filter\TbCheckMessageNode.java
1
请完成以下Java代码
public class InOutLineBPartnerAware implements IBPartnerAware { public static final IBPartnerAwareFactory factory = new IBPartnerAwareFactory() { @Override public IBPartnerAware createBPartnerAware(Object model) { final I_M_InOutLine inoutLine = InterfaceWrapperHelper.create(model, I_M_InOutLine.class); f...
{ final I_M_InOut inout = getM_InOut(); return inout.isSOTrx(); } @Override public I_C_BPartner getC_BPartner() { final I_M_InOut inout = getM_InOut(); final I_C_BPartner partner = InterfaceWrapperHelper.load(inout.getC_BPartner_ID(), I_C_BPartner.class); if (partner == null) { return null; } r...
repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\org\adempiere\mm\attributes\api\impl\InOutLineBPartnerAware.java
1
请完成以下Java代码
public void setProcessed (final boolean Processed) { set_Value (COLUMNNAME_Processed, Processed); } @Override public boolean isProcessed() { return get_ValueAsBoolean(COLUMNNAME_Processed); } @Override public void setQtyRejectedToPick (final BigDecimal QtyRejectedToPick) { set_Value (COLUMNNAME_QtyRej...
public void setRejectReason (final @Nullable java.lang.String RejectReason) { set_Value (COLUMNNAME_RejectReason, RejectReason); } @Override public java.lang.String getRejectReason() { return get_ValueAsString(COLUMNNAME_RejectReason); } @Override public void setSinglePackage (final boolean SinglePackage...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_Picking_Job_Step.java
1
请完成以下Java代码
public class MedExpirationBatchRunner { @Autowired private Job medExpirationJob; @Autowired private JobLauncher jobLauncher; @Value("${batch.medicine.alert_type}") private String alertType; @Value("${batch.medicine.expiration.default.days}") private long defaultExpiration; @Valu...
public void launchJob(ZonedDateTime triggerZonedDateTime) { try { JobParameters jobParameters = new JobParametersBuilder().addString(BatchConstants.TRIGGERED_DATE_TIME, triggerZonedDateTime.toString()) .addString(BatchConstants.ALERT_TYPE, alertType) .addLong(BatchCon...
repos\tutorials-master\spring-batch\src\main\java\com\baeldung\batchreaderproperties\MedExpirationBatchRunner.java
1
请完成以下Java代码
protected int get_AccessLevel() { return accessLevel.intValue(); } /** Load Meta Data */ protected POInfo initPO (Properties ctx) { POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName()); return poi; } public String toString() { StringBuffer sb = new Strin...
*/ public int getM_Product_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_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); } /** Ge...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_ProductDownload.java
1
请完成以下Java代码
public @Nullable static InstantAndOrgId ofTimestampOrNull(@Nullable final java.sql.Timestamp timestamp, @NonNull final OrgId orgId) { if(timestamp == null) { return null; } return ofTimestamp(timestamp, orgId); } public @NonNull static InstantAndOrgId ofTimestamp(@NonNull final java.sql.Timestamp timest...
public Instant toInstant() {return instant;} public @NonNull ZonedDateTime toZonedDateTime(@NonNull final ZoneId zoneId) {return instant.atZone(zoneId);} public @NonNull ZonedDateTime toZonedDateTime(@NonNull final Function<OrgId, ZoneId> orgMapper) {return instant.atZone(orgMapper.apply(orgId));} public @NonNull...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\organization\InstantAndOrgId.java
1
请完成以下Java代码
public void disable() { enabled.set(false); logger.info("Disabled FactAcctRelatedDocumentsProvider"); } @Override public List<RelatedDocumentsCandidateGroup> retrieveRelatedDocumentsCandidates( @NonNull final IZoomSource fromDocument, @Nullable final AdWindowId targetWindowId) { // Return empty if not...
if (!posted) { return ImmutableList.of(); } } // // Build query and check count if needed final MQuery query = new MQuery(I_Fact_Acct.Table_Name); query.addRestriction(I_Fact_Acct.COLUMNNAME_AD_Table_ID, Operator.EQUAL, fromDocument.getAD_Table_ID()); query.addRestriction(I_Fact_Acct.COLUMNNAME_R...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\document\references\related_documents\fact_acct\FactAcctRelatedDocumentsProvider.java
1
请完成以下Java代码
public LookupValuesPage findEntities(final Evaluatee ctx, final int pageLength) { return findEntities(ctx, null, 0, pageLength); } @Override public LookupValue findById(final Object idObj) { final Object idNormalized = LookupValue.normalizeId(idObj, fetcher.isNumericKey()); if (idNormalized == null) { ...
@Override public Optional<WindowId> getZoomIntoWindowId() { return fetcher.getZoomIntoWindowId(); } @Override public List<CCacheStats> getCacheStats() { return ImmutableList.of(cacheByPartition.stats()); } @Override public void cacheInvalidate() { cacheByPartition.reset(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\lookup\FullyCachedLookupDataSource.java
1
请完成以下Java代码
public void trigger(DelegateExecution execution, String triggerName, Object triggerData) { ExecutionEntity executionEntity = deleteSignalEventSubscription(execution); leaveIntermediateCatchEvent(executionEntity); } @Override public void eventCancelledByEventGateway(DelegateExecution executi...
EventSubscriptionEntityManager eventSubscriptionEntityManager = Context.getCommandContext().getEventSubscriptionEntityManager(); List<EventSubscriptionEntity> eventSubscriptions = executionEntity.getEventSubscriptions(); for (EventSubscriptionEntity eventSubscription : eventSubscriptions) { ...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\behavior\IntermediateCatchSignalEventActivityBehavior.java
1
请完成以下Java代码
public int getPMM_PurchaseCandidate_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_PMM_PurchaseCandidate_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Purchase order candidate - order line. @param PMM_PurchaseCandidate_OrderLine_ID Purchase order candidate - order line */ @Overr...
if (bd == null) return Env.ZERO; return bd; } /** Set Bestellte Menge (TU). @param QtyOrdered_TU Bestellte Menge (TU) */ @Override public void setQtyOrdered_TU (java.math.BigDecimal QtyOrdered_TU) { set_Value (COLUMNNAME_QtyOrdered_TU, QtyOrdered_TU); } /** Get Bestellte Menge (TU). @return B...
repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java-gen\de\metas\procurement\base\model\X_PMM_PurchaseCandidate_OrderLine.java
1
请完成以下Java代码
public String getProcessDefinitionId() { return processDefinitionId; } public TopicSubscription setProcessDefinitionId(String processDefinitionId) { this.processDefinitionId = processDefinitionId; return this; } public List<String> getProcessDefinitionIdIn() { return processDefinitionIdIn; }...
} public List<String> getTenantIdIn() { return tenantIdIn; } public TopicSubscription setTenantIdIn(List<String> tenantIds) { this.tenantIdIn = tenantIds; return this; } public boolean isIncludeExtensionProperties() { return includeExtensionProperties; } public void setIncludeExtension...
repos\camunda-bpm-platform-master\clients\java\client\src\main\java\org\camunda\bpm\client\topic\impl\TopicSubscriptionImpl.java
1
请完成以下Java代码
private static class PasswordModifyRequest implements ExtendedRequest { @Serial private static final long serialVersionUID = 3154223576081503237L; private static final byte SEQUENCE_TYPE = 48; private static final String PASSWORD_MODIFY_OID = "1.3.6.1.4.1.4203.1.11.1"; private static final byte USER_IDENT...
} else if ((length & 0x0000_00FF) == length) { dest.write((byte) 0x81); dest.write((byte) (length & 0xFF)); } else if ((length & 0x0000_FFFF) == length) { dest.write((byte) 0x82); dest.write((byte) ((length >> 8) & 0xFF)); dest.write((byte) (length & 0xFF)); } else if ((length & 0x00F...
repos\spring-security-main\ldap\src\main\java\org\springframework\security\ldap\userdetails\LdapUserDetailsManager.java
1
请在Spring Boot框架中完成以下Java代码
public class AuditTrailFilter implements Filter { private final ProducerTemplate producerTemplate; public AuditTrailFilter(@NonNull final ProducerTemplate producerTemplate) { this.producerTemplate = producerTemplate; } @Override public void doFilter( @NonNull final ServletRequest servletRequest, @NonNul...
} final JsonSeqNoResponse jsonSeqNoResponse = (JsonSeqNoResponse)producerTemplate .sendBody("direct:" + ExternalSystemCamelConstants.MF_SEQ_NO_ROUTE_ID, ExchangePattern.InOut, null); if (jsonSeqNoResponse == null) { throw new RuntimeCamelException("Failed to retrieve traceId!"); } requestWrapper.set...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\core\src\main\java\de\metas\camel\externalsystems\core\restapi\auth\AuditTrailFilter.java
2
请完成以下Java代码
public class X_EDI_M_HU_PI_Item_Product_Lookup_UPC_v extends org.compiere.model.PO implements I_EDI_M_HU_PI_Item_Product_Lookup_UPC_v, org.compiere.model.I_Persistent { private static final long serialVersionUID = -1994744480L; /** Standard Constructor */ public X_EDI_M_HU_PI_Item_Product_Lookup_UPC_v (fina...
@Override public int getM_HU_PI_Item_Product_ID() { return get_ValueAsInt(COLUMNNAME_M_HU_PI_Item_Product_ID); } @Override public void setStoreGLN (final @Nullable java.lang.String StoreGLN) { set_ValueNoCheck (COLUMNNAME_StoreGLN, StoreGLN); } @Override public java.lang.String getStoreGLN() { retur...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_EDI_M_HU_PI_Item_Product_Lookup_UPC_v.java
1
请完成以下Java代码
public void setExternalSystem_Config_ID (final int ExternalSystem_Config_ID) { if (ExternalSystem_Config_ID < 1) set_ValueNoCheck (COLUMNNAME_ExternalSystem_Config_ID, null); else set_ValueNoCheck (COLUMNNAME_ExternalSystem_Config_ID, ExternalSystem_Config_ID); } @Override public int getExternalSystem_...
public void setName (final java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } @Override public java.lang.String getName() { return get_ValueAsString(COLUMNNAME_Name); } @Override public void setWriteAudit (final boolean WriteAudit) { set_Value (COLUMNNAME_WriteAudit, WriteAudit); } @Over...
repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Config.java
1
请完成以下Java代码
public class ImportDelete extends JavaProcess { /** Table be deleted */ private int p_AD_Table_ID = 0; /** * Prepare - e.g., get Parameters. */ protected void prepare() { ProcessInfoParameter[] para = getParametersAsArray(); for (int i = 0; i < para.length; i++) { String name = para[i].getParame...
* Perform process. * @return clear Message * @throws Exception */ protected String doIt() throws Exception { log.info("AD_Table_ID=" + p_AD_Table_ID); // get Table Info MTable table = new MTable (getCtx(), p_AD_Table_ID, get_TrxName()); if (table.get_ID() == 0) throw new IllegalArgumentException (...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\process\ImportDelete.java
1
请在Spring Boot框架中完成以下Java代码
public Integer getSampleCount() { return sampleCount; } public ServerFlowConfig setSampleCount(Integer sampleCount) { this.sampleCount = sampleCount; return this; } public Double getMaxAllowedQps() { return maxAllowedQps; } public ServerFlowConfig setMaxAllowed...
return this; } @Override public String toString() { return "ServerFlowConfig{" + "namespace='" + namespace + '\'' + ", exceedCount=" + exceedCount + ", maxOccupyRatio=" + maxOccupyRatio + ", intervalMs=" + intervalMs + ", sampleCount=" + s...
repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\domain\cluster\config\ServerFlowConfig.java
2
请完成以下Java代码
private static BigDecimal getEquivalentInSmallerTemporalUnit(@NonNull final BigDecimal durationBD, @NonNull final TemporalUnit unit) { if (unit == ChronoUnit.DAYS) { return durationBD.multiply(BigDecimal.valueOf(WORK_HOURS_PER_DAY));// This refers to work hours, not calendar hours } if (unit == ChronoUnit.H...
} throw Check.newException("No smaller temporal unit defined for {}", unit); } public static boolean isCompleteDays(@NonNull final Duration duration) { if (duration.isZero()) { return true; } final Duration daysAsDuration = Duration.ofDays(duration.toDays()); return daysAsDuration.equals(duration); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\time\DurationUtils.java
1
请在Spring Boot框架中完成以下Java代码
public List<DMARK1> getDMARK1() { if (dmark1 == null) { dmark1 = new ArrayList<DMARK1>(); } return this.dmark1; } /** * Gets the value of the dqvar1 property. * * @return * possible object is * {@link DQVAR1 } * */ public ...
return dqvar1; } /** * Sets the value of the dqvar1 property. * * @param value * allowed object is * {@link DQVAR1 } * */ public void setDQVAR1(DQVAR1 value) { this.dqvar1 = value; } }
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_stepcom_desadv\de\metas\edi\esb\jaxb\stepcom\desadv\DETAILXlief.java
2
请完成以下Java代码
public void setChildElements(Map<String, List<DmnExtensionElement>> childElements) { this.childElements = childElements; } @Override public DmnExtensionElement clone() { DmnExtensionElement clone = new DmnExtensionElement(); clone.setValues(this); return clone; } pu...
childElements = new LinkedHashMap<>(); if (otherElement.getChildElements() != null && !otherElement.getChildElements().isEmpty()) { for (String key : otherElement.getChildElements().keySet()) { List<DmnExtensionElement> otherElementList = otherElement.getChildElements().get(key); ...
repos\flowable-engine-main\modules\flowable-dmn-model\src\main\java\org\flowable\dmn\model\DmnExtensionElement.java
1
请在Spring Boot框架中完成以下Java代码
public Page<SysRole> listAllSysRole(Page<SysRole> page, SysRole role) { return page.setRecords(sysRoleMapper.listAllSysRole(page,role)); } @Override public SysRole getRoleNoTenant(String roleCode) { return sysRoleMapper.getRoleNoTenant(roleCode); } @Override public Result impor...
//1.删除角色和用户关系 sysRoleMapper.deleteRoleUserRelation(roleid); //2.删除角色和权限关系 sysRoleMapper.deleteRolePermissionRelation(roleid); //3.删除角色 this.removeById(roleid); return true; } @Override @Transactional(rollbackFor = Exception.class) public boolean deleteBat...
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\service\impl\SysRoleServiceImpl.java
2
请完成以下Java代码
private static JSONDocumentField toJSONDocumentField(@NonNull final String clearanceNote,@NonNull final JSONOptions jsonOpts) { final Object jsonValue = Values.valueToJsonObject(clearanceNote, jsonOpts); return JSONDocumentField.ofNameAndValue(I_M_HU.COLUMNNAME_ClearanceNote, jsonValue) .setDisplayed(true) ...
final IDocumentChangesCollector changesCollector = Execution.getCurrentDocumentChangesCollector(); final AttributeCode attributeCode = attributeValue.getAttributeCode(); final Object jsonValue = HUEditorRowAttributesHelper.extractJSONValue(storage, attributeValue, JSONOptions.newInstance()); final DocumentFie...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\HUEditorRowAttributes.java
1
请完成以下Java代码
public String toString() { return "HUAttributeTransferRequest [huContext=" + huContext + ", product=" + productId + ", qty=" + qty + ", uom=" + uom + ", attributeStorageFrom=" + attributeStorageFrom + ", attributeStorageTo=" + attributeStorageTo + ", huStorageFrom=" + huStorageFrom + ", huStorageTo=" + huStorage...
} @Override public IHUStorage getHUStorageTo() { return huStorageTo; } @Override public BigDecimal getQtyUnloaded() { return qtyUnloaded; } @Override public boolean isVHUTransfer() { return vhuTransfer; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\strategy\impl\HUAttributeTransferRequest.java
1
请在Spring Boot框架中完成以下Java代码
public String insertPayment(Payment payment) { Date date = new Date(); Timestamp nowAsTS = new Timestamp(date.getTime()); String sql = "INSERT INTO payments(paymentId, orderId, amount, method, createdAt, status) VALUES(?,?,?,?,?,?);"; try (Connection conn = this.connect(); PreparedStat...
} catch (SQLException e) { System.out.println(e.getMessage()); } } public void readPayment(String orderId, Payment payment) { String sql = "SELECT paymentId, orderId, amount, method, createdAt, status FROM payments WHERE orderId = ?"; try (Connection conn = this.connect(); ...
repos\tutorials-master\microservices-modules\saga-pattern\src\main\java\io\orkes\example\saga\dao\PaymentsDAO.java
2
请完成以下Spring Boot application配置
# Temporal Cloud Configuration Profile # To use this profile: # 1. Set environment variables for your Temporal Cloud connection # 2. Run with: mvn spring-boot:run -Dspring-boot.run.profiles=cloud # # Required environment variables: # TEMPORAL_ADDRESS - Your Temporal Cloud namespace address (e.g., your-namespace.tmprl...
orter: otlp: endpoint: ${OTEL_ENDPOINT:} # Set to empty or configure your cloud OTLP endpoint temporal: ui: # Update these to point to Temporal Cloud Web UI webui: url: https://cloud.temporal.io/namespaces/${TEMPORAL_NAMESPACE} # Grafana and Jaeger may not be available in cloud s...
repos\spring-boot-demo-main\src\main\resources\application-cloud.yml
2
请完成以下Java代码
public abstract class HistoricDetailEntity implements HistoricDetail, PersistentObject, Serializable { private static final long serialVersionUID = 1L; protected String id; protected String processInstanceId; protected String activityInstanceId; protected String taskId; protected String execut...
public String getActivityInstanceId() { return activityInstanceId; } public void setActivityInstanceId(String activityInstanceId) { this.activityInstanceId = activityInstanceId; } @Override public String getTaskId() { return taskId; } public void setTaskId(String t...
repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\HistoricDetailEntity.java
1
请完成以下Java代码
private final Object getSegmentValue(final AccountDimension accountDimension, @NonNull final AcctSchemaElementType elementType) { Check.assumeNotNull(elementType, "elementType not null"); if (elementType.equals(AcctSchemaElementType.Organization)) { return accountDimension.getAD_Org_ID(); } else if (elem...
else if (elementType.equals(AcctSchemaElementType.UserList2)) { return accountDimension.getUser2_ID(); } else if (elementType.equals(AcctSchemaElementType.UserElementString1)) { return accountDimension.getUserElementString1(); } else if (elementType.equals(AcctSchemaElementType.UserElementString2)) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\acct\api\impl\AccountDimensionValidator.java
1
请完成以下Java代码
protected boolean afterSave(final boolean newRecord, final boolean success) { if (newRecord) // Add to all automatic roles { // Add to all automatic roles ... handled elsewhere } // Menu/Workflow update else if (is_ValueChanged("IsActive") || is_ValueChanged("Name") || is_ValueChanged("Description"...
} } } return success; } public static X_AD_WF_Node[] getWFNodes(final Properties ctx, final String whereClause, final String trxName) { String sql = "SELECT * FROM AD_WF_Node"; if (whereClause != null && whereClause.length() > 0) { sql += " WHERE " + whereClause; } final ArrayList<X_AD_WF_Node> ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MWindow.java
1
请完成以下Java代码
public void setGmtCreate(Date gmtCreate) { this.gmtCreate = gmtCreate; } public Date getGmtModified() { return gmtModified; } public void setGmtModified(Date gmtModified) { this.gmtModified = gmtModified; } public String getApp() { return app; } public...
public String getHostname() { return hostname; } public void setHostname(String hostname) { this.hostname = hostname; } public Date getLastFetch() { return lastFetch; } public void setLastFetch(Date lastFetch) { this.lastFetch = lastFetch; } @Override ...
repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\datasource\entity\MetricPositionEntity.java
1
请完成以下Java代码
public void setScrappedQty (final @Nullable BigDecimal ScrappedQty) { set_Value (COLUMNNAME_ScrappedQty, ScrappedQty); } @Override public BigDecimal getScrappedQty() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_ScrappedQty); return bd != null ? bd : BigDecimal.ZERO; } @Override public void ...
@Override public int getUser1_ID() { return get_ValueAsInt(COLUMNNAME_User1_ID); } @Override public org.compiere.model.I_C_ElementValue getUser2() { return get_ValueAsPO(COLUMNNAME_User2_ID, org.compiere.model.I_C_ElementValue.class); } @Override public void setUser2(final org.compiere.model.I_C_Element...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_DD_OrderLine.java
1
请完成以下Java代码
private boolean isMainProductHu(final HuId huId) { return getView().streamByIds(DocumentIdsSelection.ALL) .filter(row -> row.getType().isMainProduct() || row.isReceipt()) .flatMap(row -> row.getIncludedRows().stream()) .filter(row -> row.getType().isHUOrHUStorage()) .map(PPOrderLineRow::getHuId) ...
} private PInstanceRequest createPInstanceRequest() { return PInstanceRequest.builder() .processId(getPrintFormat().getReportProcessId()) .processParams(ImmutableList.of( ProcessInfoParameter.of("AD_PInstance_ID", getPinstanceId()), ProcessInfoParameter.of("AD_PrintFormat_ID", printFormatId)))...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pporder\process\WEBUI_PP_Order_PrintLabel.java
1
请完成以下Java代码
public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public LocalDateTime getCreatedAt() { return createdAt; } public void setCreatedAt(LocalDateTime createdAt) { ...
public LocalDateTime getUpdatedAt() { return updatedAt; } public void setUpdatedAt(LocalDateTime updatedAt) { this.updatedAt = updatedAt; } @Override public String toString() { return "Event{" + "id=" + id + ", name='" + name + '\'' + ", ...
repos\tutorials-master\persistence-modules\spring-jpa-3\src\main\java\com\baeldung\jpa\localdatetimequery\Event.java
1
请完成以下Java代码
public class ValidationResultType { @XmlAttribute(name = "remark") protected String remark; @XmlAttribute(name = "record_id") protected Integer recordId; @XmlAttribute(name = "cost_unit") protected String costUnit; @XmlAttribute(name = "status", required = true) @XmlSchemaType(name = "u...
*/ public void setRecordId(Integer value) { this.recordId = value; } /** * Gets the value of the costUnit property. * * @return * possible object is * {@link String } * */ public String getCostUnit() { return costUnit; } /** ...
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\ValidationResultType.java
1
请在Spring Boot框架中完成以下Java代码
public class AD_Role_CopyTemplateCustomizer implements CopyTemplateCustomizer { private final IMsgBL msgBL = Services.get(IMsgBL.class); private final IUserDAO userDAO = Services.get(IUserDAO.class); private static final AdMessageKey MSG_AD_Role_Name_Unique = AdMessageKey.of("AD_Role_Unique_Name"); private static ...
} private String makeUniqueName() { final Properties ctx = Env.getCtx(); final int adUserId = Env.getAD_User_ID(ctx); final String adLanguage = Env.getAD_Language(ctx); final String timestampStr = DATE_FORMATTER.format(LocalDateTime.now()); final String userName = userDAO.retrieveUserFullName(adUserId); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\impl\AD_Role_CopyTemplateCustomizer.java
2
请完成以下Java代码
private final ITrxItemChunkProcessor<IT, RT> createProcessor() { ITrxItemProcessor<IT, RT> processor = getProcessor(); if (itemsPerBatch != null) { processor = FixedBatchTrxItemProcessor.of(processor, itemsPerBatch); } return TrxItemProcessor2TrxItemChunkProcessorWrapper.wrapIfNeeded(processor); } pr...
return _processor; } @Override public TrxItemExecutorBuilder<IT, RT> setExceptionHandler(@NonNull final ITrxItemExceptionHandler exceptionHandler) { this._exceptionHandler = exceptionHandler; return this; } private final ITrxItemExceptionHandler getExceptionHandler() { return _exceptionHandler; } @Ove...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\processor\api\impl\TrxItemExecutorBuilder.java
1
请在Spring Boot框架中完成以下Java代码
public DeliveryCost importCharges(Amount importCharges) { this.importCharges = importCharges; return this; } /** * Get importCharges * * @return importCharges **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public Amount getImportCharges() { return importCharges; } public void s...
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } DeliveryCost deliveryCost = (DeliveryCost)o; return Objects.equals(this.importCharges, deliveryCost.importCharges) && Objects.equals(this.shippingCost, d...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-ebay\ebay-api-client\src\main\java\de\metas\camel\externalsystems\ebay\api\model\DeliveryCost.java
2
请在Spring Boot框架中完成以下Java代码
class AnnotationDrivenParser implements BeanDefinitionParser { @Override public @Nullable BeanDefinition parse(Element element, ParserContext parserContext) { Object source = parserContext.extractSource(element); // Register component for the surrounding <rabbit:annotation-driven> element. CompositeComponentD...
builder.addPropertyReference("messageHandlerMethodFactory", handlerMethodFactory); } registerInfrastructureBean(parserContext, builder, RabbitListenerConfigUtils.RABBIT_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME); } // Finally register the composite component. parserContext.popAndRegisterContainingCompo...
repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\config\AnnotationDrivenParser.java
2
请完成以下Java代码
private static String getLocationString(@Nullable final LocationId locationId) { if (locationId == null) { return "?"; } final MLocation loc = MLocation.get(Env.getCtx(), locationId.getRepoId(), ITrx.TRXNAME_ThreadInherited); if (loc == null || loc.getC_Location_ID() != locationId.getRepoId()) { ret...
{ locationId = bpLocationId.getLocationCaptureId(); } else { final I_C_BPartner_Location bpLocation = Services.get(IBPartnerDAO.class).getBPartnerLocationByIdEvenInactive(bpLocationId.getBpartnerLocationId()); locationId = bpLocation != null ? LocationId.ofRepoIdOrNull(bpLocation.getC_Location_ID()) : nu...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\tax\api\TaxNotFoundException.java
1
请完成以下Java代码
public int getNonBlockingRetryDeliveryAttempt() { return fromBytes(RetryTopicHeaders.DEFAULT_HEADER_ATTEMPTS); } private int fromBytes(String headerName) { byte[] header = getHeader(headerName, byte[].class); return header == null ? 1 : ByteBuffer.wrap(header).getInt(); } /** * Get a header value with a s...
if (!type.isAssignableFrom(value.getClass())) { throw new IllegalArgumentException("Incorrect type specified for header '" + key + "'. Expected [" + type + "] but actual type is [" + value.getClass() + "]"); } return (T) value; } @Override protected MessageHeaderAccessor createAccessor(Message<?> messag...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\KafkaMessageHeaderAccessor.java
1
请完成以下Java代码
public boolean isIncludeExtensionProperties() { return includeExtensionProperties; } public void setIncludeExtensionProperties(boolean includeExtensionProperties) { this.includeExtensionProperties = includeExtensionProperties; } public static TopicRequestDto fromTopicSubscription(TopicSubscription top...
} if(topicSubscription.getProcessDefinitionVersionTag() != null) { topicRequestDto.setProcessDefinitionVersionTag(topicSubscription.getProcessDefinitionVersionTag()); } if (topicSubscription.getProcessVariables() != null) { topicRequestDto.setProcessVariables(topicSubscription.getProcessVariable...
repos\camunda-bpm-platform-master\clients\java\client\src\main\java\org\camunda\bpm\client\topic\impl\dto\TopicRequestDto.java
1
请完成以下Java代码
public class WEBUI_ServicesCompanies_Toggle_Processed extends JavaProcess implements IProcessPrecondition { private final IQueryBL queryBL = Services.get(IQueryBL.class); private static final String PARAM_PROCESSED = "Processed"; @Param(parameterName = PARAM_PROCESSED, mandatory = true) private boolean processed;...
updateProcessedQuery.create().update(processedUpdater); return MSG_OK; } @Override public ProcessPreconditionsResolution checkPreconditionsApplicable(final @NonNull IProcessPreconditionsContext context) { if (context.getSelectionSize().isNoSelection()) { return ProcessPreconditionsResolution.rejectBecaus...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\issues\WEBUI_ServicesCompanies_Toggle_Processed.java
1
请完成以下Java代码
public class AmqpMessageReturnedException extends AmqpException { @Serial private static final long serialVersionUID = 1866579721126554167L; private final transient ReturnedMessage returned; public AmqpMessageReturnedException(String message, ReturnedMessage returned) { super(message); this.returned = return...
public String getRoutingKey() { return this.returned.getRoutingKey(); } public ReturnedMessage getReturned() { return this.returned; } @Override public String toString() { return "AmqpMessageReturnedException: " + getMessage() + ", " + this.returned.toString(); } }
repos\spring-amqp-main\spring-amqp\src\main\java\org\springframework\amqp\core\AmqpMessageReturnedException.java
1
请完成以下Java代码
public static int toRepoId(@Nullable final RoleId id) { return toRepoId(id, -1); } public static int toRepoId(@Nullable final RoleId id, final int defaultValue) { return id != null ? id.getRepoId() : defaultValue; } public static boolean equals(final RoleId id1, final RoleId id2) { return Objects.equals(...
@Override @JsonValue public int getRepoId() { return repoId; } public boolean isSystem() {return isSystem(repoId);} public static boolean isSystem(final int repoId) {return repoId == SYSTEM.repoId;} public boolean isRegular() {return isRegular(repoId);} public static boolean isRegular(final int repoId) {r...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\RoleId.java
1
请完成以下Java代码
public String toString() { return MoreObjects.toStringHelper(this) .add("fetcher", fetcher) .toString(); } private LookupValuesList getLookupValuesList(final Evaluatee parentEvaluatee) { return cacheByPartition.getOrLoad( createLookupDataSourceContext(parentEvaluatee), evalCtx -> fetcher.retrie...
final LookupValuesList partition = getLookupValuesList(Evaluatees.empty()); return partition.getById(idNormalized); } @Override public @NonNull LookupValuesList findByIdsOrdered(@NonNull final Collection<?> ids) { final ImmutableList<Object> idsNormalized = LookupValue.normalizeIds(ids, fetcher.isNumericKey())...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\lookup\FullyCachedLookupDataSource.java
1
请完成以下Java代码
public void setColumnName (String ColumnName) { set_Value (COLUMNNAME_ColumnName, ColumnName); } public String getColumnName () { return (String)get_Value(COLUMNNAME_ColumnName); } /** Set Query Criteria Function. @param QueryCriteriaFunction column used for adding a sql function to query criteria *...
*/ public String getQueryCriteriaFunction () { return (String)get_Value(COLUMNNAME_QueryCriteriaFunction); } @Override public void setDefaultValue (String DefaultValue) { set_Value (COLUMNNAME_DefaultValue, DefaultValue); } @Override public String getDefaultValue () { return (String)get_Value(COLUM...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_InfoColumn.java
1
请完成以下Java代码
public ResponseEntity<ArticleModel> getArticleBySlug(@PathVariable String slug) { return of(articleService.getArticleBySlug(slug) .map(ArticleModel::fromArticle)); } @PutMapping("/articles/{slug}") public ArticleModel putArticleBySlug(@AuthenticationPrincipal UserJWTPayload jwtPaylo...
return ArticleModel.fromArticle(articleFavorited); } @DeleteMapping("/articles/{slug}/favorite") public ArticleModel unfavoriteArticleBySlug(@AuthenticationPrincipal UserJWTPayload jwtPayload, @PathVariable String slug) { var articleUnfavored = articl...
repos\realworld-springboot-java-master\src\main\java\io\github\raeperd\realworld\application\article\ArticleRestController.java
1
请完成以下Java代码
public void setProcessDefinitionName(String processDefinitionName) { this.processDefinitionName = processDefinitionName; } public void setProcessDefinitionVersion(Integer processDefinitionVersion) { this.processDefinitionVersion = processDefinitionVersion; } public void setDeploymentId...
this.endTime = endTime; } public void setDurationInMillis(Long durationInMillis) { this.durationInMillis = durationInMillis; } public String getDeleteReason() { return deleteReason; } public void setDeleteReason(String deleteReason) { this.deleteReason = deleteReason; ...
repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\HistoricScopeInstanceEntity.java
1
请在Spring Boot框架中完成以下Java代码
public XMLGregorianCalendar getPriceValidTo() { return priceValidTo; } /** * Sets the value of the priceValidTo property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setPriceValidTo(XMLGregorianCalendar value...
* For example, to add a new item, do as follows: * <pre> * getParties().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link BusinessEntityType } * * */ public List<BusinessEntityType> getParties() { ...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\extensions\edifact\PriceSpecificationType.java
2
请完成以下Java代码
public static ITrx unboxToNull(@Nullable final ITrx trx) { return trx != instance ? trx : null; } private NullTrxPlaceholder() { } @Override public String getTrxName() { throw new UnsupportedOperationException(); } @Override public boolean start() { throw new UnsupportedOperationException(); } @...
@Override public boolean rollback(final ITrxSavepoint savepoint) throws DBException { throw new UnsupportedOperationException(); } @Override public ITrxSavepoint createTrxSavepoint(final String name) throws DBException { throw new UnsupportedOperationException(); } @Override public void releaseSavepoint(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\api\NullTrxPlaceholder.java
1
请完成以下Spring Boot application配置
spring: application: name: demo-consumer-application cloud: # Spring Cloud Stream 配置项,对应 BindingServiceProperties 类 stream: # Binding 配置项,对应 BindingProperties Map bindings: demo01-input: destination: DEMO-TOPIC-01 # 目的地。这里使用 RocketMQ Topic content-type: applicatio...
demo01-input: # RocketMQ Consumer 配置项,对应 RocketMQConsumerProperties 类 consumer: enabled: true # 是否开启消费,默认为 true broadcasting: false # 是否使用广播消费,默认为 false 使用集群消费 delay-level-when-next-consume: 0 # 异步消费消息模式下消费失败重试策略,默认为 0 server: port: ${random.int[10000...
repos\SpringBoot-Labs-master\labx-06-spring-cloud-stream-rocketmq\labx-06-sca-stream-rocketmq-consumer-error-handler\src\main\resources\application.yml
2
请在Spring Boot框架中完成以下Java代码
private boolean nullSafeEquals(Object o1, Object o2) { if (o1 == o2) { return true; } return o1 != null && o1.equals(o2); } public static String nestedPrefix(String prefix, String name) { String nestedPrefix = (prefix != null) ? prefix : ""; String dashedName = ConventionUtils.toDashedCase(name); nest...
for (List<T> values : map.values()) { content.addAll(values); } Collections.sort(content); return content; } @Override public String toString() { StringBuilder result = new StringBuilder(); result.append(String.format("items: %n")); this.items.values().forEach((itemMetadata) -> result.append("\t").ap...
repos\spring-boot-4.0.1\configuration-metadata\spring-boot-configuration-processor\src\main\java\org\springframework\boot\configurationprocessor\metadata\ConfigurationMetadata.java
2
请完成以下Java代码
public boolean isPreserveDocumentPostedStatus() { return _preserveDocumentPostedStatus; } /** * If set, the document's "Posted" status shall not been changed. */ public PostingException setPreserveDocumentPostedStatus() { _preserveDocumentPostedStatus = true; resetMessageBuilt(); return this; } pub...
@SuppressWarnings("unused") public PostingException setLogLevel(@NonNull final Level logLevel) { this._logLevel = logLevel; return this; } /** * @return recommended log level to be used when reporting this issue */ public Level getLogLevel() { return _logLevel; } @Override public PostingException s...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\doc\PostingException.java
1
请完成以下Java代码
public class PurchaseOrderPriceCalculator { private final IPricingBL pricingBL = Services.get(IPricingBL.class); PurchaseOrderPricingInfo pricingInfo; @Builder private PurchaseOrderPriceCalculator(@NonNull final PurchaseOrderPricingInfo pricingInfo) { this.pricingInfo = pricingInfo; } public IPricingResult c...
.setOrgId(pricingInfo.getOrgId()) .setProductId(pricingInfo.getProductId()) .setBPartnerId(pricingInfo.getBpartnerId()) .setQty(pricingInfo.getQuantity()) .setConvertPriceToContextUOM(pricingInfo.isConvertPriceToContextUOM()) .setSOTrx(SOTrx.PURCHASE) .setCountryId(pricingInfo.getCountryId()) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\PurchaseOrderPriceCalculator.java
1
请在Spring Boot框架中完成以下Java代码
public static final class AllClusterNotAvailableConditions extends AllNestedConditions { public AllClusterNotAvailableConditions() { super(ConfigurationPhase.PARSE_CONFIGURATION); } @Conditional(ClusterNotAvailableCondition.class) static class IsClusterNotAvailableCondition { } @Conditional(NotCloudFoun...
public static final class NotCloudFoundryEnvironmentCondition implements Condition { @Override public boolean matches(@NonNull ConditionContext context, @NonNull AnnotatedTypeMetadata metadata) { return !CloudPlatform.CLOUD_FOUNDRY.isActive(context.getEnvironment()); } } public static final class NotKubern...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\config\annotation\ClusterNotAvailableConfiguration.java
2
请完成以下Java代码
public class AdminServerModule extends SimpleModule { /** * Construct the module with a pattern for registration metadata keys. The values of * the matched metadata keys will be sanitized before serializing to json. * @param metadataKeyPatterns pattern for metadata keys which should be sanitized */ public Ad...
setMixInAnnotation(InstanceEvent.class, InstanceEventMixin.class); setMixInAnnotation(InstanceInfoChangedEvent.class, InstanceInfoChangedEventMixin.class); setMixInAnnotation(InstanceRegisteredEvent.class, InstanceRegisteredEventMixin.class); setMixInAnnotation(InstanceRegistrationUpdatedEvent.class, InstanceRegi...
repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\utils\jackson\AdminServerModule.java
1
请完成以下Java代码
public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } @Override public void run(String... args) { // Using Security Util to simulate a logged in user securityUtil.logInAs("bob"); // Let's create a Group Task (not assigned, all the me...
// 'john' can see and claim the task logger.info("> john can see the task: " + tasks.getTotalItems()); String availableTaskId = tasks.getContent().get(0).getId(); // Let's claim the task, after the claim, nobody else can see the task and 'john' becomes the assignee logger.info("> Clai...
repos\Activiti-develop\activiti-examples\activiti-api-basic-task-example\src\main\java\org\activiti\examples\DemoApplication.java
1
请完成以下Java代码
final class UserIdWithGroupsCollection { @NonNull public static UserIdWithGroupsCollection of(final Collection<UserGroupUserAssignment> assignments) { if (assignments.isEmpty()) { return EMPTY; } else { return new UserIdWithGroupsCollection(assignments); } } private static final UserIdWithGroups...
throw new AdempiereException("More than one user found for " + assignments); } return userIds.stream().findFirst().orElseThrow(() -> new AdempiereException("UserId should always be present on UserGroupUserAssignment" + assignments)); } public ImmutableSet<UserGroupId> getAssignedGroupIds(@NonNull final Instant ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\user\UserIdWithGroupsCollection.java
1
请完成以下Java代码
public I_ExternalSystem_Config getExternalSystem_Config() { return get_ValueAsPO(COLUMNNAME_ExternalSystem_Config_ID, I_ExternalSystem_Config.class); } @Override public void setExternalSystem_Config(final I_ExternalSystem_Config ExternalSystem_Config) { set_ValueFromPO(COLUMNNAME_ExternalSystem_Config_ID, I_E...
set_ValueNoCheck (COLUMNNAME_ExternalSystem_Config_ProCareManagement_ID, ExternalSystem_Config_ProCareManagement_ID); } @Override public int getExternalSystem_Config_ProCareManagement_ID() { return get_ValueAsInt(COLUMNNAME_ExternalSystem_Config_ProCareManagement_ID); } @Override public void setExternalSyst...
repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Config_ProCareManagement.java
1
请在Spring Boot框架中完成以下Java代码
public void setTerminatedTime(Date terminatedTime) { this.terminatedTime = terminatedTime; } public Date getExitTime() { return exitTime; } public void setExitTime(Date exitTime) { this.exitTime = exitTime; } public Date getEndedTime() { return endedTime; }...
public String getFormKey() { return formKey; } public void setFormKey(String formKey) { this.formKey = formKey; } public String getAssignee() { return assignee; } public void setAssignee(String assignee) { this.assignee = assignee; } public String getC...
repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\planitem\PlanItemInstanceResponse.java
2
请在Spring Boot框架中完成以下Java代码
public List<String> getAccepted() { return (!this.activeProfiles.isEmpty()) ? this.activeProfiles : this.defaultProfiles; } /** * Return if the given profile is active. * @param profile the profile to test * @return if the profile is active */ public boolean isAccepted(String profile) { return getAccept...
this.name = name; this.getter = getter; this.mergeWithEnvironmentProfiles = mergeWithEnvironmentProfiles; this.defaultValue = defaultValue; } String getName() { return this.name; } String[] get(Environment environment) { return this.getter.apply(environment); } Set<String> getDefaultValue(...
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\config\Profiles.java
2
请完成以下Java代码
public static PurchaseOrderAggregationKey fromPurchaseOrderItem(@NonNull final PurchaseOrderItem purchaseOrderItem) { return PurchaseOrderAggregationKey.builder() .orgId(purchaseOrderItem.getOrgId()) .externalSystemId(purchaseOrderItem.getExternalSystemId()) .externalId(purchaseOrderItem.getExternalHeade...
.vendorId(purchaseCandidate.getVendorId()) .datePromised(purchaseCandidate.getPurchaseDatePromised()) .dateOrdered(purchaseCandidate.getPurchaseDateOrdered()) .forecastLineId(purchaseCandidate.getForecastLineId()) .dimension(purchaseCandidate.getDimension()) .externalPurchaseOrderUrl(purchaseCandida...
repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\localorder\PurchaseOrderAggregationKey.java
1
请在Spring Boot框架中完成以下Java代码
public Object findAndRemove() { // 设置查询条件参数 String name = "zhangsansan"; // 创建条件对象 Criteria criteria = Criteria.where("name").is(name); // 创建查询对象,然后将条件对象添加到其中 Query query = new Query(criteria); // 执行删除查找到的匹配的第一条文档,并返回删除的文档信息 User result = mongoTemplate.fin...
// 设置查询条件参数 int age = 22; // 创建条件对象 Criteria criteria = Criteria.where("age").is(age); // 创建查询对象,然后将条件对象添加到其中 Query query = new Query(criteria); // 执行删除查找到的匹配的全部文档,并返回删除的全部文档信息 List<User> resultList = mongoTemplate.findAllAndRemove(query, User.class, COLLECTION_NA...
repos\springboot-demo-master\mongodb\src\main\java\demo\et\mongodb\service\RemoveService.java
2
请完成以下Java代码
public String[] getPermissions() { return permissions; } public void setPermissions(String[] permissions) { this.permissions = permissions; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getGroupId() { retur...
} public void setRootProcessInstanceId(String rootProcessInstanceId) { this.rootProcessInstanceId = rootProcessInstanceId; } public Date getRemovalTime() { return removalTime; } public void setRemovalTime(Date removalTime) { this.removalTime = removalTime; } private static Permission[] getPer...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\authorization\AuthorizationDto.java
1
请在Spring Boot框架中完成以下Java代码
public class WeixinConfigUtil { private static final Log LOG = LogFactory.getLog(WeixinConfigUtil.class); /** * 通过静态代码块读取上传文件的验证格式配置文件,静态代码块只执行一次(单例) */ private static Properties properties = new Properties(); private WeixinConfigUtil() { } // 通过类装载器装载进来 static { try {...
return (String) properties.get(key); } //app_id public static final String appId = (String) properties.get("appId"); //商户号 public static final String mch_id = (String) properties.get("mch_id"); //商户秘钥 public static final String partnerKey = (String) properties.get("partnerKey"); //小程...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\trade\utils\WeixinConfigUtil.java
2
请完成以下Java代码
public final class PublicKeyCredentialRpEntity { private final String name; private final String id; private PublicKeyCredentialRpEntity(String name, String id) { this.name = name; this.id = id; } /** * The <a href= * "https://www.w3.org/TR/webauthn-3/#dom-publickeycredentialentity-name">name</a> * p...
* @since 6.4 */ public static final class PublicKeyCredentialRpEntityBuilder { private @Nullable String name; private @Nullable String id; private PublicKeyCredentialRpEntityBuilder() { } /** * Sets the {@link #getName()} property. * @param name the name property * @return the {@link PublicKey...
repos\spring-security-main\webauthn\src\main\java\org\springframework\security\web\webauthn\api\PublicKeyCredentialRpEntity.java
1
请完成以下Java代码
protected boolean tryReleaseShared(int arg) { for (; ; ) { // 通过循环和CAS来保证安全的释放锁 int count = getState(); if (compareAndSetState(count, count + arg)) { setExclusiveOwnerThread(null); return true; } ...
} @Override public void unlock() { sync.releaseShared(1); } @Override public Condition newCondition() { return sync.newCondition(); } public static void main(String[] args) { final Lock lock = new SharedLock(5); // 启动10个线程 for (int i = 0; i < 100; ...
repos\spring-boot-student-master\spring-boot-student-concurrent\src\main\java\com\xiaolyuh\SharedLock.java
1
请完成以下Java代码
public void setAlwaysReauthenticate(boolean alwaysReauthenticate) { this.alwaysReauthenticate = alwaysReauthenticate; } @Override public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { this.eventPublisher = applicationEventPublisher; } public void setAuthenticationMan...
public void setRunAsManager(RunAsManager runAsManager) { this.runAsManager = runAsManager; } public void setValidateConfigAttributes(boolean validateConfigAttributes) { this.validateConfigAttributes = validateConfigAttributes; } private void publishEvent(ApplicationEvent event) { if (this.eventPublisher != ...
repos\spring-security-main\access\src\main\java\org\springframework\security\access\intercept\AbstractSecurityInterceptor.java
1
请在Spring Boot框架中完成以下Java代码
public void setVerboseMode( boolean verboseMode ) { this.verboseMode = verboseMode; } public boolean setVerboseMode() { return this.verboseMode; } // public static void main(String[] args) { // // // set verboseMode based on the environment variable // verboseMode = ("tru...
// evCacheClientSample.setKey(key, value, ttl); // } // // // Do a "get" for each of those same keys // for (int i = 0; i < 10; i++) { // String key = "key_" + i; // String value = evCacheClientSample.getKey(key); // System.out...
repos\Spring-Boot-In-Action-master\springbt_evcache\src\main\java\cn\codesheep\springbt_evcache\config\EVCacheClientSample.java
2
请完成以下Java代码
private static void logColorUsingJANSI() { AnsiConsole.systemInstall(); System.out.println(ansi().fgRed().a("Some red text").fgYellow().a(" and some yellow text").reset()); AnsiConsole.systemUninstall(); } } /* * More ANSI codes: * * Always conclude your logging with the ANSI reset co...
* 0 = black * 1 = red * 2 = green * 3 = yellow * 4 = blue * 5 = purple * 6 = cyan (light blue) * 7 = white * * \u001B[3#m = color font * \u001B[4#m = color background * \u001B[1;3#m = bold font * \u001B[4;3#m = underlined font * \u001B[3;3#m = italics font (not widely supported, works in VS Code) */
repos\tutorials-master\core-java-modules\core-java-console\src\main\java\com\baeldung\color\PrintColor.java
1
请在Spring Boot框架中完成以下Java代码
public float getCriticalHeapPercentage() { return this.criticalHeapPercentage; } public void setCriticalHeapPercentage(float criticalHeapPercentage) { this.criticalHeapPercentage = criticalHeapPercentage; } public float getCriticalOffHeapPercentage() { return this.criticalOffHeapPercentage; } public void...
return this.compressorBeanName; } public void setCompressorBeanName(String compressorBeanName) { this.compressorBeanName = compressorBeanName; } public String[] getRegionNames() { return this.regionNames; } public void setRegionNames(String[] regionNames) { this.regionNames = regionNames; } }...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\configuration\support\CacheProperties.java
2
请完成以下Java代码
public ITranslatableString toTranslatableString(@NonNull final Money money) { final CurrencyCode currencyCode = currencyRepository.getCurrencyCodeById(money.getCurrencyId()); return TranslatableStrings.builder() .append(money.toBigDecimal(), DisplayType.Amount) .append(" ") .append(currencyCode.toThre...
public Money multiply( @NonNull final Quantity qty, @NonNull final ProductPrice price) { final IUOMConversionBL uomConversionBL = Services.get(IUOMConversionBL.class); final Quantity qtyInPriceUnit = uomConversionBL.convertQuantityTo( qty, UOMConversionContext.of(price.getProductId()), price.getUomI...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\money\MoneyService.java
1
请在Spring Boot框架中完成以下Java代码
public class WarehouseRepository { @NonNull private final IQueryBL queryBL = Services.get(IQueryBL.class); @VisibleForTesting public static WarehouseRepository newInstanceForUnitTesting() { Adempiere.assertUnitTestMode(); return new WarehouseRepository(); } private final CCache<Integer, WarehouseMap> cache ...
@NonNull public ImmutableSet<WarehouseId> getAllActiveIds() { return getWarehouseMap().allActive.stream() .map(Warehouse::getWarehouseId) .collect(ImmutableSet.toImmutableSet()); } // // // // // private static final class WarehouseMap { @Getter private final ImmutableList<Warehouse> allActive; ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\warehouse\WarehouseRepository.java
2
请完成以下Java代码
public String toString() { return "MLanguage[" + getAD_Language() + "-" + getName() + ",Language=" + getLanguageISO() + ",Country=" + getCountryCode() + "]"; } @Override protected boolean beforeSave(final boolean newRecord) { if (is_ValueChanged(COLUMNNAME_DatePattern)) { assertValidDatePattern(t...
} if (datePattern.indexOf("dd") == -1) { throw new AdempiereException("@Error@ @DatePattern@ - No Day (dd)"); } if (datePattern.indexOf("yy") == -1) { throw new AdempiereException("@Error@ @DatePattern@ - No Year (yy)"); } final Locale locale = new Locale(language.getLanguageISO(), language.getCoun...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MLanguage.java
1
请完成以下Java代码
public ChannelDefinitionEntity findChannelDefinitionByKeyAndVersionAndTenantId(String channelDefinitionKey, Integer eventVersion, String tenantId) { Map<String, Object> params = new HashMap<>(); params.put("channelDefinitionKey", channelDefinitionKey); params.put("eventVersion", eventVersion); ...
@Override public long findChannelDefinitionCountByNativeQuery(Map<String, Object> parameterMap) { return (Long) getDbSqlSession().selectOne("selectChannelDefinitionCountByNativeQuery", parameterMap); } @Override public void updateChannelDefinitionTenantIdForDeployment(String deploymentId, Strin...
repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\persistence\entity\data\impl\MybatisChannelDefinitionDataManager.java
1
请完成以下Java代码
public void afterPropertiesSet() throws Exception { this.advisor = new ProcessStartingPointcutAdvisor(this.processEngine); } public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof AopInfrastructureBean) { // Ignore AOP infrastructure such as sco...
// Copy our properties (proxyTargetClass etc) inherited from ProxyConfig. proxyFactory.copyFrom(this); proxyFactory.addAdvisor(this.advisor); return proxyFactory.getProxy(this.beanClassLoader); } } else { // No async proxy needed. return bean; } } public Object postProcessBeforeInitializat...
repos\camunda-bpm-platform-master\engine-spring\core\src\main\java\org\camunda\bpm\engine\spring\components\aop\ProcessStartAnnotationBeanPostProcessor.java
1
请完成以下Java代码
public String getObjectTypeName() { return objectTypeName; } public void setObjectTypeName(String objectTypeName) { this.objectTypeName = objectTypeName; } public String getValueSerialized() { return serializedValue; } public void setSerializedValue(String serializedValue) { this.serializ...
if(value == null) { return null; } else { return value.getClass(); } } @Override public SerializableValueType getType() { return (SerializableValueType) super.getType(); } public void setTransient(boolean isTransient) { this.isTransient = isTransient; } @Override publi...
repos\camunda-bpm-platform-master\commons\typed-values\src\main\java\org\camunda\bpm\engine\variable\impl\value\ObjectValueImpl.java
1
请完成以下Spring Boot application配置
# dubbo 配置项,对应 DubboConfigurationProperties 配置类 dubbo: # Dubbo 应用配置 application: name: user-service-provider # 应用名 # Dubbo 注册中心配置 registry: address: zookeeper://127.0.0.1:2181 # 注册中心地址。配置多注册中心,可见 http://dubbo.apache.org/zh-cn/docs/user/references/registry/introduction.html 文档。 # Dubbo 元数据中心配置 metada...
l/introduction.html 文档 # Dubbo 服务提供者配置 provider: timeout: 1000 # 【重要】远程服务调用超时时间,单位:毫秒。默认为 1000 毫秒,胖友可以根据自己业务修改 UserRpcService: version: 1.0.0 # 配置扫描 Dubbo 自定义的 @Service 注解,暴露成 Dubbo 服务提供者 scan: base-packages: cn.iocoder.springboot.lab30.rpc.service
repos\SpringBoot-Labs-master\lab-30\lab-30-dubbo-annotations-demo\user-rpc-service-provider-02\src\main\resources\application.yaml
2
请完成以下Java代码
public Set<Permission> getCachedPermissions() { return cachedPermissions; } public int getRevisionNext() { return revision + 1; } public Object getPersistentState() { HashMap<String, Object> state = new HashMap<String, Object>(); state.put("userId", userId); state.put("groupId", g...
} public void setRootProcessInstanceId(String rootProcessInstanceId) { this.rootProcessInstanceId = rootProcessInstanceId; } @Override public Set<String> getReferencedEntityIds() { Set<String> referencedEntityIds = new HashSet<String>(); return referencedEntityIds; } @Override public Map<St...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\AuthorizationEntity.java
1
请完成以下Java代码
public TranslatableStringBuilder append(final Boolean value) { if (value == null) { return append("?"); } else { return append(msgBL.getTranslatableMsgText(value)); } } public TranslatableStringBuilder appendADMessage( final AdMessageKey adMessage, final Object... msgParameters) { final I...
final ITranslatableString value = msgBL.getTranslatableMsgText(adMessage, msgParameters); return insertFirst(value); } @Deprecated public TranslatableStringBuilder insertFirstADMessage( final String adMessage, final Object... msgParameters) { return insertFirstADMessage(AdMessageKey.of(adMessage), msgPar...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\TranslatableStringBuilder.java
1
请完成以下Java代码
protected void processEventSync(EventSubscriptionEntity eventSubscriptionEntity, Object payload) { // A compensate event needs to be deleted before the handlers are called if (eventSubscriptionEntity instanceof CompensateEventSubscriptionEntity) { delete(eventSubscriptionEntity); } ...
for (EventSubscriptionEntity eventSubscriptionEntity : result) { signalEventSubscriptionEntities.add((SignalEventSubscriptionEntity) eventSubscriptionEntity); } return signalEventSubscriptionEntities; } protected List<MessageEventSubscriptionEntity> toMessageEventSubscriptionEntityL...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\EventSubscriptionEntityManagerImpl.java
1
请完成以下Java代码
public static void insertMultipleDocumentsWithStringArray() { List<String> coursesList1 = new ArrayList<>(); coursesList1.add("Chemistry"); coursesList1.add("Geography"); Document student1 = new Document().append("studentId", "STUD3") .append("name", "Sarah") .ap...
.append("courses", coursesList); collection.insertOne(student); Bson filter = eq("studentId", "STUD5"); FindIterable<Document> documents = collection.find(filter); MongoCursor<Document> cursor = documents.iterator(); while (cursor.hasNext()) { System.out.println(cu...
repos\tutorials-master\persistence-modules\java-mongodb-3\src\main\java\com\baeldung\mongo\insert\InsertArrayOperation.java
1
请完成以下Java代码
public String translate() { final String msgValue = "de.metas.purchasecandidate.AvailabilityResult_" + this.toString(); return Services.get(IMsgBL.class).translate(Env.getCtx(), msgValue); } public static Type ofAvailabilityResponseItemType(@NonNull final AvailabilityResponseItem.Type type) { if (Avai...
@Builder private AvailabilityResult( @Nullable TrackingId trackingId, @NonNull final Type type, @NonNull final Quantity qty, @Nullable final ZonedDateTime datePromised, @Nullable final String availabilityText, @Nullable final VendorGatewayService vendorGatewayServicethatWasUsed) { this.trackingId ...
repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\availability\AvailabilityResult.java
1
请完成以下Java代码
public int getC_Flatrate_DataEntry_ID() { return get_ValueAsInt(COLUMNNAME_C_Flatrate_DataEntry_ID); } @Override public void setC_UOM_ID (final int C_UOM_ID) { if (C_UOM_ID < 1) set_Value (COLUMNNAME_C_UOM_ID, null); else set_Value (COLUMNNAME_C_UOM_ID, C_UOM_ID); } @Override public int getC_UO...
public int getM_AttributeSetInstance_ID() { return get_ValueAsInt(COLUMNNAME_M_AttributeSetInstance_ID); } @Override public void setQty_Reported (final @Nullable BigDecimal Qty_Reported) { set_Value (COLUMNNAME_Qty_Reported, Qty_Reported); } @Override public BigDecimal getQty_Reported() { final BigDe...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\model\X_C_Flatrate_DataEntry_Detail.java
1
请完成以下Java代码
protected void createJobDefinitionOperationLogEntry(UserOperationLogContext opLogContext, Long previousPriority, JobDefinitionEntity jobDefinition) { PropertyChange propertyChange = new PropertyChange( JOB_DEFINITION_OVERRIDING_PRIORITY, previousPriority, jobDefinition.getOverridingJobPriority()); ...
protected void createCascadeJobsOperationLogEntry(UserOperationLogContext opLogContext, JobDefinitionEntity jobDefinition) { // old value is unknown PropertyChange propertyChange = new PropertyChange( SetJobPriorityCmd.JOB_PRIORITY_PROPERTY, null, jobDefinition.getOverridingJobPriority()); UserOper...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\SetJobDefinitionPriorityCmd.java
1
请完成以下Java代码
private I_M_AttributeSetInstance getFromASI() { return _fromASI; } /** * Sets an M_AttributeSet_ID to override the one that is coming from "fromASI". * <p> * If the parameter is zero or negative, then it will be ignored, so the attribute set from "fromASI" will be used. */ public ASICopy overrideAttribut...
asiDAO.save(toASI); } // // Copy attribute instances for (final I_M_AttributeInstance fromAI : asiDAO.retrieveAttributeInstances(fromASI)) { // Check/skip attribute instance if (isSkip(fromAI)) { continue; } final I_M_AttributeInstance toAI = InterfaceWrapperHelper.newInstance(I_M_Attribu...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\adempiere\mm\attributes\api\ASICopy.java
1
请在Spring Boot框架中完成以下Java代码
public Access anyExchange() { return matcher(PayloadExchangeMatchers.anyExchange()); } protected AuthorizationPayloadInterceptor build() { AuthorizationPayloadInterceptor result = new AuthorizationPayloadInterceptor(this.authzBuilder.build()); result.setOrder(PayloadInterceptorOrder.AUTHORIZATION.getOrder...
public AuthorizePayloadsSpec hasRole(String role) { return access(AuthorityReactiveAuthorizationManager.hasRole(role)); } public AuthorizePayloadsSpec hasAnyRole(String... roles) { return access(AuthorityReactiveAuthorizationManager.hasAnyRole(roles)); } public AuthorizePayloadsSpec permitAll() { ...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\rsocket\RSocketSecurity.java
2
请在Spring Boot框架中完成以下Java代码
public class IssueHierarchy { private final Node<IssueEntity> root; public static IssueHierarchy of(@NonNull final Node<IssueEntity> root) { return new IssueHierarchy(root); } /** * @see Node#listAllNodesBelow() */ public ImmutableList<IssueEntity> listIssues() { return root.listAllNodesBelow() .st...
if (!issue.isPresent()) { return ImmutableList.of(); } return this.root.getNode(issue.get()) .map(Node::getUpStream) .orElse(new ArrayList<>()) .stream() .map(Node::getValue) .collect(ImmutableList.toImmutableList()); } private Optional<IssueEntity> getIssueForId(@NonNull final IssueId ...
repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\issue\hierarchy\IssueHierarchy.java
2
请完成以下Java代码
public Object invoke(InvocationContext ctx) throws Exception { try { Object result = ctx.proceed(); StartProcess startProcessAnnotation = ctx.getMethod().getAnnotation(StartProcess.class); String name = startProcessAnnotation.name(); String key = startProcessAnn...
if (!field.isAnnotationPresent(ProcessVariable.class)) { continue; } field.setAccessible(true); ProcessVariable processStartVariable = field.getAnnotation(ProcessVariable.class); String fieldName = processStartVariable.value(); if (fieldName ==...
repos\flowable-engine-main\modules\flowable-cdi\src\main\java\org\flowable\cdi\impl\annotation\StartProcessInterceptor.java
1
请在Spring Boot框架中完成以下Java代码
public class MSV3ServerRestEndpoint { private static final Logger ROOT_LOGGER = LoggerFactory.getLogger(MSV3ServerRestEndpoint.class.getPackage().getName()); @Autowired private MSV3ServerPeerService msv3ServerPeerService; @GetMapping("/requestUpdateFromServerPeer") public void requestUpdateFromServerPeer() { ...
Level level = getSLF4JRootLogger().getLevel(); return level != null ? level.toString() : null; } private ch.qos.logback.classic.Logger getSLF4JRootLogger() { return (ch.qos.logback.classic.Logger)ROOT_LOGGER; } private static Level toSLF4JLevel(final String logLevelStr) { if (logLevelStr == null) { r...
repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.server\src\main\java\de\metas\vertical\pharma\msv3\server\MSV3ServerRestEndpoint.java
2
请在Spring Boot框架中完成以下Java代码
public class RestTemplateConfiguration { @Bean @LoadBalanced public RestTemplate restTemplate() { return new RestTemplate(); } } @RestController static class TestController { @Autowired private RestTemplate restTemplate; @Autowired ...
return "consumer:" + response; } @GetMapping("/hello02") public String hello02(String name) { // 直接使用 RestTemplate 调用服务 `demo-provider` String targetUrl = "http://demo-provider/echo?name=" + name; String response = restTemplate.getForObject(targetUrl, String....
repos\SpringBoot-Labs-master\labx-02-spring-cloud-netflix-ribbon\labx-02-scn-ribbon-demo02A-consumer\src\main\java\cn\iocoder\springcloudnetflix\labx02\ribbondemo\consumer\DemoConsumerApplication.java
2
请在Spring Boot框架中完成以下Java代码
public ServletApiConfigurer<H> rolePrefix(String rolePrefix) { this.securityContextRequestFilter.setRolePrefix(rolePrefix); return this; } @Override @SuppressWarnings("unchecked") public void configure(H http) { this.securityContextRequestFilter.setAuthenticationManager(http.getSharedObject(AuthenticationMan...
if (trustResolver != null) { this.securityContextRequestFilter.setTrustResolver(trustResolver); } ApplicationContext context = http.getSharedObject(ApplicationContext.class); if (context != null) { context.getBeanProvider(GrantedAuthorityDefaults.class) .ifUnique((grantedAuthorityDefaults) -> this.secur...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\ServletApiConfigurer.java
2
请完成以下Java代码
public Q contentType(String contentType) { return header(HttpBaseRequest.HEADER_CONTENT_TYPE, contentType); } public String getContentType() { return getHeader(HttpBaseRequest.HEADER_CONTENT_TYPE); } @SuppressWarnings("unchecked") public Q payload(String payload) { setRequestParameter(HttpBaseRe...
return method(HttpTrace.METHOD_NAME); } public Map<String, Object> getConfigOptions() { return getRequestParameter(HttpBaseRequest.PARAM_NAME_REQUEST_CONFIG); } public Object getConfigOption(String field) { Map<String, Object> config = getConfigOptions(); if (config != null) { return config...
repos\camunda-bpm-platform-master\connect\http-client\src\main\java\org\camunda\connect\httpclient\impl\AbstractHttpRequest.java
1