instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public static DemandDetail forSupplyRequiredDescriptor(@NonNull final SupplyRequiredDescriptor supplyRequiredDescriptor)
{
return DemandDetail.builder()
.demandCandidateId(toUnspecifiedIfZero(supplyRequiredDescriptor.getDemandCandidateId()))
.forecastId(toUnspecifiedIfZero(supplyRequiredDescriptor.getForecas... | int shipmentScheduleId;
int orderId;
int orderLineId;
int subscriptionProgressId;
int inOutLineId;
BigDecimal qty;
/**
* Used when a new supply candidate is created, to link it to it's respective demand candidate;
* When a demand detail is loaded from DB, this field is always <= 0.
*/
int demandCandi... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java\de\metas\material\dispo\commons\candidate\businesscase\DemandDetail.java | 1 |
请完成以下Java代码 | public class ThreeDimensionalArrayList {
public static void main(String args[]) {
int x_axis_length = 2;
int y_axis_length = 2;
int z_axis_length = 2;
ArrayList< ArrayList< ArrayList<String> > > space = new ArrayList<>(x_axis_length);
//Initializing each element of... | //Set Blue color for points (0,1,0) and (0,1,1)
space.get(0).get(1).add(0,"Blue");
space.get(0).get(1).add(1,"Blue");
//Set Green color for points (1,0,0) and (1,0,1)
space.get(1).get(0).add(0,"Green");
space.get(1).get(0).add(1,"Green");
//Set Yellow color for points (1,... | repos\tutorials-master\core-java-modules\core-java-collections-array-list\src\main\java\com\baeldung\list\multidimensional\ThreeDimensionalArrayList.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setBankTradeAmount(BigDecimal bankTradeAmount) {
this.bankTradeAmount = bankTradeAmount;
}
public BigDecimal getRefundAmount() {
return refundAmount;
}
public void setRefundAmount(BigDecimal refundAmount) {
this.refundAmount = refundAmount;
}
public BigDecimal getBankRefundAmount() {
return... | }
public String getReleaseStatus() {
return releaseStatus;
}
public void setReleaseStatus(String releaseStatus) {
this.releaseStatus = releaseStatus == null ? null : releaseStatus.trim();
}
public BigDecimal getFee() {
return fee;
}
public void setFee(BigDecimal fee) {
this.fee = fee;
}
public Str... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\entity\RpAccountCheckBatch.java | 2 |
请完成以下Java代码 | public static InputStream convertOutputStreamToInputStream(OutputStream outputStream) {
byte[] data = ((ByteArrayOutputStream) outputStream).toByteArray();
return new ByteArrayInputStream(data);
}
/**
* Converts a {@link DomDocument} to its String representation
*
* @param document the XML docume... | * @param document the DOM document to transform
* @param result the {@link StreamResult} to write to
*/
public static void transformDocumentToXml(DomDocument document, StreamResult result) {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
try {
Transformer transformer =... | repos\camunda-bpm-platform-master\model-api\xml-model\src\main\java\org\camunda\bpm\model\xml\impl\util\IoUtil.java | 1 |
请完成以下Java代码 | public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
}
/** Get Process Now.
@return Proce... | /** Set Training.
@param S_Training_ID
Repeated Training
*/
public void setS_Training_ID (int S_Training_ID)
{
if (S_Training_ID < 1)
set_ValueNoCheck (COLUMNNAME_S_Training_ID, null);
else
set_ValueNoCheck (COLUMNNAME_S_Training_ID, Integer.valueOf(S_Training_ID));
}
/** Get Training.
@retur... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_S_Training.java | 1 |
请完成以下Java代码 | public NativeHistoricProcessInstanceQuery createNativeHistoricProcessInstanceQuery() {
return new NativeHistoricProcessInstanceQueryImpl(commandExecutor);
}
@Override
public NativeHistoricTaskInstanceQuery createNativeHistoricTaskInstanceQuery() {
return new NativeHistoricTaskInstanceQueryI... | public List<HistoricIdentityLink> getHistoricIdentityLinksForProcessInstance(String processInstanceId) {
return commandExecutor.execute(new GetHistoricIdentityLinksForTaskCmd(null, processInstanceId));
}
@Override
public List<HistoricIdentityLink> getHistoricIdentityLinksForTask(String taskId) {
... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\HistoryServiceImpl.java | 1 |
请完成以下Java代码 | private void updateBillBPartnerForInvoiceCandidate(@NonNull final FlatrateTermBillPartnerRequest request)
{
final I_C_Flatrate_Term term = flatrateDAO.getById(request.getFlatrateTermId());
final I_C_Invoice_Candidate ic = flatrateDAO.retrieveInvoiceCandidate(term);
if (ic == null)
{
return;
}
Interfa... | while (currentTerm.getC_FlatrateTerm_Next_ID() > 0)
{
nextFTsBuilder.add(currentTerm.getC_FlatrateTerm_Next());
currentTerm = currentTerm.getC_FlatrateTerm_Next();
}
return nextFTsBuilder.build();
}
@Override
public final boolean existsTermForOrderLine(final I_C_OrderLine ol)
{
return Services.get(I... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\impl\FlatrateBL.java | 1 |
请完成以下Java代码 | public int getPP_Order_Next_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_PP_Order_Next_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public org.eevolution.model.I_PP_Order_Node getPP_Order_Node() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_PP_Order_Node_ID, org.... | return ii.intValue();
}
/** Set Reihenfolge.
@param SeqNo
Method of ordering records; lowest number comes first
*/
@Override
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Reihenfolge.
@return Method of ordering records; lowest number comes first
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Order_NodeNext.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void applyConnectionDetails(LiquibaseConnectionDetails connectionDetails,
DataSourceBuilder<?> builder) {
builder.username(connectionDetails.getUsername());
builder.password(connectionDetails.getPassword());
String driverClassName = connectionDetails.getDriverClassName();
if (StringUtils.hasText... | @Override
public @Nullable String getUsername() {
return this.properties.getUser();
}
@Override
public @Nullable String getPassword() {
return this.properties.getPassword();
}
@Override
public @Nullable String getJdbcUrl() {
return this.properties.getUrl();
}
@Override
public @Nullable S... | repos\spring-boot-4.0.1\module\spring-boot-liquibase\src\main\java\org\springframework\boot\liquibase\autoconfigure\LiquibaseAutoConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private String contentToString(byte[] content) {
if (isZippedResponse()) {
byte[] unzippedContent = unzipContent(content);
return new String(unzippedContent, StandardCharsets.UTF_8);
}
return new String(content, StandardCharsets.UTF_8);
}
... | }
private byte[] zipContent(String content) {
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(content.length());
GZIPOutputStream gzipOutputStream = new GZIPOutputStream(byteArrayOutputStream);
gzipOutputStream.write(cont... | repos\tutorials-master\jhipster-8-modules\jhipster-8-microservice\gateway-app\src\main\java\com\gateway\web\filter\ModifyServersOpenApiFilter.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class ServerApplication {
private static final String MESSAGE_QUEUE = "pizza-message-queue";
private static final String PUB_SUB_TOPIC = "notification-topic";
private static final String PUB_SUB_EMAIL_QUEUE = "email-queue";
private static final String PUB_SUB_TEXT_QUEUE = "text-queue";
@Bean... | }
@Bean
public Binding emailBinding(Queue emailQueue, TopicExchange exchange) {
return BindingBuilder.bind(emailQueue).to(exchange).with("notification");
}
@Bean
public Binding textBinding(Queue textQueue, TopicExchange exchange) {
return BindingBuilder.bind(textQueue).to(exchange)... | repos\tutorials-master\messaging-modules\rabbitmq\src\main\java\com\baeldung\pubsubmq\server\ServerApplication.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Candidate retrieveExistingStockEstimateCandidateOrNull(@NonNull final AbstractStockEstimateEvent event)
{
final CandidatesQuery query = createCandidatesQuery(event);
return candidateRepositoryRetrieval.retrieveLatestMatchOrNull(query);
}
@Nullable
public Candidate retrievePreviousStockCandidateOrNull(@N... | @NonNull
private CandidatesQuery createPreviousStockCandidatesQuery(@NonNull final AbstractStockEstimateEvent event)
{
final MaterialDescriptorQuery materialDescriptorQuery = MaterialDescriptorQuery.forDescriptor(event.getMaterialDescriptor())
.toBuilder()
.timeRangeEnd(DateAndSeqNo.builder()
.da... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-service\src\main\java\de\metas\material\dispo\service\event\handler\stockchange\StockEstimateEventService.java | 2 |
请完成以下Java代码 | public Pet status(StatusEnum status) {
this.status = status;
return this;
}
/**
* pet status in the store
* @return status
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "pet status in the store")
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_D... | @Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Pet {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" name: ").append(toIndentedString(nam... | repos\tutorials-master\spring-swagger-codegen-modules\spring-openapi-generator-api-client\src\main\java\com\baeldung\petstore\client\model\Pet.java | 1 |
请完成以下Java代码 | public void deleteByTenantId(TenantId tenantId) {
log.trace("Executing deleteMobileAppsByTenantId, tenantId [{}]", tenantId);
mobileAppBundleDao.deleteByTenantId(tenantId);
}
@Override
public Optional<HasId<?>> findEntity(TenantId tenantId, EntityId entityId) {
return Optional.ofNul... | public void deleteEntity(TenantId tenantId, EntityId id, boolean force) {
deleteMobileAppBundleById(tenantId, (MobileAppBundleId) id);
}
@Override
public EntityType getEntityType() {
return EntityType.MOBILE_APP_BUNDLE;
}
private void fetchOauth2Clients(MobileAppBundleInfo mobileAp... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\mobile\MobileAppBundleServiceImpl.java | 1 |
请完成以下Java代码 | void startNaive() {
List<CompletableFuture<String>> futures = new ArrayList<>();
for (int i = 1; i <= 1000; i++) {
String operationId = "Naive-Operation-" + i;
futures.add(asyncOperation(operationId));
}
CompletableFuture<List<String>> aggregate = CompletableFutu... | System.out.println("Printing first 10 results");
for (int i = 0; i < 10; i++) {
System.out.println("Finished " + results.get(i));
}
} finally {
close();
}
}
void close() {
asyncOperationEmulation.shutdownNow();
}
public static... | repos\tutorials-master\core-java-modules\core-java-concurrency-basic-3\src\main\java\com\baeldung\concurrent\completablefuturelist\Application.java | 1 |
请完成以下Java代码 | public class CustomMovieIterator implements Iterator<Movie> {
private int currentIndex;
private final List<Movie> list;
public CustomMovieIterator(List<Movie> list) {
this.list = list;
this.currentIndex = 0;
}
@Override
public boolean hasNext() {
while (currentIndex < l... | currentIndex++;
}
return false;
}
@Override
public Movie next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
return list.get(currentIndex++);
}
private boolean isMovieEligible(Movie movie) {
return movie.getRating() >= 8;
... | repos\tutorials-master\core-java-modules\core-java-collections-5\src\main\java\com\baeldung\customiterators\CustomMovieIterator.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void pushNotificationToEdge(EdgeNotificationMsgProto edgeNotificationMsg, int retryCount, int retryLimit, TbCallback callback) {
TenantId tenantId = TenantId.fromUUID(new UUID(edgeNotificationMsg.getTenantIdMSB(), edgeNotificationMsg.getTenantIdLSB()));
log.debug("[{}] Pushing notification to ed... | @Scheduled(fixedDelayString = "${queue.edge.stats.print-interval-ms}")
public void printStats() {
if (statsEnabled) {
stats.printStats();
stats.reset();
}
}
@Override
protected void stopConsumers() {
super.stopConsumers();
mainConsumer.stop();
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\queue\DefaultTbEdgeConsumerService.java | 2 |
请完成以下Java代码 | /* package */ void validateBbanEntries(final String iban, final BBANStructure code)
{
final String bban = getBBAN(iban);
int bbanEntryOffset = 0;
for (final BBANStructureEntry entry : code.getEntries())
{
final int entryLength = entry.getLength();
final String entryValue = bban.substring(bbanEntryOffset,... | {
Check.assume(Character.isLetterOrDigit(ch), msgBL.getMsg(Env.getCtx(), "BBAN_Letters_Digits", new Object[] { entryValue }));
}
break;
case n:
for (char ch : entryValue.toCharArray())
{
Check.assume(Character.isDigit(ch), msgBL.getMsg(Env.getCtx(), "BBAN_Digits", new Object[] { entryValue ... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\base\src\main\java\de\metas\payment\sepa\api\impl\IBANValidationBL.java | 1 |
请完成以下Java代码 | final class ClientRegistrationDeserializer extends ValueDeserializer<ClientRegistration> {
private static final StdConverter<JsonNode, ClientAuthenticationMethod> CLIENT_AUTHENTICATION_METHOD_CONVERTER = new StdConverters.ClientAuthenticationMethodConverter();
private static final StdConverter<JsonNode, Authorizati... | .clientName(JsonNodeUtils.findStringValue(clientRegistrationNode, "clientName"))
.authorizationUri(JsonNodeUtils.findStringValue(providerDetailsNode, "authorizationUri"))
.tokenUri(JsonNodeUtils.findStringValue(providerDetailsNode, "tokenUri"))
.userInfoUri(JsonNodeUtils.findStringValue(userInfoEndpointNode, "... | repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\jackson\ClientRegistrationDeserializer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private Contract importContractNoCascade(final BPartner bpartner, final SyncContract syncContract, Contract contract)
{
final String uuid = syncContract.getUuid();
if (contract != null && !Objects.equals(uuid, contract.getUuid()))
{
contract = null;
}
if (contract == null)
{
contract = new Contract()... | final SyncProduct syncProductNoDelete = assertNotDeleteRequest_WarnAndFix(syncContractLine.getProduct(), "importing contract lines");
Product product = contractLine == null ? null : contractLine.getProduct();
product = productsImportService.importProduct(syncProductNoDelete, product)
.orElseThrow(() -> new Runt... | repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\sync\SyncContractImportService.java | 2 |
请完成以下Java代码 | public class DeleteHistoricCaseInstanceCmd implements Command<Object>, Serializable {
private static final long serialVersionUID = 1L;
protected String caseInstanceId;
public DeleteHistoricCaseInstanceCmd(String caseInstanceId) {
this.caseInstanceId = caseInstanceId;
}
@Override
... | if (instance == null) {
throw new FlowableObjectNotFoundException("No historic case instance found with id: " + caseInstanceId, HistoricCaseInstance.class);
}
if (instance.isDeleted()) {
return null;
}
if (instance.getEndTime() == null) {
throw new F... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\cmd\DeleteHistoricCaseInstanceCmd.java | 1 |
请完成以下Java代码 | public void run(final String localTrxName)
{
InterfaceWrapperHelper.refresh(doc, localTrxName);
docActionBL.processEx(doc, docAction, null); // expectedDocStatus=null because it is *not* always equal to the docAaction (Prepay-Order)
addLog("Document " + doc + ": Processed");
countOK++;
}
... | addLog(msg);
log.warn(msg, e);
countError++;
return true; // rollback
}
@Override
public void doFinally()
{
// nothing
}
});
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\process\AbstractProcessDocumentsTemplate.java | 1 |
请完成以下Java代码 | public ThreadPoolTaskExecutor build() {
return configure(new ThreadPoolTaskExecutor());
}
/**
* Build a new {@link ThreadPoolTaskExecutor} instance of the specified type and
* configure it using this builder.
* @param <T> the type of task executor
* @param taskExecutorClass the template type to create
* ... | public <T extends ThreadPoolTaskExecutor> T configure(T taskExecutor) {
PropertyMapper map = PropertyMapper.get();
map.from(this.queueCapacity).to(taskExecutor::setQueueCapacity);
map.from(this.corePoolSize).to(taskExecutor::setCorePoolSize);
map.from(this.maxPoolSize).to(taskExecutor::setMaxPoolSize);
map.fr... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\task\ThreadPoolTaskExecutorBuilder.java | 1 |
请完成以下Java代码 | public VerfuegbarkeitDefektgrund getGrund() {
return grund;
}
/**
* Sets the value of the grund property.
*
* @param value
* allowed object is
* {@link VerfuegbarkeitDefektgrund }
*
*/
public void setGrund(VerfuegbarkeitDefektgrund value) {
t... | /**
* Gets the value of the tourabweichung property.
*
*/
public boolean isTourabweichung() {
return tourabweichung;
}
/**
* Sets the value of the tourabweichung property.
*
*/
public void setTourabweichung(boolean value) {
this.tourabweichung = value;
... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.schema.v2\src\main\java-xjc\de\metas\vertical\pharma\vendor\gateway\msv3\schema\v2\VerfuegbarkeitAnteil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static void unzipFile(Path zipFilePath, Path targetDir, Consumer<File> afterExtract) throws IOException {
long totalUnzippedSize = 0;
int entryCount = 0;
if (!Files.exists(targetDir)) {
Files.createDirectories(targetDir);
}
try (ZipFile zipFile = new ZipFile... | * @param entryName
* @return
* @throws IOException
* @author chenrui
* @date 2025/4/28 16:46
*/
private static Path safeResolve(Path targetDir, String entryName) throws IOException {
Path resolvedPath = targetDir.resolve(entryName).normalize();
if (!resolvedPath.startsWith(t... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-module\jeecg-boot-module-airag\src\main\java\org\jeecg\modules\airag\llm\service\impl\AiragKnowledgeDocServiceImpl.java | 2 |
请完成以下Java代码 | public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Year.
@param FiscalYear
The ... | @return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getFiscalYear());
}
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processin... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Year.java | 1 |
请完成以下Java代码 | public String getLastErrorMessage()
{
return m_errorMessage;
}
/**
* Method getLastErrorDescription
* @return String
*/
public String getLastErrorDescription()
{
return m_errorDescription;
}
/**
* @author ET
* @version $Id: OFXBankStatementHandler.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
... | protected boolean isReversal = false;
protected String currency = null;
protected BigDecimal stmtAmt = null;
protected String memo = null;
protected String chargeName = null;
protected BigDecimal chargeAmt = null;
protected String payeeAccountNo = null;
protected String payeeName = null;
protected S... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java-legacy\org\compiere\impexp\OFXBankStatementHandler.java | 1 |
请完成以下Java代码 | public String modelChange(final PO po, final int type) throws Exception
{
// nothing
return null;
}
@Override
public String docValidate(final PO po, final int timing)
{
// nothing
return null;
}
private void registerInstanceValidator(final I_C_ReferenceNo_Type type)
{
final Properties ctx = Interfac... | final Iterator<ReferenceNoGeneratorInstanceValidator> it = docValidators.iterator();
while (it.hasNext())
{
final ReferenceNoGeneratorInstanceValidator validator = it.next();
if (validator.getInstance().getType().getC_ReferenceNo_Type_ID() == type.getC_ReferenceNo_Type_ID())
{
validator.unregister();
... | repos\metasfresh-new_dawn_uat\backend\de.metas.document.refid\src\main\java\de\metas\document\refid\modelvalidator\Main.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_GL_Category[")
.append(get_ID()).append("]");
return sb.toString();
}
/** Catego... | /** Get GL Category.
@return General Ledger Category
*/
public int getGL_Category_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_GL_Category_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Default.
@param IsDefault
Default value
*/
public void setIsDefault (boolean IsDef... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_GL_Category.java | 1 |
请完成以下Java代码 | public void setES_FTS_Config_ID (final int ES_FTS_Config_ID)
{
if (ES_FTS_Config_ID < 1)
set_Value (COLUMNNAME_ES_FTS_Config_ID, null);
else
set_Value (COLUMNNAME_ES_FTS_Config_ID, ES_FTS_Config_ID);
}
@Override
public int getES_FTS_Config_ID()
{
return get_ValueAsInt(COLUMNNAME_ES_FTS_Config_ID);
... | @Override
public void setProcessed (final boolean Processed)
{
set_Value (COLUMNNAME_Processed, Processed);
}
@Override
public boolean isProcessed()
{
return get_ValueAsBoolean(COLUMNNAME_Processed);
}
@Override
public void setProcessingTag (final @Nullable java.lang.String ProcessingTag)
{
set_Value... | repos\metasfresh-new_dawn_uat\backend\de.metas.elasticsearch\src\main\java-gen\de\metas\elasticsearch\model\X_ES_FTS_Index_Queue.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public InternalHistoryVariableManager getInternalHistoryVariableManager() {
return internalHistoryVariableManager;
}
public VariableServiceConfiguration setInternalHistoryVariableManager(InternalHistoryVariableManager internalHistoryVariableManager) {
this.internalHistoryVariableManager = inter... | }
public void setSerializableVariableTypeTrackDeserializedObjects(boolean serializableVariableTypeTrackDeserializedObjects) {
this.serializableVariableTypeTrackDeserializedObjects = serializableVariableTypeTrackDeserializedObjects;
}
public VariableJsonMapper getVariableJsonMapper() {
retu... | repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\VariableServiceConfiguration.java | 2 |
请完成以下Java代码 | public static MHRAttribute forValue(Properties ctx, String value, int C_BPartner_ID, Timestamp date)
{
if (Check.isEmpty(value, true))
{
return null;
}
int AD_Client_ID = Env.getAD_Client_ID(ctx);
final String whereClause = COLUMNNAME_C_BPartner_ID+"=? AND AD_Client_ID IN (?,?) "
+ " AND " + COL... | + " AND " + COLUMNNAME_ValidFrom +"<=? AND " + COLUMNNAME_ValidTo +">=?"
+ " AND EXISTS (SELECT 1 FROM HR_Concept c WHERE HR_Attribute.HR_Concept_ID = c.HR_Concept_ID"
+ " AND c.Value=?)";
MHRAttribute att = new Query(ctx, Table_Name, whereClause, null)
.setParameters(new Object[]{C_BPartne... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.libero.liberoHR\src\main\java\org\eevolution\model\MHRAttribute.java | 1 |
请完成以下Java代码 | public class SpringBootProcessEnginePlugin extends SpringProcessEnginePlugin {
@Override
public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
springProcessEngineConfiguration(processEngineConfiguration)
.ifPresent(this::preInit);
}
@Override
public void postInit(Proces... | public void postProcessEngineBuild(ProcessEngine processEngine) {
processEngineImpl(processEngine).ifPresent(this::postProcessEngineBuild);
}
public void preInit(SpringProcessEngineConfiguration processEngineConfiguration) {
}
public void postInit(SpringProcessEngineConfiguration processEngineConfigurati... | repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\util\SpringBootProcessEnginePlugin.java | 1 |
请完成以下Java代码 | public class M_ShipperTransportation_AddShipments extends JavaProcess implements IProcessPrecondition
{
private final IInOutDAO inOutDAO = Services.get(IInOutDAO.class);
private final IShipperTransportationDAO shipperTransportationDAO = Services.get(IShipperTransportationDAO.class);
@Override
public ProcessPrecond... | }
@Override
protected String doIt() throws Exception
{
final I_M_ShipperTransportation shipperTransportation = shipperTransportationDAO.getById(ShipperTransportationId.ofRepoId(getRecord_ID()));
final ImmutableList<InOutId> inOutIds = inOutDAO.retrieveShipmentsWithoutShipperTransportation(shipperTransportation... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\shipping\process\M_ShipperTransportation_AddShipments.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CommentsRestController
{
protected static final String ENDPOINT = WindowRestController.ENDPOINT + "/{windowId}/{documentId}/comments";
private final UserSession userSession;
private final DocumentDescriptorFactory documentDescriptorFactory;
private final CommentsService commentsService;
public Comme... | final DocumentPath documentPath = DocumentPath.rootDocumentPath(WindowId.fromJson(windowIdStr), documentId);
final ZoneId zoneId = JSONOptions.of(userSession).getZoneId();
return commentsService.getRowCommentsAsJson(documentPath, zoneId);
}
@PostMapping
public void addComment(
@PathVariable("windowId") fina... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\comments\CommentsRestController.java | 2 |
请完成以下Java代码 | public I_C_BankStatement_Import_File getC_BankStatement_Import_File()
{
return get_ValueAsPO(COLUMNNAME_C_BankStatement_Import_File_ID, I_C_BankStatement_Import_File.class);
}
@Override
public void setC_BankStatement_Import_File(final I_C_BankStatement_Import_File C_BankStatement_Import_File)
{
set_ValueFromP... | }
@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.Strin... | 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代码 | public Integer getId()
{
return id;
}
public void setId(Integer id)
{
this.id = id;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getEmail()
{
return email;
}
public void setEmail(String email)
{
this.email = email;
}
... | return disabled;
}
public void setDisabled(boolean disabled)
{
this.disabled = disabled;
}
public Set<Address> getAddresses()
{
return addresses;
}
public void setAddresses(Set<Address> addresses)
{
this.addresses = addresses;
}
} | repos\Spring-Boot-Advanced-Projects-main\springboot-multiple-datasources\src\main\java\net\alanbinu\springboot\springbootmultipledatasources\security\entities\User.java | 1 |
请完成以下Java代码 | public String benchmarkStringFormat_d() {
return String.format(formatDigit, sampleNumber);
}
@Benchmark
public boolean benchmarkStringEquals() {
return longString.equals(baeldung);
}
@Benchmark
public boolean benchmarkStringEqualsIgnoreCase() {
return longString.equals... | @Benchmark
public int benchmarkStringCompareTo() {
return longString.compareTo(baeldung);
}
@Benchmark
public boolean benchmarkStringIsEmpty() {
return longString.isEmpty();
}
@Benchmark
public boolean benchmarkStringLengthZero() {
return longString.length() == 0;
... | repos\tutorials-master\core-java-modules\core-java-strings\src\main\java\com\baeldung\stringperformance\StringPerformance.java | 1 |
请完成以下Java代码 | public abstract class Tree {
private double mass;
private double height;
private Position position;
public Tree(double mass, double height) {
this.mass = mass;
this.height = height;
}
public void setMass(double mass) {
this.mass = mass;
}
public void setHeight... | public double getMass() {
return mass;
}
public double getHeight() {
return height;
}
public Position getPosition() {
return position;
}
@Override
public String toString() {
return "Tree [mass=" + mass + ", height=" + height + ", position=" + position + "]"... | repos\tutorials-master\patterns-modules\design-patterns-creational-2\src\main\java\com\baeldung\prototype\Tree.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ArticleWorkflowService {
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@Transactional
public void startProcess(Article article) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("author", a... | List<Article> articles = tasks.stream()
.map(task -> {
Map<String, Object> variables = taskService.getVariables(task.getId());
return new Article(
task.getId(), (String) variables.get("author"), (String) variables.get("url"));
})
.collect(Collect... | repos\tutorials-master\spring-boot-modules\spring-boot-flowable\src\main\java\com\baeldung\service\ArticleWorkflowService.java | 2 |
请完成以下Spring Boot application配置 | # WhatsApp API configuration
whatsapp.verify_token=BaeldungDemo-Verify-Token
whatsapp.api_url=https://graph.facebook.com/v20.0/PHONE_NUMBER_ID/messages
whatsapp.access_token=ACCESS_TOKEN
# Ollama API configuration
ollama.api_url=http://localhost:11434/
ollama.model=qwen2:1.5b
ollama.timeout=30
ollama.max_response_leng... | n server
spring.cloud.config.enabled=false
# Enable the Spring Boot Actuator endpoints to trigger a refresh
management.endpoint.refresh.enabled=true
management.endpoints.web.exposure.include=refresh
# Example property to be changed at runtime
my.custom.property=defaultValue | repos\tutorials-master\spring-boot-modules\spring-boot-3-3\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public class CustomRealm extends JdbcRealm {
private Logger logger = LoggerFactory.getLogger(CustomRealm.class);
private Map<String, String> credentials = new HashMap<>();
private Map<String, Set<String>> roles = new HashMap<>();
private Map<String, Set<String>> permissions = new HashMap<>();
... | logger.error(e.getMessage());
}
}
SimpleAuthorizationInfo authInfo = new SimpleAuthorizationInfo(roles);
authInfo.setStringPermissions(permissions);
return authInfo;
}
@Override
protected Set<String> getRoleNamesForUser(Connection conn, String username) throws SQ... | repos\tutorials-master\security-modules\apache-shiro\src\main\java\com\baeldung\comparison\shiro\CustomRealm.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Doctor doctor = (Doctor) o;
return Objects.equals(this._id, doctor._id) &&
Objects.equals(this.gender, doctor.gender) &&
Objects.... | sb.append(" gender: ").append(toIndentedString(gender)).append("\n");
sb.append(" titleShort: ").append(toIndentedString(titleShort)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-patient-api\src\main\java\io\swagger\client\model\Doctor.java | 2 |
请完成以下Java代码 | public void setDerKurier_DeliveryOrderLine_ID (int DerKurier_DeliveryOrderLine_ID)
{
if (DerKurier_DeliveryOrderLine_ID < 1)
set_Value (COLUMNNAME_DerKurier_DeliveryOrderLine_ID, null);
else
set_Value (COLUMNNAME_DerKurier_DeliveryOrderLine_ID, Integer.valueOf(DerKurier_DeliveryOrderLine_ID));
}
/** Get... | @Override
public void setM_Package(org.compiere.model.I_M_Package M_Package)
{
set_ValueFromPO(COLUMNNAME_M_Package_ID, org.compiere.model.I_M_Package.class, M_Package);
}
/** Set Packstück.
@param M_Package_ID
Shipment Package
*/
@Override
public void setM_Package_ID (int M_Package_ID)
{
if (M_Pack... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.derkurier\src\main\java-gen\de\metas\shipper\gateway\derkurier\model\X_DerKurier_DeliveryOrderLine_Package.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CustomerTradeMarginLine
{
@Nullable
CustomerTradeMarginLineId customerTradeMarginLineId;
@NonNull
CustomerTradeMarginId customerTradeMarginId;
@NonNull
Boolean active;
@NonNull
Integer seqNo;
@NonNull
Integer marginPercent;
@Nullable
BPartnerId customerId;
@Nullable
ProductId productId;... | }
private boolean appliesToCustomer(@NonNull final BPartnerId customerCandidateId)
{
if (this.customerId == null)
{
return true;
}
return this.customerId.equals(customerCandidateId);
}
private boolean appliesToProduct(@NonNull final ProductId productId)
{
if (this.productId == null)
{
return tr... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\pricing\trade_margin\CustomerTradeMarginLine.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class EmployeeDAO {
private JdbcTemplate jdbcTemplate;
private NamedParameterJdbcTemplate namedJdbcTemplate;
public void setDataSource(DataSource dataSource) {
jdbcTemplate = new JdbcTemplate(dataSource);
namedJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
}
publ... | jdbcTemplate.execute("CREATE TEMPORARY TABLE IF NOT EXISTS employee_tmp (id INT NOT NULL)");
List<Object[]> employeeIds = new ArrayList<>();
for (Integer id : ids) {
employeeIds.add(new Object[] { id });
}
jdbcTemplate.batchUpdate("INSERT INTO employee_tmp VALUES(?)", employ... | repos\tutorials-master\persistence-modules\spring-jdbc\src\main\java\com\baeldung\spring\jdbc\template\inclause\EmployeeDAO.java | 2 |
请完成以下Java代码 | public final class InvoiceLineAttribute implements IInvoiceLineAttribute
{
private final String aggregationKey;
@ToStringBuilder(skip = true)
private final I_M_AttributeInstance attributeInstanceTemplate;
/**
* @param attributeInstance attribute instance used to extract the informations from
*/
public Invoic... | if (this == obj)
{
return true;
}
final InvoiceLineAttribute other = EqualsBuilder.getOther(this, obj);
if (other == null)
{
return false;
}
return new EqualsBuilder()
.append(this.aggregationKey, other.aggregationKey)
.isEqual();
}
@Override
public int hashCode()
{
return new Hashco... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\InvoiceLineAttribute.java | 1 |
请完成以下Java代码 | protected void build(final de.metas.inoutcandidate.model.I_M_ReceiptSchedule_Alloc rsa)
{
super.build(rsa);
final I_M_ReceiptSchedule_Alloc rsaHU = InterfaceWrapperHelper.create(rsa, I_M_ReceiptSchedule_Alloc.class);
//
// HU_QtyAllocated
final StockQtyAndUOMQty huQtyAllocatedSrc = getHU_QtyAllocated();
... | return _huQtyAllocated;
}
private I_M_HU getM_LU_HU()
{
return _luHU;
}
public HUReceiptScheduleAllocBuilder setM_LU_HU(final I_M_HU luHU)
{
_luHU = luHU;
return this;
}
private I_M_HU getM_TU_HU()
{
return _tuHU;
}
public HUReceiptScheduleAllocBuilder setM_TU_HU(final I_M_HU tuHU)
{
_tuHU = t... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\receiptschedule\impl\HUReceiptScheduleAllocBuilder.java | 1 |
请完成以下Java代码 | public String toString()
{
StringBuilder sb = new StringBuilder("MPrintFont[");
sb.append("ID=").append(get_ID())
.append(",Name=").append(getName())
.append("PSName=").append(getFont().getPSName())
.append(getFont())
.append("]");
return sb.toString();
} // toString
/**
* Get PostScript Level ... | * Get Font
* @param AD_PrintFont_ID id
* @return Font
*/
static public MPrintFont get (final int AD_PrintFont_ID)
{
final MPrintFont printFont = s_fonts.get(AD_PrintFont_ID, new Callable<MPrintFont>()
{
@Override
public MPrintFont call() throws Exception
{
return new MPrintFont (Env.getCtx()... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\MPrintFont.java | 1 |
请完成以下Java代码 | public void setRemote_Host (String Remote_Host)
{
set_Value (COLUMNNAME_Remote_Host, Remote_Host);
}
/** Get Remote Host.
@return Remote host Info
*/
public String getRemote_Host ()
{
return (String)get_Value(COLUMNNAME_Remote_Host);
}
/** Set Target URL.
@param TargetURL
URL for the Target
*... | /** Set Click Count.
@param W_ClickCount_ID
Web Click Management
*/
public void setW_ClickCount_ID (int W_ClickCount_ID)
{
if (W_ClickCount_ID < 1)
set_ValueNoCheck (COLUMNNAME_W_ClickCount_ID, null);
else
set_ValueNoCheck (COLUMNNAME_W_ClickCount_ID, Integer.valueOf(W_ClickCount_ID));
}
/** Ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_Click.java | 1 |
请完成以下Java代码 | private int getAD_Menu_ID()
{
Check.assumeNotNull(adMenuId, "adMenuId shall be set");
return adMenuId;
}
private String getId()
{
final int adMenuId = getAD_Menu_ID();
if (type == MenuNodeType.NewRecord)
{
return adMenuId + "-new";
}
else
{
return String.valueOf(adMenuId);
}
... | }
public Builder setTypeNewRecord(@NonNull final AdWindowId adWindowId)
{
return setType(MenuNodeType.NewRecord, DocumentId.of(adWindowId));
}
public void setTypeGroup()
{
setType(MenuNodeType.Group, null);
}
public void addChildToFirstsList(@NonNull final MenuNode child)
{
childrenFirst.add... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\menu\MenuNode.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public FormService getFormService() {
return processEngine.getFormService();
}
@Bean(name = "taskService")
@Override
public TaskService getTaskService() {
return processEngine.getTaskService();
}
@Bean(name = "historyService")
@Override
public HistoryService getHistoryService() {
return pr... | @Override
public CaseService getCaseService() {
return processEngine.getCaseService();
}
@Bean(name = "filterService")
@Override
public FilterService getFilterService() {
return processEngine.getFilterService();
}
@Bean(name = "externalTaskService")
@Override
public ExternalTaskService getEx... | repos\camunda-bpm-platform-master\engine-spring\core\src\main\java\org\camunda\bpm\engine\spring\SpringProcessEngineServicesConfiguration.java | 2 |
请完成以下Java代码 | public String toString()
{
return toJson(this);
}
@JsonValue
public String toJson()
{
return toJson(this);
}
public String getTableAlias()
{
String tableAlias = this._tableAlias;
if (tableAlias == null)
{
tableAlias = this._tableAlias = "d" + idInt;
}
return tableAlias;
}
@Nullable
public... | return Objects.compare(toJson(), o.toJson(), Comparator.naturalOrder());
}
public static boolean equals(@Nullable final DetailId o1, @Nullable final DetailId o2)
{
return Objects.equals(o1, o2);
}
public int getIdIntAssumingPrefix(@NonNull final String expectedPrefix)
{
assertIdPrefix(expectedPrefix);
ret... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\DetailId.java | 1 |
请完成以下Java代码 | public static final WebuiImageId ofNullableObject(final Object obj)
{
if (obj == null)
{
return null;
}
try
{
final int id;
if (obj instanceof Number)
{
id = ((Number)obj).intValue();
}
else
{
final String idStr = obj.toString().trim();
id = !idStr.isEmpty() ? Integer.parseI... | return new WebuiImageId(repoId);
}
public static WebuiImageId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? ofRepoId(repoId) : null;
}
private final int repoId;
public WebuiImageId(final int repoId)
{
Check.assumeGreaterThanZero(repoId, "repoId");
this.repoId = repoId;
}
@JsonValue
@Overrid... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\upload\WebuiImageId.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
} | public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public AccountEntity getAccount() {
return account;
}
public void setAccount(AccountEntity account) {
this.account = account;
}
} | repos\spring-examples-java-17\spring-bank\bank-server\src\main\java\itx\examples\springbank\server\repository\model\ClientEntity.java | 2 |
请在Spring Boot框架中完成以下Java代码 | OtlpMeterRegistry otlpMeterRegistryVirtualThreads(OtlpConfig otlpConfig, Clock clock,
ObjectProvider<OtlpMetricsSender> metricsSender) {
VirtualThreadTaskExecutor executor = new VirtualThreadTaskExecutor("otlp-meter-registry-");
return builder(otlpConfig, clock, metricsSender).threadFactory(executor.getVirtualTh... | private final OtlpMetricsProperties properties;
PropertiesOtlpMetricsConnectionDetails(OtlpMetricsProperties properties) {
this.properties = properties;
}
@Override
public @Nullable String getUrl() {
return this.properties.getUrl();
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\otlp\OtlpMetricsExportAutoConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public AllocationAmounts movePayAmtToDiscount()
{
if (payAmt.signum() == 0)
{
return this;
}
else
{
return toBuilder()
.payAmt(payAmt.toZero())
.discountAmt(discountAmt.add(payAmt))
.build();
}
}
public AllocationAmounts movePayAmtToWriteOff()
{
if (payAmt.signum() == 0)
{
r... | }
return toBuilder()
.payAmt(this.payAmt.negate())
.discountAmt(this.discountAmt.negate())
.writeOffAmt(this.writeOffAmt.negate())
.invoiceProcessingFee(this.invoiceProcessingFee) // never negate the processing fee because it will be paid to the service provider no matter what kind of invoice it is a... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\payment\paymentallocation\service\AllocationAmounts.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void register(User user, HttpServletRequest request) {
validator.validate(user);
if(validator.hasErrors()) {
result.include("errors", validator.getErrors());
}
validator.onErrorRedirectTo(this).registrationForm();
if(!user.getPassword()
.equals... | String password = request.getParameter("user.password");
String email = request.getParameter("user.email");
if(email.isEmpty() || password.isEmpty()) {
result.include("error", "Email/Password is Required!");
result.redirectTo(AuthController.class).loginForm();
}
Use... | repos\tutorials-master\web-modules\vraptor\src\main\java\com\baeldung\controllers\AuthController.java | 2 |
请完成以下Java代码 | private CustomsInvoiceLine allocateShipmentLine(
@NonNull final CustomsInvoiceLine customsInvoiceLineForProduct,
@NonNull final InOutAndLineId inOutAndLineId,
@NonNull final CurrencyId currencyId)
{
final IUOMConversionBL uomConversionBL = Services.get(IUOMConversionBL.class);
final CustomsInvoiceLineAll... | .inoutAndLineId(inOutAndLineId)
.price(inoutLinePrice.toMoney())
.quantityInPriceUOM(inoutLineQtyInPriceUOM)
.build();
customsInvoiceLineForProduct.addAllocation(newAlloc);
}
qty = Quantitys.add(UOMConversionContext.of(customsInvoiceLineForProduct.getProductId()), qty, newAlloc.getQuantityInPric... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\customs\CustomsInvoiceService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserInfoCollectionResource extends BaseUserResource {
@Autowired
protected RestResponseFactory restResponseFactory;
@Autowired
protected IdentityService identityService;
@ApiOperation(value = "List user’s info", tags = { "Users" }, nickname = "listUserInfo")
@ApiResponses(value =... | User user = getUserFromRequest(userId);
if (userRequest.getKey() == null) {
throw new FlowableIllegalArgumentException("The key cannot be null.");
}
if (userRequest.getValue() == null) {
throw new FlowableIllegalArgumentException("The value cannot be null.");
}
... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\identity\UserInfoCollectionResource.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public LocalDate getPublished() {
return published;
}
public void setPublished(LocalDate published) {
this.published = published;
}
public Integ... | return false;
}
return Objects.equals(getId(), bookDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "BookDTO{" +
"id=" + getId() +
", title='" + getTitle() +... | repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\service\dto\BookDTO.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public SuperStreamBuilder name(String name) {
this.name = name;
return this;
}
/**
* Set the partitions number.
* @param partitions the partitions number
* @return the builder
*/
public SuperStreamBuilder partitions(int partitions) {
this.partitions = partitions;
return this;
}
/**
* Set a stra... | public SuperStream build() {
if (!StringUtils.hasText(this.name)) {
throw new IllegalArgumentException("Stream name can't be empty");
}
if (this.partitions <= 0) {
throw new IllegalArgumentException(
String.format("Partitions number should be great then zero. Current value; %d", this.partitions)
);... | repos\spring-amqp-main\spring-rabbit-stream\src\main\java\org\springframework\rabbit\stream\config\SuperStreamBuilder.java | 2 |
请完成以下Java代码 | default Optional<Object> get_ValueIfExists(@NonNull final String variableName, @NonNull final Class<?> targetType)
{
if (Integer.class.equals(targetType)
|| int.class.equals(targetType))
{
final Integer valueInt = get_ValueAsInt(variableName, null);
return Optional.ofNullable(valueInt);
}
else if (ja... | else if (Boolean.class.equals(targetType))
{
final Boolean valueBoolean = get_ValueAsBoolean(variableName, null);
return Optional.ofNullable(valueBoolean);
}
else
{
final Object valueObj = get_ValueAsObject(variableName);
return Optional.ofNullable(valueObj);
}
}
default Evaluatee andComposeWit... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\Evaluatee.java | 1 |
请完成以下Java代码 | public String getASIDescription()
{
return asiDescription;
}
public int getASIId()
{
return asiId;
}
public String getPartnerName()
{
return partnerName;
} | public String getDocBaseType()
{
return docBaseType;
}
public String getDocumentNo()
{
return documentNo;
}
public String getWarehouseName()
{
return warehouseName;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\apps\search\dao\impl\OrderLineHistoryVO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void init() {
this.transportCallbackExecutor = ThingsBoardExecutors.newWorkStealingPool(maxCallbackThreads, getClass());
TbQueueProducer<TbProtoQueueMsg<TransportApiResponseMsg>> producer = tbCoreQueueFactory.createTransportApiResponseProducer();
TbQueueConsumer<TbProtoQueueMsg<TransportA... | @AfterStartUp(order = AfterStartUp.REGULAR_SERVICE)
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
log.info("Received application ready event. Starting polling for events.");
transportApiTemplate.subscribe();
transportApiTemplate.launch(transportApiService);
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\transport\TbCoreTransportApiService.java | 2 |
请完成以下Java代码 | public void postLoad() {
// make sure the serializer is initialized
typedValueField.postLoad();
}
// getters and setters //////////////////////////////////////////////////////
public String getTypeName() {
return typedValueField.getTypeName();
}
public String getVariableTypeName() {
return ... | + ", serializerName=" + serializerName
+ ", longValue=" + longValue
+ ", doubleValue=" + doubleValue
+ ", textValue=" + textValue
+ ", textValue2=" + textValue2
+ ", byteArrayId=" + byteArrayId
+ ", activityInstanceId=" + activityInstanceId
+ ... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\HistoricDetailVariableInstanceUpdateEntity.java | 1 |
请完成以下Java代码 | void onPubcompReceived() {
pubrelRetransmissionHandler.stop();
}
void onChannelClosed() {
publishRetransmissionHandler.stop();
pubrelRetransmissionHandler.stop();
if (payload != null) {
payload.release();
}
}
static Builder builder() {
return... | this.qos = qos;
return this;
}
Builder ownerId(String ownerId) {
this.ownerId = ownerId;
return this;
}
Builder retransmissionConfig(MqttClientConfig.RetransmissionConfig retransmissionConfig) {
this.retransmissionConfig = retransmissionC... | repos\thingsboard-master\netty-mqtt\src\main\java\org\thingsboard\mqtt\MqttPendingPublish.java | 1 |
请在Spring Boot框架中完成以下Java代码 | class WebuiHUProcessDescriptor
{
@NonNull ProcessDescriptor processDescriptor;
@NonNull
@Getter(AccessLevel.NONE) HUProcessDescriptor huProcessDescriptor;
public ProcessId getProcessId()
{
return processDescriptor.getProcessId();
}
public AdProcessId getReportAdProcessId()
{
return huProcessDescriptor.ge... | return WebuiRelatedProcessDescriptor.builder()
.processId(processDescriptor.getProcessId())
.internalName(processDescriptor.getInternalName())
.processCaption(processDescriptor.getCaption())
.processDescription(processDescriptor.getDescription())
.displayPlace(DisplayPlace.ViewQuickActions)
.pre... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\report\WebuiHUProcessDescriptor.java | 2 |
请完成以下Java代码 | public int getM_Product_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Product_ID);
}
@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 setP... | @Override
public void setQty (final @Nullable BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
@Override
public BigDecimal getQty()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setSeqNo (final int SeqNo)
{
set_V... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_ProjectTask.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public PersistenceUnitTransactionType getTransactionType() {
return transactionType;
}
public HibernatePersistenceUnitInfo setJtaDataSource(DataSource jtaDataSource) {
this.jtaDataSource = jtaDataSource;
this.nonjtaDataSource = null;
transactionType = PersistenceUnitTransactio... | @Override
public boolean excludeUnlistedClasses() {
return false;
}
@Override
public SharedCacheMode getSharedCacheMode() {
return SharedCacheMode.UNSPECIFIED;
}
@Override
public ValidationMode getValidationMode() {
return ValidationMode.AUTO;
}
public P... | repos\tutorials-master\persistence-modules\hibernate-jpa-2\src\main\java\com\baeldung\hibernate\jpabootstrap\config\HibernatePersistenceUnitInfo.java | 2 |
请完成以下Java代码 | protected final ImmutableMap<Resource, PermissionType> getPermissionsMap()
{
return permissions;
}
/**
* Gets the "NO permission".
*
* It is an instance of PermissionType with all accesses revoked and with a generic {@link Resource}.
*
* <br/>
* <b>NOTE to implementor: it is highly recommended that e... | {
return null;
}
final Resource defaultResource = nonePermission.getResource();
return getPermissionIfExists(defaultResource)
// Fallback: return the "no permission"
.or(nonePermission);
}
@Override
public final boolean hasPermission(final Permission permission)
{
return permissions.values().con... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\permissions\AbstractPermissions.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class EventsourcingInstanceRepository implements InstanceRepository {
private static final Logger log = LoggerFactory.getLogger(EventsourcingInstanceRepository.class);
private final InstanceEventStore eventStore;
private final Retry retryOptimisticLockException = Retry.max(10)
.doBeforeRetry((s) -> log.d... | @Override
public Mono<Instance> compute(InstanceId id, BiFunction<InstanceId, Instance, Mono<Instance>> remappingFunction) {
return this.find(id)
.flatMap((application) -> remappingFunction.apply(id, application))
.switchIfEmpty(Mono.defer(() -> remappingFunction.apply(id, null)))
.flatMap(this::save)
.r... | repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\domain\entities\EventsourcingInstanceRepository.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void setWithoutDeleteReason(Boolean withoutDeleteReason) {
this.withoutDeleteReason = withoutDeleteReason;
}
public String getTaskCandidateGroup() {
return taskCandidateGroup;
}
public void setTaskCandidateGroup(String taskCandidateGroup) {
this.taskCandidateGroup = task... | }
public String getParentScopeId() {
return parentScopeId;
}
public void setParentScopeId(String parentScopeId) {
this.parentScopeId = parentScopeId;
}
public Set<String> getScopeIds() {
return scopeIds;
}
public void setScopeIds(Set<String> scopeIds) {
th... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\history\HistoricTaskInstanceQueryRequest.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private void reinitializeLoggingSystem() {
log.info("Re-initializing Logging System");
// Reinitialize logging system to pick up any encrypted properties used in logging configuration
LoggingApplicationListener loggingListener = ((AbstractApplicationContext) this.applicationContext)
... | */
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
log.info("Post-processing PropertySource instances");
MutablePropertySources propSources = environment.getPropertySources();
converter.convertPropertySources(propSources);... | repos\jasypt-spring-boot-master\jasypt-spring-boot\src\main\java\com\ulisesbocchio\jasyptspringboot\configuration\EnableEncryptablePropertiesBeanFactoryPostProcessor.java | 2 |
请完成以下Java代码 | public class AlfrescoUserTask extends UserTask {
public static final String ALFRESCO_SCRIPT_TASK_LISTENER =
"org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener";
protected String runAs;
protected String scriptProcessor;
public String getRunAs() {
return runAs;
}
... | }
public void setScriptProcessor(String scriptProcessor) {
this.scriptProcessor = scriptProcessor;
}
public AlfrescoUserTask clone() {
AlfrescoUserTask clone = new AlfrescoUserTask();
clone.setValues(this);
return clone;
}
public void setValues(AlfrescoUserTask oth... | repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\alfresco\AlfrescoUserTask.java | 1 |
请完成以下Java代码 | private @Nullable Mono<Object> getRequestBody() {
for (String key : bindingContext.getModel().asMap().keySet()) {
if (key.startsWith(BindingResult.MODEL_KEY_PREFIX)) {
BindingResult result = (BindingResult) bindingContext.getModel().asMap().get(key);
Object target = result.getTarget();
if (target != nu... | return body;
}
}
protected static class BodySender {
@ResponseBody
public @Nullable Publisher<Object> body() {
return null;
}
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-proxyexchange-webflux\src\main\java\org\springframework\cloud\gateway\webflux\ProxyExchange.java | 1 |
请完成以下Java代码 | public void setDelay(Duration delay) {
this.delay = delay;
}
/**
* Return the jitter period to enable random retry attempts.
* @return the jitter value
*/
public @Nullable Duration getJitter() {
return this.jitter;
}
/**
* Specify a jitter period for the base retry attempt, randomly subtracted or add... | */
public void setMultiplier(Double multiplier) {
this.multiplier = multiplier;
}
/**
* Return the maximum delay for any retry attempt.
* @return the maximum delay
*/
public Duration getMaxDelay() {
return this.maxDelay;
}
/**
* Specify the maximum delay for any retry attempt, limiting how far
* {... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\retry\RetryPolicySettings.java | 1 |
请完成以下Java代码 | public class DefaultLazyEncryptor implements StringEncryptor {
private final Singleton<StringEncryptor> singleton;
/**
* <p>Constructor for DefaultLazyEncryptor.</p>
*
* @param e a {@link org.springframework.core.env.ConfigurableEnvironment} object
* @param customEncryptorBeanName a {@link... | * <p>Constructor for DefaultLazyEncryptor.</p>
*
* @param e a {@link org.springframework.core.env.ConfigurableEnvironment} object
*/
public DefaultLazyEncryptor(final ConfigurableEnvironment e) {
singleton = new Singleton<>(() -> createDefault(e));
}
private StringEncryptor createDef... | repos\jasypt-spring-boot-master\jasypt-spring-boot\src\main\java\com\ulisesbocchio\jasyptspringboot\encryptor\DefaultLazyEncryptor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Result<SysAnnouncementSend> readAll() {
Result<SysAnnouncementSend> result = new Result<SysAnnouncementSend>();
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
LambdaUpdateWrapper<SysAnnouncementSend> updateWrapper = new UpdateWrapper().lambda();... | */
@GetMapping(value = "/updateSysAnnounReadFlag")
public Result<AnnouncementSendModel> updateSysAnnounReadFlag(
@RequestParam(name="busId",required=true) String busId,
@RequestParam(name="busType",required=false) String busType) {
//更新阅读状态
sysAnnouncementSendService.updateReadFlagByBusId(busId,busTyp... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\controller\SysAnnouncementSendController.java | 2 |
请完成以下Java代码 | protected void persistDecisions(ParsedDeployment parsedDeployment) {
DmnEngineConfiguration dmnEngineConfiguration = CommandContextUtil.getDmnEngineConfiguration();
DecisionEntityManager decisionEntityManager = dmnEngineConfiguration.getDecisionEntityManager();
for (DecisionEntity decision : pa... | this.dmnDeploymentHelper = dmnDeploymentHelper;
}
public CachingAndArtifactsManager getCachingAndArtifcatsManager() {
return cachingAndArtifactsManager;
}
public void setCachingAndArtifactsManager(CachingAndArtifactsManager manager) {
this.cachingAndArtifactsManager = manager;
}
... | repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\deployer\DmnDeployer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Set<ItemMetric> getIncomes() {
return incomes;
}
public void setIncomes(Set<ItemMetric> incomes) {
this.incomes = incomes;
}
public Set<ItemMetric> getExpenses() {
return expenses;
}
public void setExpenses(Set<ItemMetric> expenses) {
this.expenses = expenses;
}
public Map<StatisticMetric, Bi... | return statistics;
}
public void setStatistics(Map<StatisticMetric, BigDecimal> statistics) {
this.statistics = statistics;
}
public Map<Currency, BigDecimal> getRates() {
return rates;
}
public void setRates(Map<Currency, BigDecimal> rates) {
this.rates = rates;
}
} | repos\piggymetrics-master\statistics-service\src\main\java\com\piggymetrics\statistics\domain\timeseries\DataPoint.java | 2 |
请完成以下Java代码 | public void returnOrderItems(Order order) {
log.info("returnOrderItems: order={}", order);
for (OrderItem item : order.items()) {
inventoryService.addInventory(item.sku(), item.quantity());
}
}
@Override
public void dispatchOrderItems(Order order) {
log.info("del... | null);
return paymentService.processPaymentRequest(request);
}
@Override
public RefundRequest createRefundRequest(PaymentAuthorization payment) {
log.info("createRefundRequest: payment={}", payment);
return paymentService.createRefundRequest(payment);
}
@Override
public... | repos\tutorials-master\saas-modules\temporal\src\main\java\com\baeldung\temporal\workflows\sboot\order\activities\OrderActivitiesImpl.java | 1 |
请完成以下Java代码 | public class OAuth2Error implements Serializable {
private static final long serialVersionUID = 620L;
private final String errorCode;
private final String description;
private final String uri;
/**
* Constructs an {@code OAuth2Error} using the provided parameters.
* @param errorCode the error code
*/
p... | * @return the error description
*/
public final String getDescription() {
return this.description;
}
/**
* Returns the error uri.
* @return the error uri
*/
public final String getUri() {
return this.uri;
}
@Override
public String toString() {
return "[" + this.getErrorCode() + "] " + ((this.getD... | repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\OAuth2Error.java | 1 |
请完成以下Java代码 | private void importDiscountSchemaBreak(@NonNull final I_I_DiscountSchema importRecord)
{
I_M_DiscountSchemaBreak schemaBreak = importRecord.getM_DiscountSchemaBreak();
if (schemaBreak == null)
{
schemaBreak = InterfaceWrapperHelper.create(getCtx(), I_M_DiscountSchemaBreak.class, ITrx.TRXNAME_ThreadInherited);... | schemaBreak.setPaymentDiscount(importRecord.getDiscount());
}
schemaBreak.setM_Product_ID(importRecord.getM_Product_ID());
schemaBreak.setC_PaymentTerm_ID(importRecord.getC_PaymentTerm_ID());
//
setPricingFields(importRecord, schemaBreak);
}
private void setPricingFields(@NonNull final I_I_DiscountSchema i... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\impexp\DiscountSchemaImportProcess.java | 1 |
请完成以下Java代码 | public class X_WEBUI_Board_CardField extends org.compiere.model.PO implements I_WEBUI_Board_CardField, org.compiere.model.I_Persistent
{
private static final long serialVersionUID = -51246966L;
/** Standard Constructor */
public X_WEBUI_Board_CardField (final Properties ctx, final int WEBUI_Board_CardField_... | @Override
public void setWEBUI_Board_CardField_ID (final int WEBUI_Board_CardField_ID)
{
if (WEBUI_Board_CardField_ID < 1)
set_ValueNoCheck (COLUMNNAME_WEBUI_Board_CardField_ID, null);
else
set_ValueNoCheck (COLUMNNAME_WEBUI_Board_CardField_ID, WEBUI_Board_CardField_ID);
}
@Override
public int getWEBU... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java-gen\de\metas\ui\web\base\model\X_WEBUI_Board_CardField.java | 1 |
请完成以下Java代码 | public void setProcessed (final boolean Processed)
{
set_Value (COLUMNNAME_Processed, Processed);
}
@Override
public boolean isProcessed()
{
return get_ValueAsBoolean(COLUMNNAME_Processed);
}
@Override
public void setProductValue (final java.lang.String ProductValue)
{
set_Value (COLUMNNAME_ProductVal... | {
return get_ValueAsString(COLUMNNAME_UOM);
}
@Override
public void setValidFrom (final java.sql.Timestamp ValidFrom)
{
set_Value (COLUMNNAME_ValidFrom, ValidFrom);
}
@Override
public java.sql.Timestamp getValidFrom()
{
return get_ValueAsTimestamp(COLUMNNAME_ValidFrom);
}
@Override
public void setV... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_Campaign_Price.java | 1 |
请完成以下Java代码 | public class SignalEventListenerInstanceImpl implements SignalEventListenerInstance {
protected PlanItemInstance innerPlanItemInstance;
public SignalEventListenerInstanceImpl(PlanItemInstance planItemInstance) {
this.innerPlanItemInstance = planItemInstance;
}
public static SignalEventListene... | return innerPlanItemInstance.getStageInstanceId();
}
@Override
public String getState() {
return innerPlanItemInstance.getState();
}
@Override
public String toString() {
return "SignalEventListenerInstanceImpl{" +
"id='" + getId() + '\'' +
", nam... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\runtime\SignalEventListenerInstanceImpl.java | 1 |
请完成以下Java代码 | public Map<String, Object> deserializeUsingOrgJson(String jsonString) {
try {
JSONObject jsonObject = new JSONObject(jsonString);
Map<String, Object> result = new HashMap<>();
for (String key : jsonObject.keySet()) {
Object value = jsonObject.get(key);
... | return result;
}
private Object convertJsonValue(JsonValue jsonValue) {
switch (jsonValue.getValueType()) {
case STRING:
return ((JsonString) jsonValue).getString();
case NUMBER:
JsonNumber num = (JsonNumber) jsonValue;
return num.... | repos\tutorials-master\json-modules\json-3\src\main\java\com\baeldung\jsondeserialization\JsonDeserializerService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List<User> findUserBatch(List<Long> ids) {
log.info("批量获取用户信息,ids: " + ids);
User[] users = restTemplate.getForObject("http://Server-Provider/user/users?ids={1}", User[].class, StringUtils.join(ids, ","));
return Arrays.asList(users);
}
public String getCacheKey(Long id) {
... | user.setPassword("123456");
return user;
}
public List<User> getUsers() {
return this.restTemplate.getForObject("http://Server-Provider/user", List.class);
}
public String addUser() {
User user = new User(1L, "mrbird", "123456");
HttpStatus status = this.restTemplate.po... | repos\SpringAll-master\30.Spring-Cloud-Hystrix-Circuit-Breaker\Ribbon-Consumer\src\main\java\com\example\demo\Service\UserService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | protected void validateDataImpl(TenantId requestTenantId, User user) {
if (StringUtils.isEmpty(user.getEmail())) {
throw new DataValidationException("User email should be specified!");
}
validateEmail(user.getEmail());
Authority authority = user.getAuthority();
if (... | throw new DataValidationException("Tenant administrator should be assigned to tenant!");
} else if (!customerId.getId().equals(ModelConstants.NULL_UUID)) {
throw new DataValidationException("Tenant administrator can't be assigned to customer!");
}
brea... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\service\validator\UserDataValidator.java | 2 |
请完成以下Java代码 | private void init() {
scheduler.scheduleAtFixedRate(this::reportMetrics, metricsReportIntervalSec, metricsReportIntervalSec, TimeUnit.SECONDS);
}
public void process(TransportProtos.SessionInfoProto sessionInfo, DeviceId gatewayId, List<GatewayMetadata> data, long serverReceiveTs) {
states.comp... | if (state.isEmpty()) {
return;
}
var result = state.getStateResult();
var kvProto = TransportProtos.KeyValueProto.newBuilder()
.setKey(GATEWAY_METRICS)
.setType(TransportProtos.KeyValueType.JSON_V)
.setJsonV(JacksonUtil.toString(result)... | repos\thingsboard-master\common\transport\mqtt\src\main\java\org\thingsboard\server\transport\mqtt\gateway\GatewayMetricsService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private SessionUserInfo getUserInfoFromCache(String token) {
if (StringTools.isNullOrEmpty(token)) {
throw new CommonJsonException(ErrorEnum.E_20011);
}
log.debug("根据token从缓存中查询用户信息,{}", token);
SessionUserInfo info = cacheMap.getIfPresent(token);
if (info == null) {
... | if (!StringTools.isNullOrEmpty(token)) {
cacheMap.invalidate(token);
}
log.debug("退出登录,清除缓存:token={}", token);
}
private SessionUserInfo getUserInfoByUsername(String username) {
SessionUserInfo userInfo = loginDao.getUserInfo(username);
if (userInfo.getRoleIds().cont... | repos\SpringBoot-Shiro-Vue-master\back\src\main\java\com\heeexy\example\service\TokenService.java | 2 |
请完成以下Java代码 | private ProductId getProductId()
{
return externalIdentifierResolver.resolveProductExternalIdentifier(productIdentifier, orgId)
.orElseThrow(() -> new InvalidIdentifierException("Fail to resolve product external identifier")
.appendParametersToMessage()
.setParameter("ExternalIdentifier", productIden... | return bpartnerPriceListServicesFacade.getProductPricesByPLVAndProduct(priceListVersionId, productId)
.stream()
.map(productPrice -> JsonResponsePrice.builder()
.productId(JsonMetasfreshId.of(productId.getRepoId()))
.productCode(productValue)
.taxCategoryId(JsonMetasfreshId.of(productPrice.get... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\pricing\command\SearchProductPricesCommand.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserController {
@Autowired
private UserRepository userRepository;
@RequestMapping(value = "/setSession")
public Map<String, Object> setSession (HttpServletRequest request){
Map<String, Object> map = new HashMap<>();
request.getSession().setAttribute("message", request.get... | String msg="index content";
Object user= request.getSession().getAttribute("user");
if (user==null){
msg="please login first!";
}
return msg;
}
@RequestMapping(value = "/login")
public String login (HttpServletRequest request,String userName,String password){
... | repos\spring-boot-leaning-master\1.x\第10课:Redis实现数据缓存和Session共享\spring-boot-redis-session\src\main\java\com\neo\web\UserController.java | 2 |
请完成以下Java代码 | public class MDunning extends X_C_Dunning
{
/**
*
*/
private static final long serialVersionUID = -3844081441218291895L;
/**
* Standard Constructor
* @param ctx context
* @param C_Dunning_ID id
* @param trxName transaction
*/
public MDunning (Properties ctx, int C_Dunning_ID, String trxName)
{
s... | /**
* String Representation
* @return info
*/
@Override
public String toString()
{
StringBuffer sb = new StringBuffer("MDunning[").append(get_ID())
.append("-").append(getName());
sb.append("]");
return sb.toString();
} // toString
} // MDunning | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MDunning.java | 1 |
请完成以下Java代码 | public boolean isLeaf() {
return isLeaf;
}
public void setLeaf(boolean isLeaf) {
this.isLeaf = isLeaf;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getCode() {
return code;
} | public void setCode(String code) {
this.code = code;
}
private List<TreeSelectModel> children;
public List<TreeSelectModel> getChildren() {
return children;
}
public void setChildren(List<TreeSelectModel> children) {
this.children = children;
}
} | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\TreeSelectModel.java | 1 |
请完成以下Java代码 | Authentication getAuthentication(String token) {
Claims claims = getClaims(token);
User principal = new User(claims.getSubject(), "******", new ArrayList<>());
return new UsernamePasswordAuthenticationToken(principal, token, new ArrayList<>());
}
public Claims getClaims(String token) {
... | final String requestHeader = request.getHeader(properties.getHeader());
if (requestHeader != null && requestHeader.startsWith(properties.getTokenStartWith())) {
return requestHeader.substring(7);
}
return null;
}
/**
* 获取登录用户RedisKey
* @param token /
* @return... | repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\security\security\TokenProvider.java | 1 |
请完成以下Java代码 | public Map<String, SequenceFlow> getSequenceFlows() {
return sequenceFlows;
}
public ProcessDefinitionEntity getCurrentProcessDefinition() {
return currentProcessDefinition;
}
public void setCurrentProcessDefinition(ProcessDefinitionEntity currentProcessDefinition) {
this.curre... | return currentProcess;
}
public void setCurrentProcess(Process currentProcess) {
this.currentProcess = currentProcess;
}
public void setCurrentSubProcess(SubProcess subProcess) {
currentSubprocessStack.push(subProcess);
}
public SubProcess getCurrentSubProcess() {
retu... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\parser\BpmnParse.java | 1 |
请完成以下Java代码 | public boolean isForbidAggCUsForDifferentOrders()
{
return get_ValueAsBoolean(COLUMNNAME_IsForbidAggCUsForDifferentOrders);
}
@Override
public void setM_Picking_Config_ID (final int M_Picking_Config_ID)
{
if (M_Picking_Config_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_Picking_Config_ID, null);
else
set_... | */
public static final int WEBUI_PICKINGTERMINAL_VIEWPROFILE_AD_Reference_ID=540772;
/** groupByProduct = groupByProduct */
public static final String WEBUI_PICKINGTERMINAL_VIEWPROFILE_GroupByProduct = "groupByProduct";
/** Group by Order = groupByOrder */
public static final String WEBUI_PICKINGTERMINAL_VIEWPROFI... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\picking\model\X_M_Picking_Config.java | 1 |
请完成以下Java代码 | public void setMaxClick (int MaxClick)
{
set_Value (COLUMNNAME_MaxClick, Integer.valueOf(MaxClick));
}
/** Get Max Click Count.
@return Maximum Click Count until banner is deactivated
*/
public int getMaxClick ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MaxClick);
if (ii == null)
return 0;
r... | {
set_Value (COLUMNNAME_StartImpression, Integer.valueOf(StartImpression));
}
/** Get Start Count Impression.
@return For rotation we need a start count
*/
public int getStartImpression ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_StartImpression);
if (ii == null)
return 0;
return ii.intValue(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Ad.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.