instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public static Collector<DistributionNetwork, ?, DistributionNetworksMap> collect()
{
return GuavaCollectors.collectUsingListAccumulator(DistributionNetworksMap::new);
}
public DistributionNetwork getById(@NonNull DistributionNetworkId id)
{
final DistributionNetwork distributionNetwork = byId.get(id);
... | return emptiesDistributionNetworks.get(0);
}
}
public DistributionNetworkLine getLineById(@NonNull final DistributionNetworkLineId lineId)
{
final ImmutablePair<DistributionNetwork, DistributionNetworkLine> pair = byLineId.get(lineId);
if (pair == null)
{
throw new AdempiereException("No line fou... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\planning\src\main\java\de\metas\material\planning\ddorder\DistributionNetworkRepository.java | 1 |
请完成以下Java代码 | public EsrAddressType getDebitor() {
return debitor;
}
/**
* Sets the value of the debitor property.
*
* @param value
* allowed object is
* {@link EsrAddressType }
*
*/
public void setDebitor(EsrAddressType value) {
this.debitor = value;
... | public void setEsr5(Esr5Type value) {
this.esr5 = value;
}
/**
* Gets the value of the esr9 property.
*
* @return
* possible object is
* {@link Esr9Type }
*
*/
public Esr9Type getEsr9() {
return esr9;
}
/**
* Sets the value of t... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_response\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\response\ReimbursementType.java | 1 |
请完成以下Java代码 | public long updateLastUplinkTime(long ts) {
if (ts > lastUplinkTime) {
this.lastUplinkTime = ts;
this.firstEdrxDownlink = true;
}
return lastUplinkTime;
}
public boolean checkFirstDownlink() {
boolean result = firstEdrxDownlink;
firstEdrxDownlink ... | for (TransportProtos.TsKvProto oldUpdatedAttrs : missedAttributeUpdates.getSharedUpdatedList()) {
updatedAttrs.put(oldUpdatedAttrs.getKv().getKey(), oldUpdatedAttrs);
}
deletedKeys.addAll(msg.getSharedDeletedList());
for (TransportProtos.TsKvProto newUpdatedAttrs : ms... | repos\thingsboard-master\common\transport\coap\src\main\java\org\thingsboard\server\transport\coap\client\TbCoapClientState.java | 1 |
请完成以下Java代码 | public static PaymentDirection ofReceiptFlag(final boolean isReceipt)
{
return isReceipt ? INBOUND : OUTBOUND;
}
public static PaymentDirection ofInboundPaymentFlag(final boolean inboundPayment)
{
return inboundPayment ? INBOUND : OUTBOUND;
}
public static PaymentDirection ofBankStatementAmount(@NonNull fin... | public boolean isOutboundPayment()
{
return this == OUTBOUND;
}
public Amount convertPayAmtToStatementAmt(@NonNull final Amount payAmt)
{
return payAmt.negateIf(isOutboundPayment());
}
public Money convertPayAmtToStatementAmt(@NonNull final Money payAmt)
{
return payAmt.negateIf(isOutboundPayment());
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\payment\PaymentDirection.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
retu... | public Boolean getTestOnBorrow() {
return testOnBorrow;
}
public void setTestOnBorrow(Boolean testOnBorrow) {
this.testOnBorrow = testOnBorrow;
}
public Boolean getTestOnReturn() {
return testOnReturn;
}
public void setTestOnReturn(Boolean testOnReturn) {
this.... | repos\spring-boot-quick-master\quick-multi-data\src\main\java\com\quick\mulit\config\DruidConfigPrimaryProperties.java | 2 |
请完成以下Java代码 | public ProcessEngineConfiguration setDataSource(DataSource dataSource) {
if (dataSource instanceof TransactionAwareDataSourceProxy) {
return super.setDataSource(dataSource);
} else {
// Wrap datasource in Transaction-aware proxy
DataSource proxiedDataSource = new Tran... | }
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
public String getDeploymentMode() {
return deploymentMode;
}
public void setDeploymentMode(String deploymentMode) {
... | repos\Activiti-develop\activiti-core\activiti-spring\src\main\java\org\activiti\spring\SpringProcessEngineConfiguration.java | 1 |
请完成以下Java代码 | public CandidatesAutoCreateMode isMissingInvoiceCandidate(@Nullable final I_C_Flatrate_Term flatrateTerm)
{
return CandidatesAutoCreateMode.DONT;
}
/**
* Does nothing
*/
@Override
public void setSpecificInvoiceCandidateValues(
@NonNull final I_C_Invoice_Candidate ic,
@NonNull final I_C_Flatrate_Term t... | {
return ic -> {
final FlatrateTermId flatrateTermId = FlatrateTermId.ofRepoId(ic.getRecord_ID());
final RefundContractRepository refundContractRepository = SpringContextHolder.instance.getBean(RefundContractRepository.class);
final RefundContract refundContract = refundContractRepository.getById(flatrateT... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\refund\invoicecandidatehandler\FlatrateTermRefund_Handler.java | 1 |
请完成以下Java代码 | public class M_ShipmentSchedule
{
private static final AdMessageKey MSG_QTY_ORDERED_OVERRIDE_HINT = AdMessageKey.of("M_ShipmentSchedule.QtyOrdered_Override_MayNotEqual_QtyDelivered_Hint");
private static final AdMessageKey MSG_QTY_ORDERED_OVERRIDE = AdMessageKey.of("M_ShipmentSchedule.QtyOrdered_Override_MayNotEqual_... | {
if (shipmentSchedule.getQtyOrdered_Override().compareTo(shipmentSchedule.getQtyDelivered()) == 0)
{
shipmentSchedule.setQtyOrdered_Override(null);
final ITranslatableString info = Services.get(IMsgBL.class)
.getTranslatableMsgText(MSG_QTY_ORDERED_OVERRIDE_HINT);
field.fireDataStatusEEvent(
MSG... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\callout\M_ShipmentSchedule.java | 1 |
请完成以下Java代码 | public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
public boolean isRequired() {
return required;
}
public void setRequired(boolean required) {
this.required = required;
}
public boolean isReadOnly() {... | }
public void setLayout(LayoutDefinition layout) {
this.layout = layout;
}
@JsonInclude(Include.NON_EMPTY)
public Map<String, Object> getParams() {
return params;
}
public void setParams(Map<String, Object> params) {
this.params = params;
}
@JsonIgnore
... | repos\flowable-engine-main\modules\flowable-form-model\src\main\java\org\flowable\form\model\FormField.java | 1 |
请完成以下Java代码 | protected Map<String, Object> processVariables() {
return processVariableMap;
}
/**
* @since 7.3
*/
@Produces
@Named
protected VariableMap processVariableMap() {
return processVariableMap;
}
protected String getVariableLocalName(InjectionPoint ip) {
String variableName = ip.getAnnotate... | }
return businessProcess.getVariableLocalTyped(processVariableName);
}
@Produces
@Named
protected Map<String, Object> processVariablesLocal() {
return processVariableLocalMap;
}
/**
* @since 7.3
*/
@Produces
@Named
protected VariableMap processVariableMapLocal() {
return processVa... | repos\camunda-bpm-platform-master\engine-cdi\core\src\main\java\org\camunda\bpm\engine\cdi\ProcessVariables.java | 1 |
请完成以下Java代码 | default @Nullable ConfigurableEnvironment createEnvironment(@Nullable WebApplicationType webApplicationType) {
return null;
}
/**
* Creates the {@link ConfigurableApplicationContext application context} for a
* {@link SpringApplication}, respecting the given {@code webApplicationType}.
* @param webApplicatio... | * @see BeanUtils#instantiateClass(Class)
*/
static ApplicationContextFactory ofContextClass(Class<? extends ConfigurableApplicationContext> contextClass) {
return of(() -> BeanUtils.instantiateClass(contextClass));
}
/**
* Creates an {@code ApplicationContextFactory} that will create contexts by calling
* t... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\ApplicationContextFactory.java | 1 |
请完成以下Java代码 | public void setIsCreateShareForOwnRevenue (final boolean IsCreateShareForOwnRevenue)
{
set_Value (COLUMNNAME_IsCreateShareForOwnRevenue, IsCreateShareForOwnRevenue);
}
@Override
public boolean isCreateShareForOwnRevenue()
{
return get_ValueAsBoolean(COLUMNNAME_IsCreateShareForOwnRevenue);
}
@Override
pub... | @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);
}
@Override
public void setPointsPrecision (final int PointsPrecision)
{
set_Value (COLUMNNAME_PointsPrecision, P... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\commission\model\X_C_HierarchyCommissionSettings.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getShopwareId()
{
if (orderCustomer != null)
{
return orderCustomer.getCustomerId();
}
else if (customer != null)
{
return customer.getId();
}
throw new RuntimeException("customer && orderCustomer cannot be both null at this stage!");
}
@NonNull
public JsonCustomerBasicInfo getCu... | if (Check.isNotBlank(id))
{
return ExternalIdentifier.builder()
.identifier(ExternalIdentifierFormat.formatExternalId(id))
.rawValue(id)
.build();
}
final String customerId = getShopwareId();
return ExternalIdentifier.builder()
.identifier(ExternalIdentifierFormat.formatExternalId(custom... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-shopware6\src\main\java\de\metas\camel\externalsystems\shopware6\api\model\order\Customer.java | 2 |
请完成以下Java代码 | public void setC_BankStatement_Import_File_ID (final int C_BankStatement_Import_File_ID)
{
if (C_BankStatement_Import_File_ID < 1)
set_Value (COLUMNNAME_C_BankStatement_Import_File_ID, null);
else
set_Value (COLUMNNAME_C_BankStatement_Import_File_ID, C_BankStatement_Import_File_ID);
}
@Override
public ... | @Override
public int getC_BankStatement_Import_File_Log_ID()
{
return get_ValueAsInt(COLUMNNAME_C_BankStatement_Import_File_Log_ID);
}
@Override
public void setLogmessage (final @Nullable java.lang.String Logmessage)
{
set_Value (COLUMNNAME_Logmessage, Logmessage);
}
@Override
public java.lang.String ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\org\adempiere\banking\model\X_C_BankStatement_Import_File_Log.java | 1 |
请完成以下Java代码 | private boolean hasSubscriptionDelivery(
final Properties ctx,
final IShipmentSchedulesDuringUpdate candidates,
final DeliveryLineCandidate inOutLine)
{
final DeliveryGroupCandidate inOut = inOutLine.getGroup();
boolean atLeastOneSubscription = false;
for (final DeliveryLineCandidate currentLine : inO... | // find out if 'currentLine' has an open subscription delivery
// (which means that it is to be delivered right now)
final TableRecordReference scheduleReference = inOutLine.getReferenced();
if (I_C_SubscriptionProgress.Table_Name.equals(scheduleReference.getTableName()))
{
final I_C_SubscriptionProgre... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\inoutcandidate\ShipmentScheduleSubscriptionProcessor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MyProperties {
/**
* socket端口
*/
private Integer socketPort;
/**
* Ping消息间隔(毫秒)
*/
private Integer pingInterval;
/**
* Ping消息超时时间(毫秒)
*/
private Integer pingTimeout;
/**
* 图片保存路径
*/
private String imageDir;
/**
* Phantomjs加载文件... | public Integer getPingTimeout() {
return pingTimeout;
}
public void setPingTimeout(Integer pingTimeout) {
this.pingTimeout = pingTimeout;
}
public String getImageDir() {
return imageDir;
}
public void setImageDir(String imageDir) {
this.imageDir = imageDir;
... | repos\SpringBootBucket-master\springboot-echarts\src\main\java\com\xncoding\echarts\config\properties\MyProperties.java | 2 |
请完成以下Java代码 | public void setC_InvoiceLine_ID (final int C_InvoiceLine_ID)
{
if (C_InvoiceLine_ID < 1)
set_Value (COLUMNNAME_C_InvoiceLine_ID, null);
else
set_Value (COLUMNNAME_C_InvoiceLine_ID, C_InvoiceLine_ID);
}
@Override
public int getC_InvoiceLine_ID()
{
return get_ValueAsInt(COLUMNNAME_C_InvoiceLine_ID);
... | {
return get_ValueAsInt(COLUMNNAME_C_Invoice_Verification_Set_ID);
}
@Override
public void setC_Invoice_Verification_SetLine_ID (final int C_Invoice_Verification_SetLine_ID)
{
if (C_Invoice_Verification_SetLine_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_Invoice_Verification_SetLine_ID, null);
else
set_Va... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Invoice_Verification_SetLine.java | 1 |
请完成以下Java代码 | public void cleanContainerElement(String ID) {
runURLRequest("ContainerElement", ID);
}
private void runURLRequest(String cache, String ID) {
String thisURL = null;
for(int i=0; i<cacheURLs.length; i++) {
try {
thisURL = "http://" + cacheURLs[i] + "/cache/Service?Cache=" + cache + "&ID=" + ID;
URL ... | }
}
/**
* Converts JNP URL to http URL for cache cleanup
* @param JNPURL String with JNP URL from Context
* @return clean servername
*/
public static String convertJNPURLToCacheURL(String JNPURL) {
if (JNPURL.indexOf("jnp://")>=0) {
JNPURL = JNPURL.substring(JNPURL.indexOf("jnp://")+6);
}
if (JNPUR... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\cm\CacheHandler.java | 1 |
请完成以下Java代码 | public void setRetries(SetRetriesForExternalTasksDto retriesDto){
UpdateExternalTaskRetriesBuilder builder = updateRetries(retriesDto);
Integer retries = retriesDto.getRetries();
if (retries == null) {
throw new InvalidRequestException(Status.BAD_REQUEST, "The number of retries cannot be null.");
... | if (processInstanceQueryDto != null) {
processInstanceQuery = processInstanceQueryDto.toQuery(getProcessEngine());
}
HistoricProcessInstanceQueryDto historicProcessInstanceQueryDto = retriesDto.getHistoricProcessInstanceQuery();
if (historicProcessInstanceQueryDto != null) {
historicProcessInst... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\ExternalTaskRestServiceImpl.java | 1 |
请完成以下Java代码 | public static class InventoryQueryBuilder
{
public InventoryQueryBuilder noResponsibleId()
{
return onlyResponsibleIds(InSetPredicate.onlyNull());
}
public InventoryQueryBuilder onlyResponsibleId(@NonNull final UserId responsibleId)
{
return onlyResponsibleIds(InSetPredicate.only(responsibleId));
}
... | public <T> InventoryQueryBuilder excludeInventoryIdsOf(@Nullable Collection<T> collection, @NonNull final Function<T, InventoryId> inventoryIdFunction)
{
if (collection == null || collection.isEmpty()) {return this;}
final ImmutableSet<InventoryId> inventoryIds = collection.stream()
.filter(Objects::nonNu... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\inventory\InventoryQuery.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getCaseDefinitionId() {
return caseDefinitionId;
}
public void setCaseDefinitionId(String caseDefinitionId) {
this.caseDefinitionId = caseDefinitionId;
}
public String getCaseDefinitionUrl() {
return caseDefinitionUrl;
}
public void setCaseDefinitionUrl(S... | }
public String getExecutionId() {
return executionId;
}
public void setExecutionId(String executionId) {
this.executionId = executionId;
}
public String getProcessInstanceId() {
return processInstanceId;
}
public void setProcessInstanceId(String processInstanceId... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\history\task\HistoricTaskInstanceResponse.java | 2 |
请完成以下Java代码 | protected void appendFieldSeparator(final StringBuffer buffer)
{
buffer.append(getFieldSeparator());
padDepth(buffer);
}
@Override
public void appendStart(final StringBuffer buffer, final Object object)
{
depth.get().increment();
super.appendStart(buffer, object);
}
@Override
public void appendEnd(fin... | final ExtendedReflectionToStringBuilder builder = new ExtendedReflectionToStringBuilder(
col.toArray(), // object
this, // style,
buffer, //buffer,
null, //reflectUpToClass,
true, // outputTransients,
true // outputStatics
);
builder.toString();
}
@Override
protected String getShortCla... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\text\RecursiveIndentedMultilineToStringStyle.java | 1 |
请完成以下Java代码 | public class FastexcelHelper {
public Map<Integer, List<String>> readExcel(String fileLocation) throws IOException {
Map<Integer, List<String>> data = new HashMap<>();
try (FileInputStream file = new FileInputStream(fileLocation); ReadableWorkbook wb = new ReadableWorkbook(file)) {
She... | Worksheet ws = wb.newWorksheet("Sheet 1");
ws.width(0, 25);
ws.width(1, 15);
ws.range(0, 0, 0, 1).style().fontName("Arial").fontSize(16).bold().fillColor("3366FF").set();
ws.value(0, 0, "Name");
ws.value(0, 1, "Age");
ws.range(2, 0, 2, 1).style(... | repos\tutorials-master\apache-poi\src\main\java\com\baeldung\fastexcel\FastexcelHelper.java | 1 |
请完成以下Java代码 | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
if (!this.requestMatcher.matches(request)) {
filterChain.doFilter(request, response);
return;
}
OAuth2ProtectedResourceMetadata.Builder builder = OAu... | static {
ClassLoader classLoader = HttpMessageConverters.class.getClassLoader();
jacksonPresent = ClassUtils.isPresent("tools.jackson.databind.json.JsonMapper", classLoader);
jackson2Present = ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper", classLoader)
&& ClassUtils.isPresent("com.fas... | repos\spring-security-main\oauth2\oauth2-resource-server\src\main\java\org\springframework\security\oauth2\server\resource\web\OAuth2ProtectedResourceMetadataFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class TimescaleInsertTsRepository extends AbstractInsertRepository implements InsertTsRepository<TimescaleTsKvEntity> {
private static final String INSERT_OR_UPDATE =
"INSERT INTO ts_kv (entity_id, key, ts, bool_v, str_v, long_v, dbl_v, json_v) VALUES(?, ?, ?, ?, ?, ?, ?, cast(? AS json)) " +
... | ps.setDouble(7, tsKvEntity.getDoubleValue());
ps.setDouble(12, tsKvEntity.getDoubleValue());
} else {
ps.setNull(7, Types.DOUBLE);
ps.setNull(12, Types.DOUBLE);
}
ps.setString(8, replaceNullChars(tsKvEntity.getJ... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sqlts\insert\timescale\TimescaleInsertTsRepository.java | 2 |
请完成以下Java代码 | public String toString() {
final Gson gson = new GsonBuilder().setPrettyPrinting().create();
return gson.toJson(this);
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}... | }
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
} | repos\tutorials-master\aws-modules\aws-lambda-modules\lambda-function\src\main\java\com\baeldung\lambda\dynamodb\bean\PersonRequest.java | 1 |
请完成以下Java代码 | public List<String> getExtensions() {
return extensions;
}
@Override
public String getLanguageName() {
return "JSP 2.1 EL";
}
@Override
public String getLanguageVersion() {
return "2.1";
}
@Override
public String getMethodCallSyntax(String obj, String metho... | if (key.equals(ScriptEngine.NAME)) {
return getLanguageName();
} else if (key.equals(ScriptEngine.ENGINE)) {
return getEngineName();
} else if (key.equals(ScriptEngine.ENGINE_VERSION)) {
return getEngineVersion();
} else if (key.equals(ScriptEngine.LANGUAGE)) ... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\scripting\JuelScriptEngineFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DmnEngine dmnEngine(@SuppressWarnings("unused") AppEngine appEngine) {
// The app engine needs to be injected, as otherwise it won't be initialized, which means that the DmnEngine is not initialized yet
if (!DmnEngines.isInitialized()) {
throw new IllegalStateException("DM... | invokeConfigurers(dmnEngineConfiguration);
return factory;
}
}
@Bean
public DmnManagementService dmnManagementService(DmnEngine dmnEngine) {
return dmnEngine.getDmnManagementService();
}
@Bean
public DmnRepositoryService dmnRepositoryService(DmnEngine d... | repos\flowable-engine-main\modules\flowable-spring-boot\flowable-spring-boot-starters\flowable-spring-boot-autoconfigure\src\main\java\org\flowable\spring\boot\dmn\DmnEngineServicesAutoConfiguration.java | 2 |
请完成以下Java代码 | public DocumentLayoutDetailDescriptor build()
{
return new DocumentLayoutDetailDescriptor(this);
}
private ViewLayout buildGridLayout()
{
if (gridLayout == null)
{
return null;
}
return gridLayout.build();
}
private DocumentLayoutSingleRow buildSingleRowLayout()
{
if (singleRowLayo... | {
this.queryOnActivate = queryOnActivate;
return this;
}
public Builder quickInputSupport(@Nullable final QuickInputSupportDescriptor quickInputSupport)
{
this.quickInputSupport = quickInputSupport;
return this;
}
@Nullable
public QuickInputSupportDescriptor getQuickInputSupport()
{
retur... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\DocumentLayoutDetailDescriptor.java | 1 |
请完成以下Java代码 | public final BigDecimal getNotAppliedAmt()
{
final BigDecimal openAmt = getOpenAmtConv();
final BigDecimal appliedAmt = getAppliedAmt();
final BigDecimal notAppliedAmt = openAmt.subtract(appliedAmt);
return notAppliedAmt;
}
@Override
public final BigDecimal getAppliedAmt_APAdjusted()
{
return adjustAP(g... | final BigDecimal multiplierAP = getMultiplierAP();
final BigDecimal amount_APAdjusted = amount.multiply(multiplierAP);
return amount_APAdjusted;
}
public final PaymentDirection getPaymentDirection()
{
return PaymentDirection.ofInboundPaymentFlag(isCustomerDocument());
}
@Override
public final boolean isV... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.swingui\src\main\java\de\metas\banking\payment\paymentallocation\model\AbstractAllocableDocRow.java | 1 |
请完成以下Java代码 | public class TransformExpressionCacheKey {
protected final String expression;
protected final String inputName;
public TransformExpressionCacheKey(String expression, String inputName) {
this.expression = expression;
this.inputName = inputName;
}
@Override
public int hashCode() {
final int pri... | return false;
TransformExpressionCacheKey other = (TransformExpressionCacheKey) obj;
if (expression == null) {
if (other.expression != null)
return false;
} else if (!expression.equals(other.expression))
return false;
if (inputName == null) {
if (other.inputName != null)
... | repos\camunda-bpm-platform-master\engine-dmn\feel-juel\src\main\java\org\camunda\bpm\dmn\feel\impl\juel\TransformExpressionCacheKey.java | 1 |
请完成以下Java代码 | public ActivityImpl getInitial() {
return initial;
}
public void setInitial(ActivityImpl initial) {
this.initial = initial;
}
@Override
public String toString() {
return "ProcessDefinition(" + id + ")";
}
@Override
public String getName() {
return name;... | }
/**
* @return all lane-sets defined on this process-instance. Returns an empty list if none are defined.
*/
public List<LaneSet> getLaneSets() {
if (laneSets == null) {
laneSets = new ArrayList<>();
}
return laneSets;
}
public void setParticipantProcess(... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\pvm\process\ProcessDefinitionImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Optional<NotifyReplicationTrxRequest> getStatusRequestFor(@NonNull final String trxName)
{
final Collection<TrxImportStatus> progress = importedTrxName2TrxStatus.get(trxName);
if (Check.isEmpty(progress))
{
return Optional.empty();
}
final boolean allNotOk = progress.stream().noneMatch(EcosioOrder... | boolean ok;
@Nullable
String errorMessage;
@NonNull
public static EcosioOrdersRouteContext.TrxImportStatus ok()
{
return TrxImportStatus.builder()
.ok(true)
.build();
}
@NonNull
public static EcosioOrdersRouteContext.TrxImportStatus error(@NonNull final String errorMessage)
{
return... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\ordersimport\ecosio\EcosioOrdersRouteContext.java | 2 |
请完成以下Java代码 | private static ConditionsId extractContractConditionsId(final List<org.compiere.model.I_C_OrderLine> groupOrderLines)
{
final ImmutableSet<ConditionsId> contractConditionsIds = groupOrderLines.stream()
.map(ContractsCompensationGroupAdvisor::extractContractConditionsId)
.filter(Objects::nonNull)
.collect... | {
throw new AdempiereException("Schema line does not have contract conditions set: " + schemaLine);
}
return new ContractConditionsGroupMatcher(contractConditionsId);
}
@ToString
@AllArgsConstructor
private static final class ContractConditionsGroupMatcher implements GroupMatcher
{
private final Conditio... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\compensationGroup\ContractsCompensationGroupAdvisor.java | 1 |
请完成以下Java代码 | public Page<User> findAll(Pageable pageable) {
Assert.notNull(pageable, "Pageable must not be null!");
return repository.findAll(pageable);
}
/**
* Returns the {@link User} with the given {@link Username}.
*
* @param username must not be {@literal null}.
* @return
*/
public Optional<User> findByUser... | Assert.notNull(username, "Username must not be null!");
return repository.findByUsername(username);
}
/**
* Creates a few sample users.
*/
@PostConstruct
public void init() {
IntStream.range(0, 41).forEach(index -> {
register(new Username("user" + index), Password.raw("foobar"));
});
}
} | repos\spring-data-examples-main\web\example\src\main\java\example\users\UserManagement.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected void initReport()
{
super.initReport();
final XlsReportConfiguration configuration = getCurrentItemConfiguration();
// Exporter shall use our "nature" in order to have all properties set to Cuts.
nature = new MetasJRXlsExporterNature(jasperReportsContext, filter,
configuration.isIgnoreGraphics(... | //
// Iterate all xCuts (i.e. columns) and hide those which were marked to be hidden
for (int col = xCuts.size() - 1; col >= 0; col--)
{
final Cut xCut = xCuts.getCut(col);
if (isHideColumn(xCut))
{
sheet.setColumnHidden(col, true);
}
}
}
/**
* @param xCut
* @return true if the column sha... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\metasfresh-report-service\src\main\java\de\metas\report\jasper\exporter\MetasJRXlsExporter.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private String getActionIdsByRoleIds(String roleIds) {
// 得到角色-权限表中roleiId在ids中的所有关联对象
List<PmsRolePermission> listRolePermission = pmsRolePermissionDao.listByRoleIds(roleIds); // 构建StringBuffer
StringBuffer actionIdsBuf = new StringBuffer("");
// 拼接字符串
for (PmsRolePermission pmsRolePermission : listRolePermi... | * @return
*/
public PageBean listPage(PageParam pageParam, PmsRolePermission pmsRolePermission) {
Map<String, Object> paramMap = new HashMap<String, Object>();
return pmsRolePermissionDao.listPage(pageParam, paramMap);
}
/**
* 保存角色和权限之间的关联关系
*/
@Transactional(rollbackFor = Exception.class)
public void ... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\permission\service\impl\PmsRolePermissionServiceImpl.java | 2 |
请完成以下Java代码 | public void invalidateAll()
{
if (invalidateAll)
{
return;
}
else
{
invalidateAll = true;
recordIds.clear();
}
}
public void addRecordId(final int recordId)
{
if (!invalidateAll)
{
recordIds.add(recordId);
}
}
public DocumentIdsSelection toDocumentIdsSelection()
{
return invalid... | ? DocumentIdsSelection.ALL
: DocumentIdsSelection.ofIntSet(recordIds);
}
IncludedDocumentToInvalidate combine(@NonNull final IncludedDocumentToInvalidate other)
{
Check.assumeEquals(tableName, other.tableName, "tableName");
this.invalidateAll = this.invalidateAll || other.invalidateAll;
if(invalidateAll)... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\invalidation\IncludedDocumentToInvalidate.java | 1 |
请完成以下Java代码 | public String getRepeat() {
return repeat;
}
public void setRepeat(String repeat) {
this.repeat = repeat;
}
public String getExceptionMessage() {
return exceptionMessage;
}
public void setExceptionMessage(String exceptionMessage) {
this.exceptionMessage = excep... | if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
TimerPayload other = (TimerPayload) obj;
if (dueDate == null) {
if (other.dueDate != null) return false;
} else if (!dueDate.equals(other.dueDate)) return false;
if (endDate == null) {
... | repos\Activiti-develop\activiti-api\activiti-api-process-model\src\main\java\org\activiti\api\process\model\payloads\TimerPayload.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ClientId createClient(CreateClientRequest createClientRequest) throws ServiceException {
AccountEntity accountEntity = new AccountEntity();
accountEntity.setCredit(0L);
ClientEntity clientEntity = new ClientEntity();
clientEntity.setFirstName(createClientRequest.getFirstName());
... | List<ClientEntity> allClientEntities = clientRepository.findAll();
allClientEntities.forEach(c -> {
clients.add(DTS.transform(c));
});
return clients;
}
@Override
@Transactional
public void deleteClient(ClientId id) throws ServiceException {
Long clientId = L... | repos\spring-examples-java-17\spring-bank\bank-server\src\main\java\itx\examples\springbank\server\service\AdminServiceImpl.java | 2 |
请完成以下Java代码 | public Order placeOrder(Order body) throws RestClientException {
return placeOrderWithHttpInfo(body).getBody();
}
/**
* Place an order for a pet
*
* <p><b>200</b> - successful operation
* <p><b>400</b> - Invalid Order
* @param body order placed for purchasing the pet (required)... | final String[] accepts = {
"application/json", "application/xml"
};
final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json"
};
final MediaType contentType = apiClient.selectHeaderContentType(... | repos\tutorials-master\spring-swagger-codegen-modules\spring-openapi-generator-api-client\src\main\java\com\baeldung\petstore\client\api\StoreApi.java | 1 |
请完成以下Java代码 | public int getC_Invoice_Verification_Set_ID()
{
return get_ValueAsInt(COLUMNNAME_C_Invoice_Verification_Set_ID);
}
@Override
public void setDateEnd (final @Nullable java.sql.Timestamp DateEnd)
{
set_ValueNoCheck (COLUMNNAME_DateEnd, DateEnd);
}
@Override
public java.sql.Timestamp getDateEnd()
{
retur... | {
set_Value (COLUMNNAME_Note, Note);
}
@Override
public java.lang.String getNote()
{
return get_ValueAsString(COLUMNNAME_Note);
}
/**
* Status AD_Reference_ID=541324
* Reference name: Invoice Verification Run Status
*/
public static final int STATUS_AD_Reference_ID=541324;
/** Planned = P */
publ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Invoice_Verification_Run.java | 1 |
请完成以下Java代码 | public <V> V get(Object key) {
return hasKey(key) ? (V) this.context.get(key) : null;
}
@Override
public boolean hasKey(Object key) {
Assert.notNull(key, "key cannot be null");
return this.context.containsKey(key);
}
/**
* Returns the {@link OAuth2AccessTokenResponse.Builder access token response
* bui... | private Builder(OAuth2AccessTokenAuthenticationToken authentication) {
super(authentication);
}
/**
* Sets the {@link OAuth2AccessTokenResponse.Builder access token response
* builder}.
* @param accessTokenResponse the {@link OAuth2AccessTokenResponse.Builder}
* @return the {@link Builder} for furth... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\authentication\OAuth2AccessTokenAuthenticationContext.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected Job getSuspendedJobById(String jobId) {
Job job = managementService.createSuspendedJobQuery().jobId(jobId).singleResult();
validateJob(job, jobId);
return job;
}
protected Job getDeadLetterJobById(String jobId) {
Job job = managementService.createDeadLetterJobQuery().j... | }
if (restApiInterceptor != null) {
restApiInterceptor.accessJobInfoById(job);
}
}
protected void validateHistoryJob(HistoryJob job, String jobId) {
if (job == null) {
throw new FlowableObjectNotFoundException("Could not find a history job with id '" + j... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\management\JobBaseResource.java | 2 |
请完成以下Java代码 | public class MetricsCollectionTask extends TimerTask {
private final static MetricsLogger LOG = ProcessEngineLogger.METRICS_LOGGER;
protected MetricsRegistry metricsRegistry;
protected CommandExecutor commandExecutor;
protected String reporterId = null;
public MetricsCollectionTask(MetricsRegistry metricsR... | public void setReporter(String reporterId) {
this.reporterId = reporterId;
}
protected class MetricsCollectionCmd implements Command<Void> {
protected List<MeterLogEntity> logs;
public MetricsCollectionCmd(List<MeterLogEntity> logs) {
this.logs = logs;
}
@Override
public Void execu... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\metrics\reporter\MetricsCollectionTask.java | 1 |
请完成以下Java代码 | public ChangePlanItemStateBuilder caseVariables(Map<String, Object> caseVariables) {
this.caseVariables.putAll(caseVariables);
return this;
}
@Override
public ChangePlanItemStateBuilder childInstanceTaskVariable(String planItemDefinitionId, String name, Object value) {
if (!this.chi... | return waitingForRepetitionPlanItemDefinitions;
}
public Set<RemoveWaitingForRepetitionPlanItemDefinitionMapping> getRemoveWaitingForRepetitionPlanItemDefinitions() {
return removeWaitingForRepetitionPlanItemDefinitions;
}
public Set<ChangePlanItemIdMapping> getChangePlanItemIds() {
... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\runtime\ChangePlanItemStateBuilderImpl.java | 1 |
请完成以下Java代码 | public Map<String, String> createMapUsingStreamStringArray() {
Map<String, String> map = Stream.of(new String[][] { { "Hello", "World" }, { "John", "Doe" }, })
.collect(Collectors.toMap(data -> data[0], data -> data[1]));
return map;
}
public Map<String, Integer> createMapUsingStre... | return map;
}
public Map<String, Integer> createMapUsingStreamSimpleImmutableEntry() {
Map<String, Integer> map = Stream.of(new AbstractMap.SimpleImmutableEntry<>("idea", 1), new AbstractMap.SimpleImmutableEntry<>("mobile", 2))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValu... | repos\tutorials-master\core-java-modules\core-java-collections-maps\src\main\java\com\baeldung\map\initialize\MapInitializer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MultipartController {
@Autowired
ServletContext context;
@RequestMapping(value = "/upload", method = RequestMethod.POST)
public ModelAndView FileuploadController(@RequestParam("file") MultipartFile file) {
ModelAndView modelAndView = new ModelAndView("index");
try {
... | }
modelAndView.getModel().put("message", "File uploaded successfully!");
} catch (Exception e) {
System.out.println("Exception uploading multipart: " + e);
} finally {
f.flush();
f.close();
in.close();
}
... | repos\tutorials-master\spring-web-modules\spring-mvc-basics\src\main\java\com\baeldung\web\controller\MultipartController.java | 2 |
请完成以下Java代码 | public ConditionalEventDefinition newInstance(ModelTypeInstanceContext instanceContext) {
return new ConditionalEventDefinitionImpl(instanceContext);
}
});
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
conditionChild = sequenceBuilder.element(Condition.class)
.require... | @Override
public String getCamundaVariableName() {
return camundaVariableName.getValue(this);
}
@Override
public void setCamundaVariableName(String variableName) {
camundaVariableName.setValue(this, variableName);
}
@Override
public String getCamundaVariableEvents() {
return camundaVariableE... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\ConditionalEventDefinitionImpl.java | 1 |
请完成以下Java代码 | public boolean processLine ()
{
MMovementLine line = getLine();
line.setTargetQty(getTargetQty());
line.setMovementQty(getConfirmedQty());
line.setConfirmedQty(getConfirmedQty());
line.setScrappedQty(getScrappedQty());
return line.save(get_TrxName());
} // processConfirmation
/**
* Is Fully Co... | * @return false
*/
protected boolean beforeDelete ()
{
return false;
} // beforeDelete
/**
* Before Save
* @param newRecord new
* @return true
*/
protected boolean beforeSave (boolean newRecord)
{
// Calculate Difference = Target - Confirmed - Scrapped
BigDecimal difference = getTargetQty();
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MMovementLineConfirm.java | 1 |
请完成以下Java代码 | public static ExternalSystemType ofValue(@NonNull final String value)
{
final String valueNorm = StringUtils.trimBlankToNull(value);
return interner.computeIfAbsent(valueNorm, ExternalSystemType::new);
}
@Nullable
public static ExternalSystemType ofLegacyCodeOrNull(@NonNull final String code)
{
return LEGAC... | public boolean isGRSSignum() {return GRSSignum.equals(this);}
public boolean isLeichUndMehl() {return LeichUndMehl.equals(this);}
public boolean isPrintClient() {return PrintClient.equals(this);}
public boolean isProCareManagement() {return ProCareManagement.equals(this);}
public boolean isShopware6() {return S... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\externalsystem\ExternalSystemType.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setId(String id) {
this.id = id;
}
@ApiModelProperty(example = "http://localhost:8182/groups/groupId")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
@ApiModelProperty(example = "Test group")
public String ... | return name;
}
public void setName(String name) {
this.name = name;
}
@ApiModelProperty(example = "Test type")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
} | repos\flowable-engine-main\modules\flowable-idm-rest\src\main\java\org\flowable\idm\rest\service\api\group\GroupResponse.java | 2 |
请完成以下Java代码 | public void setProductValue (java.lang.String ProductValue)
{
set_Value (COLUMNNAME_ProductValue, ProductValue);
}
/** Get Produktschlüssel.
@return Schlüssel des Produktes
*/
@Override
public java.lang.String getProductValue ()
{
return (java.lang.String)get_Value(COLUMNNAME_ProductValue);
}
/** Se... | /** Set Anfangsdatum.
@param StartDate
First effective day (inclusive)
*/
@Override
public void setStartDate (java.sql.Timestamp StartDate)
{
set_Value (COLUMNNAME_StartDate, StartDate);
}
/** Get Anfangsdatum.
@return First effective day (inclusive)
*/
@Override
public java.sql.Timestamp getStar... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\model\X_I_Flatrate_Term.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List<HistoricTaskInstanceEntity> findHistoricTasksByProcessInstanceId(String processInstanceId) {
return dataManager.findHistoricTasksByProcessInstanceId(processInstanceId);
}
@Override
public List<String> findHistoricTaskIdsForProcessInstanceIds(Collection<String> processInstanceIds) {
... | dataManager.deleteHistoricTaskInstances(historicTaskInstanceQuery);
}
@Override
public void bulkDeleteHistoricTaskInstancesForIds(Collection<String> taskIds) {
dataManager.bulkDeleteHistoricTaskInstancesForIds(taskIds);
}
@Override
public void deleteHistoricTaskInstancesForNonExist... | repos\flowable-engine-main\modules\flowable-task-service\src\main\java\org\flowable\task\service\impl\persistence\entity\HistoricTaskInstanceEntityManagerImpl.java | 2 |
请完成以下Java代码 | public List<String> shortcutFieldOrder() {
return Arrays.asList(PREFIX_KEY);
}
@Override
public GatewayFilter apply(Config config) {
return new GatewayFilter() {
final UriTemplate uriTemplate = new UriTemplate(
Objects.requireNonNull(config.prefix, "prefix must not be null"));
@Override
public Mo... | .toString();
}
};
}
public static class Config {
private @Nullable String prefix;
public @Nullable String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\PrefixPathGatewayFilterFactory.java | 1 |
请完成以下Java代码 | public String toJson()
{
return json;
}
@JsonCreator
@Nullable
public static WidgetSize fromNullableADRefListValue(@Nullable final String adRefListValue)
{
if(Check.isBlank(adRefListValue))
{
return null;
}
final WidgetSize widgetSize = adRefListValue2widgetType.get(adRefListValue);
if (widgetSiz... | {
throw new NoSuchElementException(adRefListValue);
}
return widgetSize;
}
private String getAD_Ref_List_Value()
{
return adRefListValue;
}
private static final ImmutableMap<String, WidgetSize> adRefListValue2widgetType = Stream.of(values())
.filter(value -> !value.equals(Default))
.collect(GuavaC... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\WidgetSize.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static final class CellStyleKey
{
public static CellStyleKey header(final int column)
{
final int displayType = -1; // N/A
final boolean functionRow = false;
return new CellStyleKey("header", column, displayType, functionRow);
}
public static CellStyleKey cell(final int column, final int disp... | private final int displayType;
private final boolean functionRow;
private CellStyleKey(
final String type,
final int column,
final int displayType,
final boolean functionRow)
{
this.type = type;
this.column = column;
this.displayType = displayType;
this.functionRow = functionRow;
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\spreadsheet\excel\AbstractExcelExporter.java | 2 |
请完成以下Java代码 | public class DoubleQuotesRemovalUtils {
public static String removeWithSubString(String input) {
if (input != null && input.length() >= 2 && input.charAt(0) == '\"'
&& input.charAt(input.length() - 1) == '\"') {
return input.substring(1, input.length() - 1);
}
... | }
public static String removeWithReplaceAllAdvanced(String input) {
if (input == null || input.isEmpty())
return input;
return input.replaceAll("^\"|\"$", "");
}
public static String removeWithGuava(String input) {
if (input == null || input.isEmpty())
... | repos\tutorials-master\core-java-modules\core-java-string-operations-11\src\main\java\com\baeldung\doublequotesremoval\DoubleQuotesRemovalUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | class PPOrderCandidateKeyValueHandler implements IAggregationKeyValueHandler<I_PP_Order_Candidate>
{
@Override
public List<Object> getValues(@NonNull final I_PP_Order_Candidate orderCandidateRecord)
{
final List<Object> values = new ArrayList<>();
values.add(orderCandidateRecord.getM_Warehouse_ID());
values.a... | return values;
}
@Override
public String toString()
{
return ObjectUtils.toString(this);
}
@PostConstruct
public void register()
{
final IAggregationKeyRegistry keyRegistry = Services.get(IAggregationKeyRegistry.class);
keyRegistry.registerAggregationKeyValueHandler(PPOrderCandidateHeaderAggregationKey... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\productioncandidate\agg\key\impl\PPOrderCandidateKeyValueHandler.java | 2 |
请完成以下Java代码 | protected boolean afterDelete(boolean success)
{
//metas start: cg task us025b
if (success)
{
updateAmounts();
}
return success;
//metas end: cg task us025b
}
/**
* metas cg task us025b
* method for updating amounts in payment
*/ | private void updateAmounts()
{
String updateSQL = "UPDATE C_Payment "
+ " set PayAmt = (SELECT SUM(Amount) from C_PaymentAllocate WHERE C_Payment_ID=?), "
+ " DiscountAmt = (SELECT SUM(DiscountAmt) from C_PaymentAllocate WHERE C_Payment_ID=?), "
+ " WriteOffAmt = (SELECT SUM(WriteOffAmt) from C_PaymentAl... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MPaymentAllocate.java | 1 |
请完成以下Java代码 | private static void publishMessagesWithoutKey() throws ExecutionException, InterruptedException {
for (int i = 1; i <= 10; i++) {
ProducerRecord<String, String> record = new ProducerRecord<>(TOPIC, String.valueOf(i));
Future<RecordMetadata> future = producer.send(record);
Rec... | Properties consumerProperties = new Properties();
consumerProperties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
consumerProperties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
consumerProperties.put(ConsumerConfig.VALUE_DESERIALIZER_... | repos\tutorials-master\apache-kafka\src\main\java\com\baeldung\kafka\message\MessageWithKey.java | 1 |
请完成以下Java代码 | public BigDecimal getScrapProcessingFeeForPercentage(final BigDecimal percentage)
{
if (percentage.compareTo(getScrapPercentageTreshold()) < 0)
{
return BigDecimal.ZERO;
}
else
{
return scrapFee;
}
}
@Override
public BigDecimal getScrapPercentageTreshold()
{
return scrapPercentageTreshold;
}
... | final BigDecimal lastInterval = percentages.get(percentages.size() - 1);
return feeProductPercentage2fee.get(lastInterval);
}
@Override
public int getOverallNumberOfInvoicings()
{
return numberOfInspections;
}
@Override
public BigDecimal getWithholdingPercent()
{
return Env.ONEHUNDRED.divide(BigDecimal.... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\ch\lagerkonf\impl\RecordBackedQualityBasedConfig.java | 1 |
请完成以下Java代码 | public SparkplugMessageType getType() {
return type;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
if (hostApplicationId == null) {
sb.append(getNamespace()).append("/").append(getGroupId()).append("/").append(getType()).append("/")
... | return this.deviceId == null;
}
public String getNodeDeviceName() {
return isNode() ? edgeNodeId : deviceId;
}
public static boolean isValidIdElementToUTF8(String deviceIdElement) {
if (deviceIdElement == null) {
return false;
}
String regex = "^(?!.*//)[^+#... | repos\thingsboard-master\common\transport\mqtt\src\main\java\org\thingsboard\server\transport\mqtt\util\sparkplug\SparkplugTopic.java | 1 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
@Override
public void setM_Product_Category_ID (final int M_Product_Category_ID)
{
if (M_Product_Category_ID < 1)
set_Value (COLUMNNAME_M_Product_Category_ID, null);
else
set_... | {
if (M_ProductGroup_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_ProductGroup_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_ProductGroup_ID, M_ProductGroup_ID);
}
@Override
public int getM_ProductGroup_ID()
{
return get_ValueAsInt(COLUMNNAME_M_ProductGroup_ID);
}
@Override
public void setM_ProductGr... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\invoicecandidate\model\X_M_ProductGroup_Product.java | 1 |
请完成以下Java代码 | public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Qualifier qualifier = (Qualifier) o;
return this.id.equals(qualifier.id) && Objects.equals(this.version, qualifier.version)
&& Objects.equals(this.separator, qu... | int qualifier = compareQualifier(first, second);
return (qualifier != 0) ? qualifier : compareQualifierVersion(first, second);
}
private static int compareQualifierVersion(Qualifier first, Qualifier second) {
Integer firstVersion = (first.getVersion() != null) ? first.getVersion() : 0;
Integer secondVersi... | repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\version\Version.java | 1 |
请完成以下Java代码 | public static boolean validateStringFilenameUsingNIO2(String filename) {
Paths.get(filename);
return true;
}
public static boolean validateStringFilenameUsingContains(String filename) {
if (filename == null || filename.isEmpty() || filename.length() > 255) {
return false;
... | return false;
}
return filename.matches(REGEX_PATTERN);
}
private static Character[] getInvalidCharsByOS() {
String os = System.getProperty("os.name").toLowerCase();
if (os.contains("win")) {
return INVALID_WINDOWS_SPECIFIC_CHARS;
} else if (os.contains("nix"... | repos\tutorials-master\core-java-modules\core-java-string-operations-3\src\main\java\com\baeldung\stringfilenamevalidaiton\StringFilenameValidationUtils.java | 1 |
请完成以下Java代码 | protected MqttPublishMessage createMqttPublishMsg(MqttDeviceAwareSessionContext ctx, String topic, JsonElement json) {
MqttFixedHeader mqttFixedHeader =
new MqttFixedHeader(MqttMessageType.PUBLISH, false, ctx.getQoSForTopic(topic), false, 0);
MqttPublishVariableHeader header = new MqttPu... | private static String validatePayload(UUID sessionId, ByteBuf payloadData, boolean isEmptyPayloadAllowed) throws AdaptorException {
String payload = payloadData.toString(UTF8);
if (payload == null) {
log.debug("[{}] Payload is empty!", sessionId);
if (!isEmptyPayloadAllowed) {
... | repos\thingsboard-master\common\transport\mqtt\src\main\java\org\thingsboard\server\transport\mqtt\adaptors\JsonMqttAdaptor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ProductBOMService
{
private static final AdMessageKey PP_PRODUCT_PLANNING_BOM_ATTR_ERROR = AdMessageKey.of("PP_Product_Planning_BOM_Attribute_Error");
private final IProductBOMDAO bomRepo = Services.get(IProductBOMDAO.class);
private final IDocumentBL documentBL = Services.get(IDocumentBL.class);
priv... | {
if (!planning.isAttributeDependant())
{
return;
}
final AttributeSetInstanceId planningASIId = planning.getAttributeSetInstanceId();
final AttributesKey planningAttributesKeys = AttributesKeys.createAttributesKeyFromASIStorageAttributes(planningASIId).orElse(AttributesKey.NONE);
if (planningAttribute... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\eevolution\api\impl\ProductBOMService.java | 2 |
请完成以下Java代码 | public String toString() {
return "Customer{" +
"ID=" + ID +
", name='" + name + '\'' +
", age=" + age +
", createdDate=" + createdDate +
'}';
}
public Long getID() {
return ID;
}
public void setID(Long ID)... | public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public LocalDateTime getCreatedDate() {
return createdDate;
}
public void setCreatedDate(LocalDateTime createdDate) {
this.createdDate = createdDate;
}
} | repos\spring-boot-master\spring-jdbc\src\main\java\com\mkyong\customer\Customer.java | 1 |
请完成以下Java代码 | public static void handleLoginFailure(BladeRedis bladeRedis, String tenantId, String account) {
String ip = WebUtil.getIP();
// 增加账号错误锁定次数
int userFailCount = Func.toInt(bladeRedis.get(CacheNames.tenantKey(tenantId, CacheNames.USER_FAIL_KEY, account)), 0);
bladeRedis.setEx(CacheNames.tenantKey(tenantId, CacheN... | * @param bladeRedis Redis缓存
* @param tenantId 租户ID
* @param account 账号
*/
public static void handleLoginSuccess(BladeRedis bladeRedis, String tenantId, String account) {
String ip = WebUtil.getIP();
// 清除账号登录失败缓存
bladeRedis.del(CacheNames.tenantKey(tenantId, CacheNames.USER_FAIL_KEY, account));
//... | repos\SpringBlade-master\blade-auth\src\main\java\org\springblade\auth\utils\TokenUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JsonAttachment
{
@ApiModelProperty( //
allowEmptyValue = false, //
value = "Reference in terms of the external system. Can reference multiple records (e.g. multiple order line candidates)\n"
+ "To be used in conjunktion with <code>dataSourceName</code>")
String externalReference;
@ApiModelPr... | @JsonProperty("url") final String url)
{
this.externalReference = externalReference;
this.dataSourceName = dataSourceName;
this.attachmentId = attachmentId;
this.type = type;
this.filename = filename;
this.mimeType = mimeType;
this.url = url;
}
/**
* Used by adapters where the data source name is a ... | repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-ordercandidates\src\main\java\de\metas\common\ordercandidates\v2\response\JsonAttachment.java | 2 |
请完成以下Java代码 | class JpaProduct {
private String currencyUnit;
private BigDecimal price;
public JpaProduct() {
}
public JpaProduct(BigDecimal price, String currencyUnit) {
super();
this.price = price;
this.currencyUnit = currencyUnit;
}
@Override
public boolean equals(Object ... | }
public BigDecimal getPrice() {
return price;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((currencyUnit == null) ? 0 : currencyUnit.hashCode());
result = prime * result + ((price == null) ? 0 : price.hash... | repos\tutorials-master\patterns-modules\ddd\src\main\java\com\baeldung\ddd\order\jpa\JpaProduct.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PPOrderIssueScheduleCreateRequest
{
@NonNull PPOrderId ppOrderId;
@NonNull PPOrderBOMLineId ppOrderBOMLineId;
@NonNull SeqNo seqNo;
@NonNull ProductId productId;
@NonNull Quantity qtyToIssue;
@NonNull HuId issueFromHUId;
@NonNull LocatorId issueFromLocatorId;
boolean isAlternativeIssue;
@Nulla... | @NonNull final LocatorId issueFromLocatorId,
final boolean isAlternativeIssue,
@Nullable final Quantity qtyIssued)
{
if (qtyIssued != null)
{
Quantity.assertSameUOM(qtyToIssue, qtyIssued);
}
this.ppOrderId = ppOrderId;
this.ppOrderBOMLineId = ppOrderBOMLineId;
this.seqNo = seqNo;
this.productId... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\pporder\api\issue_schedule\PPOrderIssueScheduleCreateRequest.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String list(RpAccount rpAccount, PageParam pageParam, Model model) {
PageBean pageBean = rpAccountService.listPage(pageParam, rpAccount);
List<Object> recordList = pageBean.getRecordList();
for(Object obj : recordList){
RpAccount account = (RpAccount)obj;
RpUserInfo userInfo = rpUserInfoService.getDa... | */
@RequestMapping(value = "/historyList", method ={RequestMethod.POST, RequestMethod.GET})
public String historyList(RpAccountHistory rpAccountHistory, PageParam pageParam, Model model) {
PageBean pageBean = rpAccountHistoryService.listPage(pageParam, rpAccountHistory);
List<Object> recordList = pageBean.getReco... | repos\roncoo-pay-master\roncoo-pay-web-boss\src\main\java\com\roncoo\pay\controller\account\AccountController.java | 2 |
请完成以下Java代码 | private static String getValue(Evaluatee source, String variable)
{
return CtxNames.parse(variable).getValueAsString(source);
}
public static String parseContext(Evaluatee source, String expression)
{
if (expression == null || expression.length() == 0)
return null;
//
int pos = 0;
String finalExpress... | }
public static boolean hasVariable(Evaluatee source, String variableName)
{
if (source instanceof Evaluatee2)
{
final Evaluatee2 source2 = (Evaluatee2)source;
return source2.has_Variable(variableName);
}
else
{
return !Check.isEmpty(source.get_ValueAsString(variableName));
}
}
public stati... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\Evaluator.java | 1 |
请完成以下Java代码 | public void staleRootDocument(final WindowId windowId, final DocumentId documentId)
{
staleRootDocument(windowId, documentId, false);
}
public void staleRootDocument(final WindowId windowId, final DocumentId documentId, final boolean markActiveTabStaled)
{
final JSONDocumentChangedWebSocketEvent event = getCre... | fromEvents.forEach(this::mergeFrom);
}
private void mergeFrom(final EventKey key, final JSONDocumentChangedWebSocketEvent from)
{
final LinkedHashMap<EventKey, JSONDocumentChangedWebSocketEvent> events = this._events;
if (events == null)
{
throw new AdempiereException("already closed: " + this);
}
eve... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\events\JSONDocumentChangedWebSocketEventCollector.java | 1 |
请完成以下Java代码 | public List<I_PMM_Product> retrieveByHUPIItemProduct(final I_M_HU_PI_Item_Product huPIItemProduct)
{
final IQueryBL queryBL = Services.get(IQueryBL.class);
return queryBL.createQueryBuilder(I_PMM_Product.class, huPIItemProduct)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_PMM_Product.COLUMN_M_HU_PI_Ite... | final int huPIPId)
{
return retrievePMMProductsValidOnDateQuery(date)
.addInArrayOrAllFilter(I_PMM_Product.COLUMNNAME_C_BPartner_ID, partnerId, null) // for the given partner or Not bound to a particular partner (i.e. C_BPartner_ID is null)
.addEqualsFilter(I_PMM_Product.COLUMN_M_Product_ID, productId)
.... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\impl\PMMProductDAO.java | 1 |
请完成以下Java代码 | public class VariableScopeResolver implements Resolver {
protected ProcessEngineConfigurationImpl processEngineConfiguration;
protected VariableScope variableScope;
protected String variableScopeKey = "execution";
protected static final String processEngineConfigurationKey = "processEngineConfigurati... | throw new ActivitiException("unsupported variable scope type: " + variableScope.getClass().getName());
}
this.variableScope = variableScope;
}
public boolean containsKey(Object key) {
return variableScopeKey.equals(key) || KEYS.contains(key) || variableScope.hasVariable((String) key);
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\scripting\VariableScopeResolver.java | 1 |
请完成以下Java代码 | public final class NullAttributeValueCallout implements IAttributeValueCallout
{
public static final NullAttributeValueCallout instance = new NullAttributeValueCallout();
private NullAttributeValueCallout()
{
super();
}
/**
* Method does nothing
*/
@Override
public void onValueChanged(final IAttributeVal... | {
return false;
}
@Override
public boolean isAlwaysEditableUI(final IAttributeValueContext ctx, final IAttributeSet attributeSet, final I_M_Attribute attribute)
{
return false;
}
@Override
public boolean isDisplayedUI(final IAttributeSet attributeSet, final I_M_Attribute attribute)
{
return true;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\adempiere\mm\attributes\spi\NullAttributeValueCallout.java | 1 |
请完成以下Java代码 | public void invokeHandlers(@NonNull final VoidOrderAndRelatedDocsRequest request)
{
final IPair<RecordsToHandleKey, List<ITableRecordReference>> recordsToHandle = request.getRecordsToHandle();
final RecordsToHandleKey currentKey = recordsToHandle.getLeft();
final SourceRecordsKey sourceRecordsKey = currentKey.... | handlerForCurrentKey.handleOrderVoided(request);
}
}
private VoidOrderAndRelatedDocsRequest createRecursionRequest(
@NonNull final VoidOrderAndRelatedDocsRequest originalRequest,
@NonNull final IPair<SourceRecordsKey, List<ITableRecordReference>> relatedRecords)
{
final RecordsToHandleKey recordsToHandleK... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\voidorderandrelateddocs\VoidOrderAndRelatedDocsService.java | 1 |
请完成以下Java代码 | public class DeviceProfileAlarm implements Serializable {
@Schema(description = "String value representing the alarm rule id", example = "highTemperatureAlarmID")
private String id;
@Length(fieldName = "alarm type")
@NoXss
@Schema(description = "String value representing type of the alarm", example... | private AlarmRule clearRule;
// Hidden in advanced settings
@Schema(description = "Propagation flag to specify if alarm should be propagated to parent entities of alarm originator", example = "true")
private boolean propagate;
@Schema(description = "Propagation flag to specify if alarm should be propag... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\device\profile\DeviceProfileAlarm.java | 1 |
请完成以下Java代码 | static String toTwoCharHex(char c) {
String raw = Integer.toHexString(c).toUpperCase(Locale.ENGLISH);
return (raw.length() > 1) ? raw : "0" + raw;
}
/**
* LDAP Encodes a value for use with a DN. Escapes for LDAP, not JNDI! <br/>
* Escapes:<br/>
* ' ' [space] - "\ " [if first or last] <br/>
* '#' [hash] -... | if (c == ' ' && (i == 0 || i == last)) {
encodedValue.append("\\ ");
continue;
}
// check in table for escapes
if (c < NAME_ESCAPE_TABLE.length) {
String esc = NAME_ESCAPE_TABLE[c];
if (esc != null) {
encodedValue.append(esc);
continue;
}
}
// default: add the char
encode... | repos\spring-security-main\ldap\src\main\java\org\springframework\security\ldap\authentication\LdapEncoder.java | 1 |
请完成以下Java代码 | public void setTrx(final ITrx trx)
{
this.trx = trx;
}
@Override
public ITrx getTrx()
{
return trx;
}
@Override
public IParams getParams()
{
return params;
}
public void setParams(IParams params)
{
this.params = params; | }
@Override
public String toString()
{
return "TrxItemProcessorContext [trx=" + trx + ", params=" + params + "]";
}
/**
* Returning <code>false</code> to ensure that the trx which was set via {@link #setTrx(ITrx)} is actually used, even if it's <code>null</code>.
*/
@Override
public boolean isAllowThread... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\processor\api\impl\TrxItemProcessorContext.java | 1 |
请完成以下Java代码 | protected void prepare()
{
for (final ProcessInfoParameter para : getParametersAsArray())
{
String name = para.getParameterName();
if (para.getParameter() == null)
{
continue;
}
else if (name.equals("AD_Table_ID"))
{
p_source_AD_Table_ID = para.getParameterAsInt();
}
else if (name.e... | //
return "" + result;
}
private I_AD_Table getTargetTable()
{
if (p_target_AD_Table_ID <= 0)
{
throw new AdempiereException("@NotFound@ @AD_Table_ID@ " + p_target_AD_Table_ID);
}
final MTable targetTable = new MTable(getCtx(), p_target_AD_Table_ID, get_TrxName());
return targetTable;
}
private Li... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\process\CopyColumnsFromTable.java | 1 |
请完成以下Java代码 | public boolean equalsByNameAndValue(final LogicExpressionResult obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
return Objects.equals(name, obj.name)
&& value == obj.value;
}
public boolean booleanValue()
{
return value;
}
public boolean isTrue()
{
return... | @Override
public String toString()
{
return value ? "TRUE" : "FALSE";
}
}
private static final class NamedConstant extends LogicExpressionResult
{
private transient String _toString = null; // lazy
private NamedConstant(final String name, final boolean value)
{
super(name, value, value ? Constant... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\LogicExpressionResult.java | 1 |
请完成以下Java代码 | public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
AuthenticationException exception) throws IOException, ServletException {
String url = this.failureUrlMap.get(exception.getClass().getName());
if (url != null) {
getRedirectStrategy().sendRedirect(request, response, ... | * valid.
*/
public void setExceptionMappings(Map<?, ?> failureUrlMap) {
this.failureUrlMap.clear();
for (Map.Entry<?, ?> entry : failureUrlMap.entrySet()) {
Object exception = entry.getKey();
Object url = entry.getValue();
Assert.isInstanceOf(String.class, exception, "Exception key must be a String (the... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\ExceptionMappingAuthenticationFailureHandler.java | 1 |
请完成以下Java代码 | public static InputStream convertOutputStreamToInputStream(OutputStream outputStream) {
byte[] data = ((ByteArrayOutputStream) outputStream).toByteArray();
return new ByteArrayInputStream(data);
}
/**
* Convert an {@link InputStream} to a {@link String}
*
* @param inputStream the {@link InputStrea... | return getStringFromReader(reader, true);
}
/**
* Convert an {@link Reader} to a {@link String}
*
* @param reader the {@link Reader} to convert
* @param trim trigger if whitespaces are trimmed in the output
* @return the resulting {@link String}
* @throws IOException
*/
public static String ... | repos\camunda-bpm-platform-master\spin\core\src\main\java\org\camunda\spin\impl\util\SpinIoUtil.java | 1 |
请完成以下Java代码 | public String getHelp ()
{
return (String)get_Value(COLUMNNAME_Help);
}
/** Set Public.
@param IsPublic
Public can read entry
*/
public void setIsPublic (boolean IsPublic)
{
set_Value (COLUMNNAME_IsPublic, Boolean.valueOf(IsPublic));
}
/** Get Public.
@return Public can read entry
*/
public ... | Integer ii = (Integer)get_Value(COLUMNNAME_K_Type_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier o... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_K_Type.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Builder setNoNameHeaderPrefix(@Nullable final String noNameHeaderPrefix)
{
this.noNameHeaderPrefix = noNameHeaderPrefix;
return this;
}
public Builder setDiscardNoNameHeaders()
{
setNoNameHeaderPrefix(null);
return this;
}
/**
* Sets if a cell value which is a null string (i.e. {@lin... | }
/**
* Sets if we shall detect repeating headers and discard them.
*/
public Builder setDiscardRepeatingHeaders(final boolean discardRepeatingHeaders)
{
this.discardRepeatingHeaders = discardRepeatingHeaders;
return this;
}
/**
* If enabled, the XLS converter will look for first not null col... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\excelimport\ExcelToMapListConverter.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void createOrderLines(@NonNull final OrderFactory orderFactory)
{
if (this.orderLineBuilderUsed != null)
{
throw new AdempiereException("Order line was already created for " + this); // shall not happen
}
this.orderLineBuilderUsed = orderFactory.newOrderLine()
.productId(key.getProductId())
... | public Stream<Map.Entry<ServiceRepairProjectCostCollectorId, OrderAndLineId>> streamQuotationLineIdsIndexedByCostCollectorId()
{
if (orderLineBuilderUsed == null)
{
return Stream.empty();
}
else
{
final OrderAndLineId quotationLineId = orderLineBuilderUsed.getCreatedOrderAndLineId();
return costColl... | repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.base\src\main\java\de\metas\servicerepair\project\service\commands\createQuotationFromProjectCommand\QuotationLineAggregator.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public ResponseEntity<Item> post(@Valid @RequestBody Item item) {
service.insert(item);
return ResponseEntity.ok(item);
}
@GetMapping
@ApiResponse(responseCode = "200", description = "Success", content = { @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, array = @ArraySchema(schema = ... | }
@DeleteMapping("/{id}")
@ApiResponse(responseCode = "204", description = "Success")
public ResponseEntity<Void> delete(@PathVariable String id) {
try {
service.deleteById(id);
return ResponseEntity.status(204)
.build();
} catch (EntityNotFoundExcep... | repos\tutorials-master\spring-boot-modules\spring-boot-springdoc-2\src\main\java\com\baeldung\cats\controller\ItemController.java | 2 |
请完成以下Java代码 | public List<HistoricExternalTaskLogDto> getHistoricExternalTaskLogs(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
HistoricExternalTaskLogQueryDto queryDto = new HistoricExternalTaskLogQueryDto(objectMapper, uriInfo.getQueryParameters());
return queryHistoricExternalTaskLogs(queryDto, firstResult, ... | @Override
public CountResultDto getHistoricExternalTaskLogsCount(UriInfo uriInfo) {
HistoricExternalTaskLogQueryDto queryDto = new HistoricExternalTaskLogQueryDto(objectMapper, uriInfo.getQueryParameters());
return queryHistoricExternalTaskLogsCount(queryDto);
}
@Override
public CountResultDto queryHis... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\history\HistoricExternalTaskLogRestServiceImpl.java | 1 |
请完成以下Java代码 | public void setValidFrom (final @Nullable java.sql.Timestamp ValidFrom)
{
set_Value (COLUMNNAME_ValidFrom, ValidFrom);
}
@Override
public java.sql.Timestamp getValidFrom()
{
return get_ValueAsTimestamp(COLUMNNAME_ValidFrom);
}
@Override
public void setValidTo (final @Nullable java.sql.Timestamp ValidTo)
... | public static final int WORKFLOWTYPE_AD_Reference_ID=328;
/** General = G */
public static final String WORKFLOWTYPE_General = "G";
/** Document Process = P */
public static final String WORKFLOWTYPE_DocumentProcess = "P";
/** Document Value = V */
public static final String WORKFLOWTYPE_DocumentValue = "V";
/**... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Workflow.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable Duration getDrainInterval() {
return this.drainInterval;
}
public void setDrainInterval(@Nullable Duration drainInterval) {
this.drainInterval = drainInterval;
}
}
/**
* Name of the algorithm used to compress protocol frames.
*/
public enum Compression {
/**
* Requires 'net.... | */
RATE_LIMITING("RateLimitingRequestThrottler"),
/**
* No request throttling.
*/
NONE("PassThroughRequestThrottler");
private final String type;
ThrottlerType(String type) {
this.type = type;
}
public String type() {
return this.type;
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-cassandra\src\main\java\org\springframework\boot\cassandra\autoconfigure\CassandraProperties.java | 2 |
请完成以下Java代码 | class ForwardedTrustedProxiesCondition extends AllNestedConditions {
public ForwardedTrustedProxiesCondition() {
super(ConfigurationPhase.REGISTER_BEAN);
}
@ConditionalOnProperty(name = GatewayMvcProperties.PREFIX + ".forwarded-request-headers-filter.enabled",
matchIfMissing = true)
static class OnProp... | return ConditionOutcome.match(value + " property is not empty.");
}
catch (NoSuchElementException e) {
return ConditionOutcome.noMatch("Missing required property 'value' of @ConditionalOnPropertyExists");
}
}
}
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE, ElementType.METHOD })
@D... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\filter\TrustedProxies.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ListenableFuture<List<TsKvEntry>> getTimeseries(EntityId entityId, List<String> keys, Long startTs, Long endTs, IntervalType intervalType,
Long interval, String timeZone, Integer limit, Aggregation agg, String orderBy,
... | @Override
public void onFailure(Throwable t) {
future.setException(t);
}
}, MoreExecutors.directExecutor());
} catch (Throwable e) {
onFailure(e);
}
}
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\telemetry\DefaultTbTelemetryService.java | 2 |
请完成以下Java代码 | private String evaluateSQL(final BoilerPlateContext context)
{
final Properties ctx = Env.getCtx();
final String code = getCode();
if (Check.isEmpty(code, true))
return "";
final int windowNo = context.getWindowNo();
final SourceDocument sourceDocument = context.getSourceDocumentOrNull();
final List<Ob... | log.warn("No context value for: " + token);
return ""; // token not found
}
sql.append("?");
params.add(tokenValue);
inStr = inStr.substring(j + 1, inStr.length()); // from second @
i = inStr.indexOf('@');
}
sql.append(inStr); // add the rest of the string
return DB.getSQLValueStringEx(g... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\letters\model\MADBoilerPlateVar.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void handleEvent(final AbstractStockEstimateEvent event)
{
final Candidate candidateToDelete = stockEstimateEventService.retrieveExistingStockEstimateCandidateOrNull(event);
if (candidateToDelete == null)
{
Loggables.withLogger(logger, Level.WARN).addLog("Nothing to do for event, record was already de... | final I_MD_Candidate candidateRecord = RepositoryCommons
.mkQueryBuilder(query)
.create()
.firstOnly(I_MD_Candidate.class);
if (candidateRecord == null)
{
throw new AdempiereException("No MD_Candidate found for candidate")
.appendParametersToMessage()
.setParameter("candidateId: ", candida... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-service\src\main\java\de\metas\material\dispo\service\event\handler\stockchange\StockEstimateDeletedHandler.java | 2 |
请完成以下Java代码 | protected void generateProject(OptionSet options) throws IOException {
ProjectGenerationRequest request = createProjectGenerationRequest(options);
this.projectGenerator.generateProject(request, options.has(this.force));
}
protected ProjectGenerationRequest createProjectGenerationRequest(OptionSet options) {
... | if (options.has(this.version)) {
request.setVersion(options.valueOf(this.version));
}
if (options.has(this.description)) {
request.setDescription(options.valueOf(this.description));
}
request.setExtract(options.has(this.extract));
if (nonOptionArguments.size() == 1) {
String output = (String)... | repos\spring-boot-4.0.1\cli\spring-boot-cli\src\main\java\org\springframework\boot\cli\command\init\InitCommand.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static Boolean getOfficeExportNotes() {
return officeExportNotes;
}
@Value("${office.exportnotes:true}")
public void setExportNotes(Boolean officeExportNotes) {
setOfficeExportNotesValue(officeExportNotes);
}
public static void setOfficeExportNotesValue(Boolean officeExportN... | setHomePaginationValue(homePagination);
}
public static void setHomePaginationValue(String homePagination) {
ConfigConstants.homePagination = homePagination;
}
public static String getHomePageSize() {
return homePageSize;
}
@Value("${home.pagesize:15}")
public void setHome... | repos\kkFileView-master\server\src\main\java\cn\keking\config\ConfigConstants.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.