instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public String getFilename()
{
return entry.getFilename();
}
@Override
public byte[] getData()
{
final AttachmentEntryService attachmentEntryService = Adempiere.getBean(AttachmentEntryService.class);
return attachmentEntryService.retrieveData(entry.getId());
}
@Override
public String getContentType()
{ | return entry.getMimeType();
}
@Override
public URI getUrl()
{
return entry.getUrl();
}
@Override
public Instant getCreated()
{
return entry.getCreatedUpdatedInfo().getCreated().toInstant();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\attachments\DocumentAttachmentEntry.java | 1 |
请完成以下Java代码 | public boolean isDeveloperMode()
{
return developerModeBL().isEnabled();
}
public boolean getSysConfigBooleanValue(final String sysConfigName, final boolean defaultValue, final int ad_client_id, final int ad_org_id)
{
return sysConfigBL().getBooleanValue(sysConfigName, defaultValue, ad_client_id, ad_org_id);
... | {
migrationLogger().logMigration(session, po, poInfo, actionType);
}
public void fireDocumentNoChange(final PO po, final String value)
{
documentNoBL().fireDocumentNoChange(po, value); // task 09776
}
public ADRefList getRefListById(@NonNull final ReferenceId referenceId)
{
return adReferenceService().get... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\POServicesFacade.java | 1 |
请完成以下Java代码 | public void setC_Workplace_ExternalSystem_ID (final int C_Workplace_ExternalSystem_ID)
{
if (C_Workplace_ExternalSystem_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_Workplace_ExternalSystem_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_Workplace_ExternalSystem_ID, C_Workplace_ExternalSystem_ID);
}
@Override
... | @Override
public void setExternalSystem_ID (final int ExternalSystem_ID)
{
if (ExternalSystem_ID < 1)
set_Value (COLUMNNAME_ExternalSystem_ID, null);
else
set_Value (COLUMNNAME_ExternalSystem_ID, ExternalSystem_ID);
}
@Override
public int getExternalSystem_ID()
{
return get_ValueAsInt(COLUMNNAME_E... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Workplace_ExternalSystem.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserResource {
private UserDaoService service;
public UserResource(UserDaoService service) {
this.service = service;
}
@GetMapping("/users")
public List<User> retrieveAllUsers() {
return service.findAll();
}
//http://localhost:8080/users
//EntityModel
//WebMvcLinkBuilder
@GetMapping... | @DeleteMapping("/users/{id}")
public void deleteUser(@PathVariable int id) {
service.deleteById(id);
}
@PostMapping("/users")
public ResponseEntity<User> createUser(@Valid @RequestBody User user) {
User savedUser = service.save(user);
URI location = ServletUriComponentsBuilder.fromCurrentRequest()
... | repos\master-spring-and-spring-boot-main\12-rest-api\src\main\java\com\in28minutes\rest\webservices\restfulwebservices\user\UserResource.java | 2 |
请完成以下Java代码 | public void setLogoutHandlers(List<LogoutHandler> logoutHandlers) {
this.logoutHandlers = logoutHandlers;
}
@Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
throws IOException, ServletException {
chain.doFilter(this.requestFactory.create((HttpServletRequest) req, (Ht... | Assert.notNull(trustResolver, "trustResolver cannot be null");
this.trustResolver = trustResolver;
updateFactory();
}
private HttpServletRequestFactory createServlet3Factory(String rolePrefix) {
HttpServlet3RequestFactory factory = new HttpServlet3RequestFactory(rolePrefix, this.securityContextRepository);
f... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\servletapi\SecurityContextHolderAwareRequestFilter.java | 1 |
请完成以下Java代码 | private static PurchaseOrderRequestItem createPurchaseOrderRequestItem(final PurchaseCandidate purchaseCandidate)
{
final Quantity qtyToPurchase = purchaseCandidate.getQtyToPurchase();
final ProductAndQuantity productAndQuantity = ProductAndQuantity.of(purchaseCandidate.getVendorProductNo(), qtyToPurchase.toBigDec... | private void updateRemoteLineReference(@NonNull final PurchaseOrderItem purchaseOrderItem)
{
final RemotePurchaseOrderCreatedItem remotePurchaseOrderCreatedItem = map.get(purchaseOrderItem);
final OrderAndLineId purchaseOrderAndLineId = purchaseOrderItem.getPurchaseOrderAndLineId();
final LocalPurchaseOrderFor... | repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\remoteorder\RealVendorGatewayInvoker.java | 1 |
请完成以下Java代码 | public void setAD_Workflow_ID (final int AD_Workflow_ID)
{
if (AD_Workflow_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_Workflow_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_Workflow_ID, AD_Workflow_ID);
}
@Override
public int getAD_Workflow_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_Workflow_ID);
}... | public java.lang.String getDescription()
{
return get_ValueAsString(COLUMNNAME_Description);
}
@Override
public void setName (final java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
@Override
public java.lang.String getName()
{
return get_ValueAsString(COLUMNNAME_Name);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_Block.java | 1 |
请完成以下Java代码 | public class ProductCategoryAccounts
{
@Getter
@NonNull
private final ProductCategoryId productCategoryId;
@Getter
@NonNull
private final AcctSchemaId acctSchemaId;
@Getter
@Nullable
private CostingLevel costingLevel;
@Getter
@Nullable
private CostingMethod costingMethod;
private final ImmutableMap<Strin... | @Nullable final CostingLevel costingLevel,
@Nullable final CostingMethod costingMethod,
@NonNull final Map<String, Optional<AccountId>> accountIdsByColumnName)
{
this.productCategoryId = productCategoryId;
this.acctSchemaId = acctSchemaId;
this.costingLevel = costingLevel;
this.costingMethod = costingMet... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\api\ProductCategoryAccounts.java | 1 |
请完成以下Java代码 | public boolean hasArchive(@NonNull final InvoiceId invoiceId)
{
return getLastArchive(invoiceId).isPresent();
}
private Optional<I_AD_Archive> getLastArchive(@NonNull final InvoiceId invoiceId)
{
return archiveBL.getLastArchiveRecord(TableRecordReference.of(I_C_Invoice.Table_Name, invoiceId));
}
@NonNull
p... | if (documentRecord == null)
{
return Optional.empty();
}
documentBL.processEx(documentRecord, IDocument.ACTION_Reverse_Correct, IDocument.STATUS_Reversed);
final JsonReverseInvoiceResponse.JsonReverseInvoiceResponseBuilder responseBuilder = JsonReverseInvoiceResponse.builder();
invoiceCandDAO
.retri... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v1\invoice\impl\InvoiceService.java | 1 |
请完成以下Java代码 | public class Customer {
private Long ID;
private String name;
private Integer age;
private LocalDateTime createdDate;
public Customer() {
}
public Customer(String name, Integer age) {
this.name = name;
this.age = age;
}
public Customer(Long ID, String name, Intege... | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public LocalDateTime getCreatedDate() {
return createdDa... | repos\spring-boot-master\spring-jdbc\src\main\java\com\mkyong\customer\Customer.java | 1 |
请完成以下Java代码 | public static void layerIterable2(BinTreeNode<String> root, List<String> list) {
LinkedList<BinTreeNode<String>> queue = new LinkedList<>();
if (root == null) {
return;
}
queue.addLast(root);
while (!queue.isEmpty()) {
BinTreeNode<String> p = queue.poll();... | /**
* 左节点
*/
BinTreeNode<T> left;
/**
* 右节点
*/
BinTreeNode<T> right;
public BinTreeNode(T data, BinTreeNode left, BinTreeNode right) {
this.data = data;
this.left = left;
this.right = right;
}
@Ove... | repos\spring-boot-student-master\spring-boot-student-concurrent\src\main\java\com\xiaolyuh\BinTreeIterable.java | 1 |
请完成以下Java代码 | public void usePreparedStatement(){
try {
String insertEmployeeSQL = "INSERT INTO EMPLOYEE(ID, NAME, DESIGNATION) VALUES (?,?,?);";
String insertEmployeeAddrSQL = "INSERT INTO EMP_ADDRESS(ID, EMP_ID, ADDRESS) VALUES (?,?,?);";
PreparedStatement employeeStmt = connection.prepa... | } catch (Exception e) {
try {
connection.rollback();
} catch (SQLException ex) {
System.out.println("Error during rollback");
System.out.println(ex.getMessage());
}
e.printStackTrace(System.out);
}
}
public ... | repos\tutorials-master\persistence-modules\core-java-persistence\src\main\java\com\baeldung\spring\jdbc\BatchProcessing.java | 1 |
请完成以下Java代码 | public class M_Pricelist_Excel extends JavaProcess
{
private static final String AD_PROCESS_VALUE_RV_Fresh_PriceList_ExcelReport = "RV_Fresh_PriceList_ExcelReport";
@Param(parameterName = I_M_PriceList_Version.COLUMNNAME_M_PriceList_Version_ID, mandatory = true)
private int p_M_Pricelist_Version_ID;
@Param(parame... | .addParameter(I_C_BPartner_Location.COLUMNNAME_C_BPartner_Location_ID, p_C_BPartner_Location_ID)
.setJRDesiredOutputType(OutputType.XLS)
.buildAndPrepareExecution()
.onErrorThrowException()
.executeSync()
.getResult();
getProcessInfo().getResult().setReportData(result.getReportData());
retur... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\process\M_Pricelist_Excel.java | 1 |
请完成以下Java代码 | protected void validateType(JavaType type, DeserializationTypeValidator validator, List<String> invalidTypes) {
if (!type.isPrimitive()) {
if (!type.isArrayType()) {
validateTypeInternal(type, validator, invalidTypes);
}
if (type.isMapLikeType()) {
validateType(type.getKeyType(), v... | try {
variableModifications = VariableValueDto.toMap(patch.getModifications(), engine, objectMapper);
} catch (RestException e) {
String errorMessage = String.format("Cannot modify variables for %s: %s", getResourceTypeName(), e.getMessage());
throw new InvalidRequestException(e.getStatus(), e, e... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\impl\AbstractVariablesResource.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ActiveMQConnectionFactory activeMQConnectionFactory() {
ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory();
activeMQConnectionFactory.setBrokerURL(mqBrokerURL);
activeMQConnectionFactory.setUserName(mqUserName);
activeMQConnectionFactory.setPassw... | pooledConnectionFactory.setMaxConnections(maxConnections);
return pooledConnectionFactory;
}
/**
* 商户通知队列模板
*
* @param singleConnectionFactory 连接工厂
* @return 商户通知队列模板
*/
@Bean(name = "notifyJmsTemplate")
public JmsTemplate notifyJmsTemplate(@Qualifier("connectionFactory... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\config\ActiveMqConfig.java | 2 |
请完成以下Java代码 | /* for testing */ void setIncludePort(boolean includePort) {
this.includePort = includePort;
}
@Override
public List<String> shortcutFieldOrder() {
return Collections.singletonList("patterns");
}
@Override
public ShortcutType shortcutType() {
return ShortcutType.GATHER_LIST;
}
@Override
public Predica... | }
@Override
public Object getConfig() {
return config;
}
@Override
public String toString() {
return String.format("Hosts: %s", config.getPatterns());
}
};
}
public static class Config {
private List<String> patterns = new ArrayList<>();
public List<String> getPatterns() {
retu... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\handler\predicate\HostRoutePredicateFactory.java | 1 |
请完成以下Java代码 | public void setTarget(Parameter parameter) {
targetRefAttribute.setReferenceTargetElement(this, parameter);
}
public TransformationExpression getTransformation() {
return transformationChild.getChild(this);
}
public void setTransformation(TransformationExpression transformationExpression) {
transf... | });
sourceRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REF)
.idAttributeReference(Parameter.class)
.build();
targetRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TARGET_REF)
.idAttributeReference(Parameter.class)
.build();
SequenceBuilder seq... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\ParameterMappingImpl.java | 1 |
请完成以下Java代码 | public MClick[] getMClicks()
{
ArrayList<MClick> list = new ArrayList<MClick>();
/** @todo Clicks */
//
MClick[] retValue = new MClick[list.size()];
list.toArray(retValue);
return retValue;
} // getMClicks
/**
* Get Count for date format
* @param DateFormat valid TRUNC date format
* @return count... | //
ValueNamePair[] retValue = new ValueNamePair[list.size()];
list.toArray(retValue);
return retValue;
} // getCount
/**
* Get Monthly Count
* @return monthly count
*/
public ValueNamePair[] getCountQuarter ()
{
return getCount("Q");
} // getCountQuarter
/**
* Get Monthly Count
* @return mon... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MClickCount.java | 1 |
请完成以下Java代码 | public String getContentHTML ()
{
return (String)get_Value(COLUMNNAME_ContentHTML);
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@ret... | /** Get Publication Date.
@return Date on which this article will / should get published
*/
public Timestamp getPubDate ()
{
return (Timestamp)get_Value(COLUMNNAME_PubDate);
}
/** Set Title.
@param Title
Name this entity is referred to as
*/
public void setTitle (String Title)
{
set_Value (COLU... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_NewsItem.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_M_DiscountSchema getM_DiscountSchema()
{
return get_ValueAsPO(COLUMNNAME_M_DiscountSchema_ID, org.compiere.model.I_M_DiscountSchema.class);
}
@Override
public void setM_DiscountSchema(final org.compiere.model.I_M_DiscountSchema M_DiscountSchema)
{
set_ValueFromPO(COLUMNNAME_M_Disco... | }
@Override
public void setM_Product_ID (final int M_Product_ID)
{
if (M_Product_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_Product_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_Product_ID, M_Product_ID);
}
@Override
public int getM_Product_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Product_ID);
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_DiscountSchemaBreak_V.java | 1 |
请完成以下Java代码 | public void setValidFrom (Timestamp ValidFrom)
{
set_Value (COLUMNNAME_ValidFrom, ValidFrom);
}
/** Get Valid from.
@return Valid from including this date (first day)
*/
public Timestamp getValidFrom ()
{
return (Timestamp)get_Value(COLUMNNAME_ValidFrom);
}
/** Set Valid to.
@param ValidTo | Valid to including this date (last day)
*/
public void setValidTo (Timestamp ValidTo)
{
set_Value (COLUMNNAME_ValidTo, ValidTo);
}
/** Get Valid to.
@return Valid to including this date (last day)
*/
public Timestamp getValidTo ()
{
return (Timestamp)get_Value(COLUMNNAME_ValidTo);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_JobAssignment.java | 1 |
请完成以下Java代码 | public String getScriptFormat() {
return scriptFormatAttribute.getValue(this);
}
public void setScriptFormat(String scriptFormat) {
scriptFormatAttribute.setValue(this, scriptFormat);
}
public Script getScript() {
return scriptChild.getChild(this);
}
public void setScript(Script script) {
... | }
public void setCamundaResultVariable(String camundaResultVariable) {
camundaResultVariableAttribute.setValue(this, camundaResultVariable);
}
public String getCamundaResource() {
return camundaResourceAttribute.getValue(this);
}
public void setCamundaResource(String camundaResource) {
camundaR... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\ScriptTaskImpl.java | 1 |
请完成以下Java代码 | public MergePdfByteArrays add(final byte[] pdfByteArray)
{
try
{
final PdfReader reader = new PdfReader(pdfByteArray);
int numberOfPages = reader.getNumberOfPages();
if (this.document == null)
{
this.document = new Document(reader.getPageSizeWithRotation(1));
this.outStream = new ByteArrayOutp... | if (rotation == 90 || rotation == 270)
{
cb.addTemplate(page, 0, -1f, 1f, 0, 0, reader.getPageSizeWithRotation(i).getHeight());
}
else
{
cb.addTemplate(page, 1f, 0, 0, 1f, 0, 0);
}
}
}
}
catch (Exception e)
{
throw new AdempiereException(e);
}
return this;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java\de\metas\printing\MergePdfByteArrays.java | 1 |
请完成以下Java代码 | public void setM_PickingSlot_ID (final int M_PickingSlot_ID)
{
if (M_PickingSlot_ID < 1)
set_Value (COLUMNNAME_M_PickingSlot_ID, null);
else
set_Value (COLUMNNAME_M_PickingSlot_ID, M_PickingSlot_ID);
}
@Override
public int getM_PickingSlot_ID()
{
return get_ValueAsInt(COLUMNNAME_M_PickingSlot_ID);
... | {
return get_ValueAsString(COLUMNNAME_OrderPickingType);
}
@Override
public void setPickFrom_Locator_ID (final int PickFrom_Locator_ID)
{
if (PickFrom_Locator_ID < 1)
set_Value (COLUMNNAME_PickFrom_Locator_ID, null);
else
set_Value (COLUMNNAME_PickFrom_Locator_ID, PickFrom_Locator_ID);
}
@Override... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Workplace.java | 1 |
请完成以下Java代码 | public WFNode unbox() { return node; }
public @NonNull WFNodeId getId() {return node.getId();}
public @NonNull WorkflowId getWorkflowId() { return workflowModel.getId(); }
public @NonNull ClientId getClientId() {return node.getClientId();}
public @NonNull WFNodeAction getAction() {return node.getAction();}
pu... | return node.getTransitions(clientId)
.stream()
.map(transition -> new WorkflowNodeTransitionModel(workflowModel, node.getId(), transition))
.collect(ImmutableList.toImmutableList());
}
public void saveEx()
{
workflowDAO.changeNodeLayout(WFNodeLayoutChangeRequest.builder()
.nodeId(getId())
.xPo... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\wf\WorkflowNodeModel.java | 1 |
请完成以下Java代码 | public FactLineBuilder costElement(@Nullable final CostElementId costElementId)
{
assertNotBuild();
this.costElementId = costElementId;
return this;
}
public FactLineBuilder costElement(@Nullable final CostElement costElement)
{
return costElement(costElement != null ? costElement.getId() : null);
}
pub... | {
assertNotBuild();
this.openItemTrxInfo = openItemTrxInfo;
return this;
}
public FactLineBuilder productId(@Nullable ProductId productId)
{
assertNotBuild();
this.productId = Optional.ofNullable(productId);
return this;
}
public FactLineBuilder userElementString1(@Nullable final String userElementSt... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\FactLineBuilder.java | 1 |
请完成以下Java代码 | protected @Nullable Object convertPayload(Message<?> message) {
return this.delegate.convertPayload(message);
}
@Override
protected Object extractAndConvertValue(ConsumerRecord<?, ?> record, @Nullable Type type) {
Object value = record.value();
if (value == null) {
return KafkaNull.INSTANCE;
}
Class<... | * @param source must not be {@literal null}.
* @return the source instance as byte array.
*/
private static byte[] getAsByteArray(Object source) {
Assert.notNull(source, "Source must not be null");
if (source instanceof String) {
return ((String) source).getBytes(StandardCharsets.UTF_8);
}
if (source ... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\converter\ProjectingMessageConverter.java | 1 |
请完成以下Java代码 | public String getCompositor() {
return compositor;
}
public void setCompositor(String compositor) {
this.compositor = compositor;
}
public String getSinger() {
return singer;
}
public void setSinger(String singer) {
this.singer = singer;
} | public LocalDateTime getReleased() {
return released;
}
public void setReleased(LocalDateTime released) {
this.released = released;
}
public String getGenre() {
return genre;
}
public void setGenre(String genre) {
this.genre = genre;
}
} | repos\tutorials-master\persistence-modules\spring-data-jpa-repo\src\main\java\com\baeldung\jpa\domain\Song.java | 1 |
请完成以下Java代码 | public int getC_BPartner_ID()
{
return get_ValueAsInt(COLUMNNAME_C_BPartner_ID);
}
@Override
public void setC_Invoice_Candidate_HeaderAggregation_ID (final int C_Invoice_Candidate_HeaderAggregation_ID)
{
if (C_Invoice_Candidate_HeaderAggregation_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_Invoice_Candidate_He... | public void setInvoicingGroupNo (final int InvoicingGroupNo)
{
set_ValueNoCheck (COLUMNNAME_InvoicingGroupNo, InvoicingGroupNo);
}
@Override
public int getInvoicingGroupNo()
{
return get_ValueAsInt(COLUMNNAME_InvoicingGroupNo);
}
@Override
public void setIsSOTrx (final boolean IsSOTrx)
{
set_ValueNoCh... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\invoicecandidate\model\X_C_Invoice_Candidate_HeaderAggregation.java | 1 |
请完成以下Java代码 | public static int compute(String a, String b)
{
return ed(a, b);
}
/**
* 编辑距离
*
* @param wrongWord 串A,其实它们两个调换位置还是一样的
* @param rightWord 串B
* @return 它们之间的距离
*/
public static int ed(String wrongWord, String rightWord)
{
final int m = wrongWord.length();... | }
for (int i = 0; i <= m; ++i)
{
d[i][0] = i;
}
for (int i = 1; i <= m; ++i)
{
char ci = wrongWord[i - 1];
for (int j = 1; j <= n; ++j)
{
char cj = rightWord[j - 1];
if (ci == cj)
{
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\algorithm\EditDistance.java | 1 |
请完成以下Java代码 | public Map<Character, Integer> charFrequencyUsingGetOrDefault(String sentence) {
Map<Character, Integer> charMap = new HashMap<>();
for (int c = 0; c < sentence.length(); c++) {
charMap.put(sentence.charAt(c), charMap.getOrDefault(sentence.charAt(c), 0) + 1);
}
return charMap... | }
public Map<Character, AtomicInteger> charFrequencyWithGetAndIncrement(String sentence) {
Map<Character, AtomicInteger> charMap = new HashMap<>();
for (int c = 0; c < sentence.length(); c++) {
charMap.putIfAbsent(sentence.charAt(c), new AtomicInteger(0));
charMap.get(senten... | repos\tutorials-master\core-java-modules\core-java-collections-maps-7\src\main\java\com\baeldung\map\incrementmapkey\IncrementMapValueWays.java | 1 |
请完成以下Java代码 | public static Set<Character> byMap(String input) {
Map<Character, Integer> map = new HashMap<>();
for (char c : input.toCharArray()) {
map.compute(c, (character, count) -> count == null ? 1 : ++count);
}
int maxCount = map.values()
.stream()
.mapToInt(Inte... | public static Set<Character> byBucket(String input) {
int[] buckets = new int[128];
int maxCount = 0;
for (char c : input.toCharArray()) {
buckets[c]++;
maxCount = Math.max(buckets[c], maxCount);
}
int finalMaxCount = maxCount;
return IntStream.r... | repos\tutorials-master\core-java-modules\core-java-string-algorithms-3\src\main\java\com\baeldung\charfreq\CharacterWithHighestFrequency.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JsonWFProcess
{
private static final AdMessageKey NO_ACTIVITY_ERROR_MSG = AdMessageKey.of("de.metas.workflow.rest_api.model.NO_ACTIVITY_ERROR_MSG");
@NonNull String id;
@NonNull JsonWFProcessHeaderProperties headerProperties;
@NonNull List<JsonWFActivity> activities;
boolean isAllowAbort;
public... | uiComponents.get(activity.getId()),
jsonOpts))
.collect(ImmutableList.toImmutableList()))
.isAllowAbort(wfProcess.isAllowAbort())
.build();
}
@JsonIgnore
public JsonWFActivity getActivityById(@NonNull final String activityId)
{
return activities.stream().filter(activity -> activity.getActiv... | repos\metasfresh-new_dawn_uat\backend\de.metas.workflow.rest-api\src\main\java\de\metas\workflow\rest_api\controller\v2\json\JsonWFProcess.java | 2 |
请完成以下Java代码 | public String getCollectionVariable() {
return collectionVariable;
}
public void setCollectionVariable(String collectionVariable) {
this.collectionVariable = collectionVariable;
}
public String getCollectionElementVariable() {
return collectionElementVariable;
}
public... | private static final class CallActivityListenersOperation implements AtomicOperation {
private List<ExecutionListener> listeners;
private CallActivityListenersOperation(List<ExecutionListener> listeners) {
this.listeners = listeners;
}
@Override
public void execute... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\bpmn\behavior\MultiInstanceActivityBehavior.java | 1 |
请完成以下Java代码 | protected void register(String description, ServletContext servletContext) {
try {
servletContext.addListener(this.listener);
}
catch (RuntimeException ex) {
throw new IllegalStateException("Failed to add listener '" + this.listener + "' to servlet context", ex);
}
}
/**
* Returns {@code true} if the... | if (ClassUtils.isAssignableValue(type, listener)) {
return true;
}
}
return false;
}
/**
* Return the supported types for this registration.
* @return the supported types
*/
public static Set<Class<?>> getSupportedTypes() {
return SUPPORTED_TYPES;
}
} | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\web\servlet\ServletListenerRegistrationBean.java | 1 |
请完成以下Java代码 | public int getW_InvActualAdjust_Acct ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_W_InvActualAdjust_Acct);
if (ii == null)
return 0;
return ii.intValue();
}
public I_C_ValidCombination getW_Inventory_A() throws RuntimeException
{
return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombina... | }
public I_C_ValidCombination getW_Revaluation_A() throws RuntimeException
{
return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name)
.getPO(getW_Revaluation_Acct(), get_TrxName()); }
/** Set Inventory Revaluation.
@param W_Revaluation_Acct
Account for Inventory Revaluation
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Warehouse_Acct.java | 1 |
请完成以下Java代码 | public Request build() {
// TODO: validation
return this;
}
@Override
public HttpHeaders getHeaders() {
return httpHeaders;
}
@Override
public HttpMethod getMethod() {
return method;
}
@Override
public @Nullable URI getUri() {
return uri; | }
@Override
public ServerRequest getServerRequest() {
return serverRequest;
}
@Override
public Collection<ResponseConsumer> getResponseConsumers() {
return responseConsumers;
}
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\handler\ProxyExchange.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JsonHUConsolidationJobPickingSlotContent
{
@NonNull PickingSlotId pickingSlotId;
@NonNull JsonDisplayableQRCode pickingSlotQRCode;
@NonNull List<Item> items;
//
//
//
@Value
@Builder
@Jacksonized
public static class Item
{
@NonNull HuId huId;
@NonNull String displayName;
@NonNull String ... | //
//
//
@Value
@Builder
@Jacksonized
public static class ItemStorage
{
@NonNull String productName;
@NonNull BigDecimal qty;
@NonNull String uom;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.hu_consolidation.mobile\src\main\java\de\metas\hu_consolidation\mobile\rest_api\json\JsonHUConsolidationJobPickingSlotContent.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class StudentDaoWithDeprecatedJdbcTemplateMethods {
JdbcTemplate jdbcTemplate;
@Autowired
public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
public List<Student> getStudentsOfAgeAndGender(Integer age, String gender) {
String sql = "s... | public List<Student> getStudentsOfGradeAndState(Integer grade, String state) {
String sql = "select student_id, student_name, age, gender, grade, state from student where grade = ? and state = ?";
Object[] args = {grade, state};
return jdbcTemplate.query(sql, args, new StudentResultExtractor());... | repos\tutorials-master\persistence-modules\spring-jdbc\src\main\java\com\baeldung\spring\jdbc\replacedeprecated\StudentDaoWithDeprecatedJdbcTemplateMethods.java | 2 |
请完成以下Java代码 | public Stream<I_M_AttributeInstance> streamAttributeInstances(
@NonNull final AttributeSetInstanceId asiId,
@NonNull final Set<AttributeId> attributeIds)
{
if (asiId.isNone() || attributeIds.isEmpty())
{
return Stream.of();
}
return queryBL.createQueryBuilder(I_M_AttributeInstance.class)
.addEqua... | {
saveRecord(ai);
}
@Override
public Set<AttributeId> getAttributeIdsByAttributeSetInstanceId(@NonNull final AttributeSetInstanceId attributeSetInstanceId)
{
return queryBL
.createQueryBuilderOutOfTrx(I_M_AttributeInstance.class)
.addEqualsFilter(I_M_AttributeInstance.COLUMN_M_AttributeSetInstance_ID, ... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\adempiere\mm\attributes\api\impl\AttributeSetInstanceDAO.java | 1 |
请完成以下Java代码 | private static @Nullable String extractSessionId(HttpServletRequest request) {
HttpSession session = request.getSession(false);
return (session != null) ? session.getId() : null;
}
/**
* Indicates the TCP/IP address the authentication request was received from.
* @return the address
*/
public String getRe... | WebAuthenticationDetails that = (WebAuthenticationDetails) o;
return Objects.equals(this.remoteAddress, that.remoteAddress) && Objects.equals(this.sessionId, that.sessionId);
}
@Override
public int hashCode() {
return Objects.hash(this.remoteAddress, this.sessionId);
}
@Override
public String toString() {
... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\WebAuthenticationDetails.java | 1 |
请完成以下Java代码 | public class InOutLineMaterialTrackingListener extends MaterialTrackingListenerAdapter
{
public static final transient InOutLineMaterialTrackingListener instance = new InOutLineMaterialTrackingListener();
public static final String LISTENER_TableName = I_M_InOutLine.Table_Name;
/**
* Increase {@link I_M_Material_... | final I_M_InOutLine receiptLine = InterfaceWrapperHelper.create(model, I_M_InOutLine.class);
if (!isEligible(receiptLine, materialTrackingOld))
{
return;
}
final BigDecimal qtyReceivedToRemove = receiptLine.getMovementQty();
final BigDecimal qtyReceived = materialTrackingOld.getQtyReceived();
final BigD... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\spi\impl\listeners\InOutLineMaterialTrackingListener.java | 1 |
请完成以下Java代码 | public List<I_M_HU_Trx_Line> retrieveReferencingTrxLines(final Properties ctx,
final int adTableId, final int recordId,
final String trxName)
{
Check.assume(adTableId > 0, "adTableId > 0");
Check.assume(recordId > 0, "recordId > 0");
final IHUTrxQuery huTrxQuery = createHUTrxQuery();
huTrxQuery.setAD_Ta... | }
if (HUConstants.DEBUG_07277_saveHUTrxLine && trxLineCounterpart.getM_HU_Trx_Line_ID() <= 0)
{
throw new AdempiereException("Counterpart transaction was not saved for " + trxLine
+ "\nCounterpart trx: " + trxLineCounterpart);
}
return trxLineCounterpart;
}
@Override
public List<I_M_HU_Trx_Line> r... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\hutransaction\impl\HUTrxDAO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setJndiName(@Nullable String jndiName) {
this.jndiName = jndiName;
}
public EmbeddedDatabaseConnection getEmbeddedDatabaseConnection() {
return this.embeddedDatabaseConnection;
}
public void setEmbeddedDatabaseConnection(EmbeddedDatabaseConnection embeddedDatabaseConnection) {
this.embeddedDatab... | static class DataSourceBeanCreationException extends BeanCreationException {
private final DataSourceProperties properties;
private final EmbeddedDatabaseConnection connection;
DataSourceBeanCreationException(String message, DataSourceProperties properties,
EmbeddedDatabaseConnection connection) {
super... | repos\spring-boot-4.0.1\module\spring-boot-jdbc\src\main\java\org\springframework\boot\jdbc\autoconfigure\DataSourceProperties.java | 2 |
请完成以下Java代码 | public int getPhase() {
return this.phase;
}
/**
* Set the phase; default is 0.
* @param phase the phase.
*/
public void setPhase(int phase) {
this.phase = phase;
}
/**
* Set to false to prevent automatic startup.
* @param autoStartup the autoStartup.
*/
public void setAutoStartup(boolean autoSt... | @Override
public void stop() {
this.running = false;
}
@Override
public boolean isRunning() {
return this.running;
}
@Override
public boolean isAutoStartup() {
return this.autoStartup;
}
} | repos\spring-amqp-main\spring-rabbit-stream\src\main\java\org\springframework\rabbit\stream\support\StreamAdmin.java | 1 |
请完成以下Java代码 | default void addListener(int index, Listener<K, V> listener) {
}
/**
* Add a listener.
* @param listener the listener.
* @since 2.5.3
*/
default void addListener(Listener<K, V> listener) {
}
/**
* Get the current list of listeners.
* @return the listeners.
* @since 2.5.3
*/
default List<Listener... | }
/**
* Called whenever a consumer is added or removed.
*
* @param <K> the key type.
* @param <V> the value type.
*
* @since 2.5
*
*/
interface Listener<K, V> {
/**
* A new consumer was created.
* @param id the consumer id (factory bean name and client.id separated by a
* period).
* @p... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\core\ConsumerFactory.java | 1 |
请完成以下Java代码 | public String getA_Table_Rate_Type ()
{
return (String)get_Value(COLUMNNAME_A_Table_Rate_Type);
}
/** A_Term AD_Reference_ID=53256 */
public static final int A_TERM_AD_Reference_ID=53256;
/** Period = PR */
public static final String A_TERM_Period = "PR";
/** Yearly = YR */
public static final String A_TERM... | public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Processed.
@param Processed
The document has been processed
*/
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Processed.
@return T... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Depreciation_Table_Header.java | 1 |
请完成以下Java代码 | public boolean isApproved()
{
return approvalStatus != null && approvalStatus.isApproved();
}
private boolean isEligibleForChangingPickStatus()
{
return !isProcessed()
&& getType().isPickable();
}
public boolean isEligibleForPicking()
{
return isEligibleForChangingPickStatus()
&& !isApproved()
... | && pickStatus.isEligibleForPacking();
}
public boolean isEligibleForReview()
{
return isEligibleForChangingPickStatus()
&& pickStatus != null
&& pickStatus.isEligibleForReview();
}
public boolean isEligibleForProcessing()
{
return isEligibleForChangingPickStatus()
&& pickStatus != null
&& pi... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pickingV2\productsToPick\rows\ProductsToPickRow.java | 1 |
请完成以下Java代码 | private DocTypeId getOrderDocTypeId(
@Nullable final JsonDocTypeInfo orderDocumentType,
@Nullable final OrgId orgId)
{
if (orderDocumentType == null)
{
return null;
}
if (orgId == null)
{
throw new InvalidEntityException(TranslatableStrings.constant(
"When specifying Order Document Type, th... | .map(DocBaseType::ofCode)
.orElse(null);
final DocSubType subType = Optional.of(orderDocumentType)
.map(JsonDocTypeInfo::getDocSubType)
.map(DocSubType::ofNullableCode)
.orElse(DocSubType.ANY);
return Optional.ofNullable(docBaseType)
.map(baseType -> docTypeService.getDocTypeId(docBaseType, su... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\invoicecandidates\impl\InvoiceJsonConverters.java | 1 |
请完成以下Java代码 | public Window asAWTWindow()
{
return this;
}
@Override
public void showCenterScreen()
{
validate();
pack();
AEnv.showCenterWindow(parentFrame, this);
}
@Override
public void dispose()
{
final ProcessPanel panel = this.panel;
if (panel != null)
{
panel.dispose();
this.panel = null;
}
... | {
final ProcessPanel panel = this.panel;
return panel == null || panel.isDisposed();
}
@Override
public void setVisible(final boolean visible)
{
super.setVisible(visible);
final ProcessPanel panel = this.panel;
if (panel != null)
{
panel.setVisible(visible);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\de\metas\process\ui\ProcessModalDialog.java | 1 |
请完成以下Java代码 | private Map<String, Pattern> getPatterns(Map<?, ?> properties, String prefix) {
Map<String, Pattern> patterns = new LinkedHashMap<>();
properties.forEach((key, value) -> {
String name = String.valueOf(key);
if (name.startsWith(prefix)) {
Pattern pattern = Pattern.compile((String) value);
patterns.put(... | static DevToolsSettings load() {
return load(SETTINGS_RESOURCE_LOCATION);
}
static DevToolsSettings load(String location) {
try {
DevToolsSettings settings = new DevToolsSettings();
Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(location);
while (urls.hasMoreElements... | repos\spring-boot-4.0.1\module\spring-boot-devtools\src\main\java\org\springframework\boot\devtools\settings\DevToolsSettings.java | 1 |
请完成以下Java代码 | public class ItemInstance {
protected ItemDefinition item;
protected StructureInstance structureInstance;
public ItemInstance(ItemDefinition item, StructureInstance structureInstance) {
this.item = item;
this.structureInstance = structureInstance;
}
public ItemDefinition getItem(... | return this.structureInstance;
}
private FieldBaseStructureInstance getFieldBaseStructureInstance() {
return (FieldBaseStructureInstance) this.structureInstance;
}
public Object getFieldValue(String fieldName) {
return this.getFieldBaseStructureInstance().getFieldValue(fieldName);
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\data\ItemInstance.java | 1 |
请完成以下Java代码 | public List<PickFromHU> getPickFromHUs()
{
return pickFromHUs;
}
public String getDescription()
{
final StringBuilder description = new StringBuilder();
for (final PickFromHU pickFromHU : pickFromHUs)
{
final String huValue = String.valueOf(pickFromHU.getHuId().getRepoId());
if (description.length() ... | public Map<I_M_Attribute, Object> getAttributes()
{
return attributes;
}
//
// ---------------------------------------------------------------
//
@Value
@Builder
public static class PickFromHU
{
@NonNull HuId huId;
@NonNull Quantity qtyToPick;
@NonNull Quantity qtyToPickInStockingUOM;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\distribution\ddorder\producer\DDOrderLineCandidate.java | 1 |
请完成以下Java代码 | private void growScrollbars()
{
// fatter scroll bars
Container p = getParent();
if (p instanceof JViewport)
{
Container gp = p.getParent();
if (gp instanceof JScrollPane)
{
JScrollPane scrollPane = (JScrollPane)gp;
scrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(SCROLL_Size, ... | return id == null ? -1 : id.intValue();
}
}
return -1;
}
public void selectById(int id)
{
selectById(id, true);
}
public void selectById(int id, boolean fireEvent)
{
if (idColumnIndex < 0)
return;
boolean fireSelectionEventOld = fireSelectionEvent;
try
{
fireSelectionEvent = fireEvent;
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\ui\swing\MiniTable2.java | 1 |
请完成以下Java代码 | protected List<InetAddress> getLocalAllInetAddress() throws Exception {
List<InetAddress> result = new ArrayList<>(4);
// 遍历所有的网络接口
for (Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); networkInterfaces.hasMoreElements(); ) {
NetworkInterfa... | try {
byte[] mac = NetworkInterface.getByInetAddress(inetAddr).getHardwareAddress();
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < mac.length; i++) {
if (i != 0) {
stringBuilder.append("-");
}
... | repos\springboot-demo-master\SoftwareLicense\src\main\java\com\et\license\license\AbstractServerInfos.java | 1 |
请完成以下Spring Boot application配置 | server:
port: 8090
spring:
security:
oauth2:
client:
provider:
spring-auth-server:
issuer-uri: http://localhost:8080
registration:
test-client:
provider: spring-auth-server
client-name: test-client
client-id: ignored # D... | registration-endpoint: http://localhost:8080/connect/register
registration-username: registrar-client
registration-password: secret
token-endpoint: http://localhost:8080/oauth2/token
registration-scopes: client.create
grant-types: client_credentials | repos\tutorials-master\spring-security-modules\spring-security-dynamic-registration\oauth2-dynamic-client\src\main\resources\application.yaml | 2 |
请完成以下Java代码 | public class CustomerDeserializer extends StdDeserializer<Customer> {
private static final long serialVersionUID = 1L;
public CustomerDeserializer() {
this(null);
}
public CustomerDeserializer(Class<Customer> t) {
super(t);
}
@Override
public Customer deserialize(JsonParse... | feedback.setStreet(node.get(3)
.asText());
feedback.setPostalCode(node.get(4)
.asText());
feedback.setCity(node.get(5)
.asText());
feedback.setState(node.get(6)
.asText());
JsonNode phoneNumber = node.get(7);
feedback.setPhoneNumber... | repos\tutorials-master\json-modules\json-2\src\main\java\com\baeldung\jsonoptimization\CustomerDeserializer.java | 1 |
请完成以下Java代码 | public class SetRemovalTimeToHistoricDecisionInstancesBuilderImpl implements SetRemovalTimeSelectModeForHistoricDecisionInstancesBuilder {
protected HistoricDecisionInstanceQuery query;
protected List<String> ids;
protected Date removalTime;
protected Mode mode = null;
protected boolean isHierarchical;
pr... | mode = Mode.CLEARED_REMOVAL_TIME;
return this;
}
public SetRemovalTimeToHistoricDecisionInstancesBuilder hierarchical() {
isHierarchical = true;
return this;
}
public Batch executeAsync() {
return commandExecutor.execute(new SetRemovalTimeToHistoricDecisionInstancesCmd(this));
}
public Hi... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\SetRemovalTimeToHistoricDecisionInstancesBuilderImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class RelatedInvoicesForSubscriptionsProvider implements RelatedRecordsProvider
{
@Override
public SourceRecordsKey getSourceRecordsKey()
{
return SourceRecordsKey.of(I_C_Flatrate_Term.Table_Name);
}
@Override
public IPair<SourceRecordsKey, List<ITableRecordReference>> provideRelatedRecords(
@NonNull... | .addOnlyActiveRecordsFilter()
.andCollect(I_C_Invoice_Line_Alloc.COLUMN_C_InvoiceLine_ID)
.andCollect(I_C_InvoiceLine.COLUMN_C_Invoice_ID)
.create()
.listIds()
.stream()
.map(invoiceRepoId -> TableRecordReference.of(I_C_Invoice.Table_Name, invoiceRepoId))
.collect(ImmutableList.toImmutableLi... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\subscription\order\restart\RelatedInvoicesForSubscriptionsProvider.java | 2 |
请完成以下Java代码 | void shutDownGracefully(GracefulShutdownCallback callback) {
logger.info("Commencing graceful shutdown. Waiting for active requests to complete");
CountDownLatch shutdownUnderway = new CountDownLatch(1);
new Thread(() -> doShutdown(callback, shutdownUnderway), "tomcat-shutdown").start();
try {
shutdownUnderw... | for (Container host : this.tomcat.getEngine().findChildren()) {
for (Container context : host.findChildren()) {
while (!this.aborted && isActive(context)) {
Thread.sleep(50);
}
}
}
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
private boolean isActive... | repos\spring-boot-4.0.1\module\spring-boot-tomcat\src\main\java\org\springframework\boot\tomcat\GracefulShutdown.java | 1 |
请完成以下Java代码 | public void createWorkFlowAndBom(final I_PP_Order ppOrderRecord)
{
createWorkflowAndBOM(ppOrderRecord);
}
@ModelChange(timings = ModelValidator.TYPE_AFTER_CHANGE,
ifColumnsChanged = {
I_PP_Order.COLUMNNAME_QtyEntered,
I_PP_Order.COLUMNNAME_DateStartSchedule,
I_PP_Order.COLUMNNAME_AD_Workflow_ID,... | final PPOrderId ppOrderId = PPOrderId.ofRepoId(ppOrder.getPP_Order_ID());
orderCostsService.deleteByOrderId(ppOrderId);
deleteWorkflowAndBOM(ppOrderId);
}
}
@ModelChange(timings = { ModelValidator.TYPE_BEFORE_CHANGE, ModelValidator.TYPE_BEFORE_NEW },
ifColumnsChanged = { I_PP_Order.COLUMNNAME_M_Product_I... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\model\validator\PP_Order.java | 1 |
请完成以下Java代码 | public static IncotermsId ofObject(@NonNull final Object object)
{
return RepoIdAwares.ofObject(object, IncotermsId.class, IncotermsId::ofRepoId);
}
public static int toRepoId(@Nullable final IncotermsId incotermsId)
{
return toRepoIdOr(incotermsId, -1);
}
public static int toRepoIdOr(@Nullable final Incote... | private IncotermsId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "C_Incoterms_ID");
}
@JsonValue
public int toJson()
{
return getRepoId();
}
public static boolean equals(@Nullable final IncotermsId o1, @Nullable final IncotermsId o2)
{
return Objects.equals(o1, o2);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\incoterms\IncotermsId.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ProjectInfoProperties {
private final Build build = new Build();
private final Git git = new Git();
public Build getBuild() {
return this.build;
}
public Git getGit() {
return this.git;
}
/**
* Build specific info properties.
*/
public static class Build {
/**
* Location of the g... | */
private Resource location = new ClassPathResource("git.properties");
/**
* File encoding.
*/
private Charset encoding = StandardCharsets.UTF_8;
public Resource getLocation() {
return this.location;
}
public void setLocation(Resource location) {
this.location = location;
}
public Chars... | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\info\ProjectInfoProperties.java | 2 |
请完成以下Java代码 | public ExternalSystemId getExternalSystemIdByExternalSystemCode(@NonNull final JsonPurchaseCandidateCreateItem request)
{
return externalSystemRepository.getIdByType(ExternalSystemType.ofValue(request.getExternalSystemCode()));
}
@Nullable
public String getExternalSystemTypeById(@NonNull final PurchaseCandidate ... | final List<ExternalSystemIdWithExternalIds> externalSystemIdWithExternalIds = new ArrayList<>();
for (final JsonPurchaseCandidateReference cand : candidates)
{
final ExternalHeaderIdWithExternalLineIds headerAndLineId = ExternalHeaderIdWithExternalLineIds.builder()
.externalHeaderId(JsonExternalIds.toExtern... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\order\POJsonConverters.java | 1 |
请完成以下Java代码 | public TaxAmountType1Choice getTp() {
return tp;
}
/**
* Sets the value of the tp property.
*
* @param value
* allowed object is
* {@link TaxAmountType1Choice }
*
*/
public void setTp(TaxAmountType1Choice value) {
this.tp = value;
}
... | */
public ActiveOrHistoricCurrencyAndAmount getAmt() {
return amt;
}
/**
* Sets the value of the amt property.
*
* @param value
* allowed object is
* {@link ActiveOrHistoricCurrencyAndAmount }
*
*/
public void setAmt(ActiveOrHistoricCurrencyAndAm... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\TaxAmountAndType1.java | 1 |
请完成以下Java代码 | public void setIsFetchedFrom (final boolean IsFetchedFrom)
{
set_Value (COLUMNNAME_IsFetchedFrom, IsFetchedFrom);
}
@Override
public boolean isFetchedFrom()
{
return get_ValueAsBoolean(COLUMNNAME_IsFetchedFrom);
}
@Override
public void setIsPayFrom (final boolean IsPayFrom)
{
set_Value (COLUMNNAME_IsP... | public java.lang.String getName()
{
return get_ValueAsString(COLUMNNAME_Name);
}
/**
* Role AD_Reference_ID=541254
* Reference name: Role
*/
public static final int ROLE_AD_Reference_ID=541254;
/** Main Producer = MP */
public static final String ROLE_MainProducer = "MP";
/** Hostpital = HO */
publi... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_BP_Relation.java | 1 |
请完成以下Java代码 | public BooleanWithReason recomputeSumsFromLines()
{
if (isImported)
{
//leave the values as is if the record was imported
return BooleanWithReason.falseBecause("The remittance advice is imported!");
}
Amount remittedAmountSumAmount = null;
Amount paymentDiscountAmountSumAmount = null;
Amount service... | }
public void setPaymentId(@NonNull final PaymentId paymentId)
{
this.paymentId = paymentId;
}
/**
* @return true, if acknowledged status changed, false otherwise
*/
public boolean recomputeIsDocumentAcknowledged()
{
final boolean isDocumentAcknowledged_refreshedValue = lines.stream().allMatch(Remittanc... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\remittanceadvice\RemittanceAdvice.java | 1 |
请完成以下Java代码 | public ELContext build() {
CompositeELResolver elResolver = createCompositeResolver();
return new ActivitiElContext(elResolver);
}
public ELContext buildWithCustomFunctions(List<CustomFunctionProvider> customFunctionProviders) {
CompositeELResolver elResolver = createCompositeResolver()... | }
} catch (NoSuchMethodException e) {
logger.error("Error setting up EL custom functions", e);
}
return elContext;
}
private void addResolvers(CompositeELResolver compositeResolver) {
Stream.ofNullable(resolvers).flatMap(Collection::stream).forEach(compositeResolver:... | repos\Activiti-develop\activiti-core-common\activiti-expression-language\src\main\java\org\activiti\core\el\ELContextBuilder.java | 1 |
请完成以下Java代码 | public CostDetailCreateRequest withQty(@NonNull final Quantity qty)
{
if (Objects.equals(this.qty, qty))
{
return this;
}
return toBuilder().qty(qty).build();
}
public CostDetailCreateRequest withQtyZero()
{
return withQty(qty.toZero());
}
public CostDetailBuilder toCostDetailBuilder()
{
final ... | .attributeSetInstanceId(getAttributeSetInstanceId())
//
.amtType(getAmtType())
.amt(getAmt())
.qty(getQty())
//
.documentRef(getDocumentRef())
.description(getDescription())
.dateAcct(getDate());
if (isExplicitCostElement())
{
costDetail.costElementId(getCostElementId());
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\CostDetailCreateRequest.java | 1 |
请完成以下Java代码 | public class LocalDateRestVariableConverter implements RestVariableConverter {
@Override
public String getRestTypeName() {
return "localDate";
}
@Override
public Class<?> getVariableType() {
return LocalDate.class;
}
@Override
public Object getVariableValue(EngineRestV... | throw new FlowableIllegalArgumentException("The given variable value is not a localDate: '" + result.getValue() + "'", e);
}
}
return null;
}
@Override
public void convertVariableValue(Object variableValue, EngineRestVariable result) {
if (variableValue != null) {
... | repos\flowable-engine-main\modules\flowable-common-rest\src\main\java\org\flowable\common\rest\variable\LocalDateRestVariableConverter.java | 1 |
请完成以下Java代码 | public String getSecureHttpHeadersAsString() {
return secureHttpHeaders != null ? secureHttpHeaders.formatAsString(true) : null;
}
public void setSecureHttpHeaders(HttpHeaders secureHttpHeaders) {
this.secureHttpHeaders = secureHttpHeaders;
}
public String getBody() {
return bo... | return formParameters;
}
public void addFormParameter(String key, String value) {
if (body != null) {
throw new FlowableIllegalStateException("Cannot set both body and form parameters");
} else if (multiValueParts != null && !multiValueParts.isEmpty()) {
throw new Flowab... | repos\flowable-engine-main\modules\flowable-http-common\src\main\java\org\flowable\http\common\api\HttpRequest.java | 1 |
请完成以下Java代码 | public void debugConcurrentScopeIsPruned(PvmExecutionImpl execution) {
logDebug(
"036", "Concurrent scope is pruned {}", execution);
}
public void debugCancelConcurrentScopeExecution(PvmExecutionImpl execution) {
logDebug(
"037", "Cancel concurrent scope execution {}", execution);
}
pu... | public ProcessEngineException missingBoundaryCatchEventError(String executionId, String errorCode, String errorMessage) {
return new ProcessEngineException(
exceptionMessage(
"042",
"Execution with id '{}' throws an error event with errorCode '{}' and errorMessage '{}', but no error handler wa... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\behavior\BpmnBehaviorLogger.java | 1 |
请完成以下Java代码 | public int getCM_NewsChannel_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_CM_NewsChannel_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set News Item / Article.
@param CM_NewsItem_ID
News item or article defines base content
*/
public void setCM_NewsItem_ID (int CM_NewsItem_ID)... | /** Set LinkURL.
@param LinkURL
Contains URL to a target
*/
public void setLinkURL (String LinkURL)
{
set_Value (COLUMNNAME_LinkURL, LinkURL);
}
/** Get LinkURL.
@return Contains URL to a target
*/
public String getLinkURL ()
{
return (String)get_Value(COLUMNNAME_LinkURL);
}
/** Set Publicat... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_NewsItem.java | 1 |
请完成以下Java代码 | public final class NetUtils
{
private NetUtils()
{
}
/**
*
* @return never returns <code>null</code>
*/
public static IHostIdentifier getLocalHost()
{
InetAddress localHostAddress;
try
{
localHostAddress = InetAddress.getLocalHost();
}
catch (final UnknownHostException e)
{
// fallback
... | if (_hashcode == null)
{
_hashcode = Objects.hash(hostName, hostAddress);
}
return _hashcode;
}
@Override
public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj instanceof HostIdentifier)
{
final HostIdentifier other = (HostIdentifier)obj;
r... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\net\NetUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getReferenceId() {
return referenceId;
}
public void setReferenceId(String referenceId) {
this.referenceId = referenceId;
}
public String getReferenceType() {
return referenceType;
}
public void setReferenceType(String referenceType) {
this.refere... | this.withoutTenantId = withoutTenantId;
}
public Boolean getIncludeLocalVariables() {
return includeLocalVariables;
}
public void setIncludeLocalVariables(Boolean includeLocalVariables) {
this.includeLocalVariables = includeLocalVariables;
}
public Set<String> getCaseInstanceI... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\history\planitem\HistoricPlanItemInstanceQueryRequest.java | 2 |
请在Spring Boot框架中完成以下Java代码 | protected Class<? extends Annotation> getAnnotationType() {
return EnableDurableClient.class;
}
@Override
@SuppressWarnings("all")
public void setImportMetadata(AnnotationMetadata importMetadata) {
if (isAnnotationPresent(importMetadata)) {
AnnotationAttributes enableDurableClientAttributes = getAnnotatio... | protected Boolean getReadyForEvents() {
return this.readyForEvents != null
? this.readyForEvents
: DEFAULT_READY_FOR_EVENTS;
}
protected Logger getLogger() {
return this.logger;
}
@Bean
ClientCacheConfigurer clientCacheDurableClientConfigurer() {
return (beanName, clientCacheFactoryBean) -> getDura... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\config\annotation\DurableClientConfiguration.java | 2 |
请完成以下Java代码 | public boolean isNegateToConvertToRealValue()
{
return getToRealValueMultiplier() < 0;
}
private int getToRealValueMultiplier()
{
int toRealValueMultiplier = this.toRealValueMultiplier;
if (toRealValueMultiplier == 0)
{
toRealValueMultiplier = this.toRealValueMultiplier = computeToRealValueMultiplier();... | {
final int multiplier = computeFromNotAdjustedAmountMultiplier();
return multiplier > 0 ? money : money.negate();
}
private int computeFromNotAdjustedAmountMultiplier()
{
int multiplier = 1;
// Do we have to SO adjust?
if (isAPAdjusted)
{
final int multiplierAP = soTrx.isPurchase() ? -1 : +1;
mu... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\InvoiceAmtMultiplier.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class FailedJobListener implements CommandContextCloseListener {
private static final Logger LOGGER = LoggerFactory.getLogger(FailedJobListener.class);
protected CommandExecutor commandExecutor;
protected Job job;
protected JobServiceConfiguration jobServiceConfiguration;
public FailedJobL... | }
}
@Override
public void closeFailure(CommandContext commandContext) {
FlowableEventDispatcher eventDispatcher = jobServiceConfiguration.getEventDispatcher();
if (eventDispatcher != null && eventDispatcher.isEnabled()) {
eventDispatcher.dispatchEvent(FlowableJobEventBuilder.cre... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\asyncexecutor\FailedJobListener.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public RecordMessageConverter converter() {
JsonMessageConverter converter = new JsonMessageConverter();
DefaultJackson2JavaTypeMapper typeMapper = new DefaultJackson2JavaTypeMapper();
typeMapper.setTypePrecedence(TypePrecedence.TYPE_ID);
typeMapper.addTrustedPackages("com.common");
Map<String, Class<?>> mapp... | @Bean
public NewTopic bars() {
return new NewTopic("bars", 1, (short) 1);
}
@Bean
@Profile("default") // Don't run from test(s)
public ApplicationRunner runner() {
return args -> {
System.out.println("Hit Enter to terminate...");
System.in.read();
};
}
} | repos\spring-kafka-main\samples\sample-02\src\main\java\com\example\Application.java | 2 |
请完成以下Java代码 | public class Brand {
/**
* The name of the brand.
*/
private String name;
/**
* Instantiates a new Brand.
*
* @param name
* the {@link #name}
*/
public Brand(String name) {
this.name = name;
}
/** | * Gets the {@link #name}.
*
* @return the {@link #name}
*/
public String getName() {
return name;
}
/**
* Sets the {@link #name}.
*
* @param name
* the new {@link #name}
*/
public void setName(String name) {
this.name = name;
}
} | repos\tutorials-master\di-modules\dagger\src\main\java\com\baeldung\dagger\intro\Brand.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserData {
private final UserId userId;
private final Password password;
private final Set<RoleId> roles;
@JsonCreator
public UserData(@JsonProperty("userId") UserId userId,
@JsonProperty("password") Password password,
@JsonProperty("roles") Set... | for (String role: roles) {
this.roles.add(new RoleId(role));
}
}
public UserId getUserId() {
return userId;
}
public boolean verifyPassword(String password) {
return this.password.verify(password);
}
public Set<RoleId> getRoles() {
return roles;
... | repos\spring-examples-java-17\spring-security\src\main\java\itx\examples\springboot\security\springsecurity\services\dto\UserData.java | 2 |
请完成以下Java代码 | public List<SignaturePropertyType> getSignatureProperty() {
if (signatureProperty == null) {
signatureProperty = new ArrayList<SignaturePropertyType>();
}
return this.signatureProperty;
}
/**
* Gets the value of the id property.
*
* @return
* possibl... | }
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
} | 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\SignaturePropertiesType.java | 1 |
请完成以下Java代码 | public final class KeyNamePairList
{
@JsonCreator
public static final KeyNamePairList of(@JsonProperty("l") final Collection<KeyNamePair> values)
{
if (values == null || values.isEmpty())
{
return EMPTY;
}
return new KeyNamePairList(values);
}
public static final KeyNamePairList of(final KeyNamePair[... | public static final KeyNamePairList of()
{
return EMPTY;
}
public static final KeyNamePairList EMPTY = new KeyNamePairList(ImmutableList.<KeyNamePair> of());
@JsonProperty("l")
private final List<KeyNamePair> values;
private KeyNamePairList(final Collection<KeyNamePair> values)
{
super();
this.values = ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\KeyNamePairList.java | 1 |
请完成以下Java代码 | private AdMessageKey getNotificationAD_Message(final I_M_InOut inout) {return inout.isSOTrx() ? MSG_Event_RETURN_FROM_CUSTOMER_Generated : MSG_Event_RETURN_TO_VENDOR_Generated;}
private UserId getNotificationRecipientUserId(final I_M_InOut inout)
{
//
// In case of reversal i think we shall notify the current us... | return UserId.ofRepoId(inout.getUpdatedBy()); // last updated
}
//
// Fallback: notify only the creator
else
{
return UserId.ofRepoId(inout.getCreatedBy());
}
}
private void postNotifications(final List<UserNotificationRequest> notifications)
{
Services.get(INotificationBL.class).sendAfterCommit(no... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inout\event\ReturnInOutUserNotificationsProducer.java | 1 |
请完成以下Spring Boot application配置 | spring.application.name=spring-ai-groq-demo
spring.ai.openai.base-url=https://api.groq.com/openai
spring.ai.openai.api-key=gsk_XXXX
spring.ai.openai.chat.base-url=https://api.groq.com/openai
spring.ai.openai.chat.api-key=gsk_XXXX
spri | ng.ai.openai.chat.options.temperature=0.7
spring.ai.openai.chat.options.model=llama-3.3-70b-versatile | repos\tutorials-master\spring-ai-modules\spring-ai-2\src\main\resources\application-groq.properties | 2 |
请完成以下Java代码 | public java.lang.String getProductName()
{
return get_ValueAsString(COLUMNNAME_ProductName);
}
@Override
public void setProductValue (final @Nullable java.lang.String ProductValue)
{
set_Value (COLUMNNAME_ProductValue, ProductValue);
}
@Override
public java.lang.String getProductValue()
{
return get_... | public void setQtyOrdered (final @Nullable BigDecimal QtyOrdered)
{
set_Value (COLUMNNAME_QtyOrdered, QtyOrdered);
}
@Override
public BigDecimal getQtyOrdered()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyOrdered);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setQty... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_RV_HU_Quantities.java | 1 |
请完成以下Java代码 | private boolean checkLimits(TenantId tenantId) {
if (debugModeRateLimitsConfig.isCalculatedFieldDebugPerTenantLimitsEnabled() &&
!rateLimitService.checkRateLimit(LimitedApi.CALCULATED_FIELD_DEBUG_EVENTS, (Object) tenantId, debugModeRateLimitsConfig.getCalculatedFieldDebugPerTenantLimitsConfiguration... | public ScheduledFuture<?> schedulePeriodicMsgWithDelay(TbActorRef ctx, TbActorMsg msg, long delayInMs, long periodInMs) {
log.debug("Scheduling periodic msg {} every {} ms with delay {} ms", msg, periodInMs, delayInMs);
return getScheduler().scheduleWithFixedDelay(() -> ctx.tell(msg), delayInMs, periodI... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\actors\ActorSystemContext.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setMetaInfo(String metaInfo) {
this.metaInfo = metaInfo;
}
@Override
public ByteArrayRef getByteArrayRef() {
return byteArrayRef;
}
// common methods //////////////////////////////////////////////////////////
protected String getEngineType() {
if (StringUti... | sb.append(", name=").append(name);
sb.append(", revision=").append(revision);
sb.append(", type=").append(variableType != null ? variableType.getTypeName() : "null");
if (longValue != null) {
sb.append(", longValue=").append(longValue);
}
if (doubleValue != null) {
... | repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\impl\persistence\entity\HistoricVariableInstanceEntityImpl.java | 2 |
请完成以下Java代码 | public DocumentId getId()
{
return rowId;
}
@Override
public boolean isProcessed()
{
return false;
}
@Nullable
@Override
public DocumentPath getDocumentPath()
{
return null;
}
@Override
public Set<String> getFieldNames()
{
return values.getFieldNames(); | }
@Override
public ViewRowFieldNameAndJsonValues getFieldNameAndJsonValues()
{
return values.get(this);
}
@Override
@NonNull
public List<ProductionSimulationRow> getIncludedRows()
{
return includedRows;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\simulation\ProductionSimulationRow.java | 1 |
请完成以下Java代码 | protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_U_Web_Properties[")
.append(get_ID()).append("]");
return sb.toString();
}
/** S... | public String getU_Value ()
{
return (String)get_Value(COLUMNNAME_U_Value);
}
/** Set Web Properties.
@param U_Web_Properties_ID Web Properties */
public void setU_Web_Properties_ID (int U_Web_Properties_ID)
{
if (U_Web_Properties_ID < 1)
set_ValueNoCheck (COLUMNNAME_U_Web_Properties_ID, null);
els... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_U_Web_Properties.java | 1 |
请完成以下Java代码 | private Order emitUpdate(Order order) {
emitter.emit(OrderUpdatesQuery.class, q -> order.getOrderId()
.equals(q.getOrderId()), order);
return order;
}
private Order updateOrder(Order order, Consumer<Order> updateFunction) {
updateFunction.accept(order);
return order;
... | .toString());
}
private Order documentToOrder(@NonNull Document document) {
Order order = new Order(document.getString(ORDER_ID_PROPERTY_NAME));
Document products = document.get(PRODUCTS_PROPERTY_NAME, Document.class);
products.forEach((k, v) -> order.getProducts()
.put(k, (In... | repos\tutorials-master\patterns-modules\axon\src\main\java\com\baeldung\axon\querymodel\MongoOrdersEventHandler.java | 1 |
请完成以下Java代码 | public MReportLine[] getLiness()
{
return m_lines;
} // getLines
/**
* List Info
*/
public void list()
{
System.out.println(toString());
if (m_lines == null)
return;
for (int i = 0; i < m_lines.length; i++)
m_lines[i].list(); | } // list
/**
* String representation
* @return info
*/
public String toString ()
{
StringBuffer sb = new StringBuffer ("MReportLineSet[")
.append(get_ID()).append(" - ").append(getName())
.append ("]");
return sb.toString ();
}
} // MReportLineSet | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\report\MReportLineSet.java | 1 |
请完成以下Java代码 | private static void defaultExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) throws Exception {
Workbook workbook = ExcelExportUtil.exportExcel(exportParams,pojoClass,list);
if (workbook != null);
downLoadExcel(fileName, response, ... | return null;
}
ImportParams params = new ImportParams();
params.setTitleRows(titleRows);
params.setHeadRows(headerRows);
List<T> list = null;
try {
list = ExcelImportUtil.importExcel(new File(filePath), pojoClass, params);
}catch (NoSuchElementExceptio... | repos\springboot-demo-master\eaypoi\src\main\java\com\et\easypoi\Util\FileUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getBaseUnit() {
return baseUnit;
}
/**
* Sets the value of the baseUnit property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBaseUnit(String value) {
... | *
*/
public String getSalesUnit() {
return salesUnit;
}
/**
* Sets the value of the salesUnit property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSales... | 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\PRICATListLineItemExtensionType.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class WebServicesConfiguration extends WsConfigurerAdapter {
@Value("${ws.api.path:/ws/api/v1/*}")
private String webserviceApiPath;
@Value("${ws.port.type.name:UsersPort}")
private String webservicePortTypeName;
@Value("${ws.target.namespace:http://www.baeldung.com/springbootsoap/feignclien... | @Bean(name = "users")
public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema usersSchema) {
DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
wsdl11Definition.setPortTypeName(webservicePortTypeName);
wsdl11Definition.setTargetNamespace(webserviceTargetNamesp... | repos\tutorials-master\feign\src\main\java\com\baeldung\feign\soap\WebServicesConfiguration.java | 2 |
请完成以下Java代码 | 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;
}
public... | public List<Email> getEmails() {
return emails;
}
public void setEmails(List<Email> emails) {
this.emails = emails;
}
@Override
public String toString() {
return "Employee{" + "id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", salary=" + salary + ", hir... | repos\tutorials-master\libraries-apache-commons\src\main\java\com\baeldung\commons\dbutils\Employee.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class WebConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
registry.addViewController("/")
.setViewName("index");
}
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfig... | return resolver;
}
@Bean
public ThemeChangeInterceptor themeChangeInterceptor() {
ThemeChangeInterceptor interceptor = new ThemeChangeInterceptor();
interceptor.setParamName("theme");
return interceptor;
}
@Override
public void addInterceptors(InterceptorRegistry regist... | repos\tutorials-master\spring-web-modules\spring-mvc-basics\src\main\java\com\baeldung\spring\web\config\WebConfig.java | 2 |
请完成以下Java代码 | public void setM_Shipment_Declaration_ID (int M_Shipment_Declaration_ID)
{
if (M_Shipment_Declaration_ID < 1)
set_Value (COLUMNNAME_M_Shipment_Declaration_ID, null);
else
set_Value (COLUMNNAME_M_Shipment_Declaration_ID, Integer.valueOf(M_Shipment_Declaration_ID));
}
/** Get Abgabemeldung.
@return Abga... | }
/** Get Pck. Gr..
@return Pck. Gr. */
@Override
public java.lang.String getPackageSize ()
{
return (java.lang.String)get_Value(COLUMNNAME_PackageSize);
}
/** Set Menge.
@param Qty
Menge
*/
@Override
public void setQty (java.math.BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
/** G... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Shipment_Declaration_Line.java | 1 |
请完成以下Java代码 | public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ErrorEventDefinition.class, BPMN_ELEMENT_ERROR_EVENT_DEFINITION)
.namespaceUri(BPMN20_NS)
.extendsType(EventDefinition.class)
.instanceProvider(new ModelTypeInstanceProvider<E... | public Error getError() {
return errorRefAttribute.getReferenceTargetElement(this);
}
public void setError(Error error) {
errorRefAttribute.setReferenceTargetElement(this, error);
}
@Override
public void setCamundaErrorCodeVariable(String camundaErrorCodeVariable) {
camundaErrorCodeVariableAttri... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\ErrorEventDefinitionImpl.java | 1 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTitle() {
return title;
} | public void setTitle(String title) {
this.title = title;
}
public int getSold() {
return sold;
}
public void setSold(int sold) {
this.sold = sold;
}
@Override
public String toString() {
return "Author{" + "id=" + id + ", name=" + name
+ ", t... | repos\Hibernate-SpringBoot-master\HibernateSpringBootTopNRowsPerGroup\src\main\java\com\bookstore\entity\Author.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.