instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | class Authenticator implements Interceptor {
private final String apiKey;
Authenticator(String apiKey) {
this.apiKey = apiKey;
}
@Override
public Response intercept(Chain chain) throws IOException {
HttpUrl url = chain
.request()
... | @SuppressWarnings("unchecked")
public Map<String, Double> all() {
try {
Map<String, Double> all = new HashMap<>();
List<Map<String, Object>> tags = (List<Map<String, Object>>) topTags.get("tag");
for (Map<String, Object> tag : tags) {
... | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-3\src\main\java\com\baeldung\algorithms\kmeans\LastFmService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class OpenApiLogController extends JeecgController<OpenApiLog, OpenApiLogService> {
/**
* 分页列表查询
*
* @param OpenApiLog
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/list")
public Result<?> queryPageList(OpenApiLog OpenApiLog... | /**
* 批量删除
*
* @param ids
* @return
*/
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.ok("批量删除成功!");
}
/**
... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\openapi\controller\OpenApiLogController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private GetPurchaseOrderFromFileRouteBuilder getPurchaseOrdersFromFileRouteBuilder(@NonNull final JsonExternalSystemRequest request, @NonNull final CamelContext camelContext)
{
return GetPurchaseOrderFromFileRouteBuilder
.builder()
.fileEndpointConfig(PCMConfigUtil.extractLocalFileConfig(request, camelContex... | }
@Override
public String getEnableCommand()
{
return START_PURCHASE_ORDER_SYNC_LOCAL_FILE_ROUTE;
}
@Override
public String getDisableCommand()
{
return STOP_PURCHASE_ORDER_SYNC_LOCAL_FILE_ROUTE;
}
@NonNull
public String getStartPurchaseOrderRouteId()
{
return getExternalSystemTypeCode() + "-" + get... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-pcm-file-import\src\main\java\de\metas\camel\externalsystems\pcm\purchaseorder\LocalFilePurchaseOrderSyncServicePCMRouteBuilder.java | 2 |
请完成以下Java代码 | public void setIsUseForPartnerRequestWindow (boolean IsUseForPartnerRequestWindow)
{
set_Value (COLUMNNAME_IsUseForPartnerRequestWindow, Boolean.valueOf(IsUseForPartnerRequestWindow));
}
/** Get IsUseForPartnerRequestWindow.
@return Flag that tells if the R_Request entries of this type will be displayed or not ... | public org.compiere.model.I_R_StatusCategory getR_StatusCategory() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_R_StatusCategory_ID, org.compiere.model.I_R_StatusCategory.class);
}
@Override
public void setR_StatusCategory(org.compiere.model.I_R_StatusCategory R_StatusCategory)
{
set_ValueFromPO(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_R_RequestType.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Address getSender() {
return sender;
}
/**
* Sets the value of the sender property.
*
* @param value
* allowed object is
* {@link Address }
*
*/
public void setSender(Address value) {
this.sender = value;
}
/**
* Gets the... | */
public Address getRecipient() {
return recipient;
}
/**
* Sets the value of the recipient property.
*
* @param value
* allowed object is
* {@link Address }
*
*/
public void setRecipient(Address value) {
this.recipient = value;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dpd\src\main\java-xjc\com\dpd\common\service\types\shipmentservice\_3\GeneralShipmentData.java | 2 |
请完成以下Java代码 | public void execute(CommandContext commandContext, PlanItemInstanceEntity planItemInstanceEntity) {
ScriptingEngines scriptingEngines = CommandContextUtil.getCmmnEngineConfiguration().getScriptingEngines();
if (scriptingEngines == null) {
throw new FlowableException("Could not execute script... | Object result = scriptingEngines.evaluate(request.build()).getResult();
String resultVariableName = scriptTask.getResultVariableName();
if (StringUtils.isNotBlank(scriptTask.getResultVariableName())) {
planItemInstanceEntity.setVariable(resultVariableName.trim(), result);
... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\behavior\impl\ScriptTaskActivityBehavior.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setType(@Nullable List<PropagationType> type) {
this.type = type;
}
public void setProduce(List<PropagationType> produce) {
this.produce = produce;
}
public void setConsume(List<PropagationType> consume) {
this.consume = consume;
}
public @Nullable List<PropagationType> getType() {
... | * Supported propagation types. The declared order of the values matter.
*/
public enum PropagationType {
/**
* <a href="https://www.w3.org/TR/trace-context/">W3C</a> propagation.
*/
W3C,
/**
* <a href="https://github.com/openzipkin/b3-propagation#single-header">B3
* single header</a> pro... | repos\spring-boot-4.0.1\module\spring-boot-micrometer-tracing\src\main\java\org\springframework\boot\micrometer\tracing\autoconfigure\TracingProperties.java | 2 |
请完成以下Java代码 | public void setRemote_Addr (String Remote_Addr)
{
set_Value (COLUMNNAME_Remote_Addr, Remote_Addr);
}
/** Get Remote Addr.
@return Remote Address
*/
public String getRemote_Addr ()
{
return (String)get_Value(COLUMNNAME_Remote_Addr);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
... | /** Get Counter Count.
@return Web Counter Count Management
*/
public int getW_CounterCount_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_W_CounterCount_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Web Counter.
@param W_Counter_ID
Individual Count hit
*/
public void ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_Counter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public String getTenantId() {
return tenantId;
}
public void setCategory(String category) {
this.category = category;
}
public String getCategory() {
return category;
}
public Strin... | }
public String getScopeType() {
return scopeType;
}
public void setScopeType(String scopeType) {
this.scopeType = scopeType;
}
public String getPropagatedStageInstanceId() {
return propagatedStageInstanceId;
}
public void setPropagatedStageInstanceId(String propa... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\history\task\HistoricTaskInstanceResponse.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = va... | }
/**
* Sets the value of the link property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setLink(String value) {
this.link = value;
}
}
} | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\AttachmentsType.java | 2 |
请完成以下Java代码 | public void setInputs(List<HistoricDecisionInputInstance> inputs) {
this.inputs = inputs;
}
public void setOutputs(List<HistoricDecisionOutputInstance> outputs) {
this.outputs = outputs;
}
public void delete() {
Context
.getCommandContext()
.getDbEntityManager()
.delete(this);
... | this.collectResultValue = collectResultValue;
}
public String getRootDecisionInstanceId() {
return rootDecisionInstanceId;
}
public void setRootDecisionInstanceId(String rootDecisionInstanceId) {
this.rootDecisionInstanceId = rootDecisionInstanceId;
}
public String getDecisionRequirementsDefiniti... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\HistoricDecisionInstanceEntity.java | 1 |
请完成以下Java代码 | public class StockDetailsRowsData implements IRowsData<StockDetailsRow>
{
public static StockDetailsRowsData of(@NonNull final Stream<HUStockInfo> huStockInfos)
{
return new StockDetailsRowsData(huStockInfos);
}
private final Map<DocumentId, StockDetailsRow> document2StockDetailsRow;
private StockDetailsRowsDa... | @Override
public Map<DocumentId, StockDetailsRow> getDocumentId2TopLevelRows()
{
return document2StockDetailsRow;
}
@Override
public DocumentIdsSelection getDocumentIdsToInvalidate(final TableRecordReferenceSet recordRefs)
{
return DocumentIdsSelection.EMPTY;
}
@Override
public void invalidateAll()
{
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\material\cockpit\stockdetails\StockDetailsRowsData.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setCallbackType(String callbackType) {
this.callbackType = callbackType;
}
@ApiModelProperty(example = "123")
public String getReferenceId() {
return referenceId;
}
public void setReferenceId(String referenceId) {
this.referenceId = referenceId;
}
@ApiM... | this.tenantId = tenantId;
}
@ApiModelProperty(example = "someTenantId")
public String getTenantId() {
return tenantId;
}
// Added by Ryan Johnston
public boolean isCompleted() {
return completed;
}
// Added by Ryan Johnston
public void setCompleted(boolean complete... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\process\ProcessInstanceResponse.java | 2 |
请完成以下Java代码 | public static DocumentPrintOptions ofMap(
@NonNull final Map<String, String> map,
@Nullable final String sourceName)
{
if (map.isEmpty() && sourceName == null)
{
return NONE;
}
final HashMap<String, Boolean> options = new HashMap<>();
for (final String name : map.keySet())
{
final Boolean valu... | {
return DocumentPrintOptionValue.MISSING;
}
}
public DocumentPrintOptions mergeWithFallback(@NonNull final DocumentPrintOptions fallback)
{
if (fallback.isNone())
{
return this;
}
else if (isNone())
{
return fallback;
}
else
{
if (this == fallback)
{
throw new IllegalArgumentEx... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\report\DocumentPrintOptions.java | 1 |
请完成以下Java代码 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (event.getApplicationContext() == this.applicationContext) {
... | public void setEndpointRegistry(JmsListenerEndpointRegistry endpointRegistry) {
this.endpointRegistry = endpointRegistry;
}
public String getContainerFactoryBeanName() {
return containerFactoryBeanName;
}
public void setContainerFactoryBeanName(String containerFactoryBeanName) {
... | repos\flowable-engine-main\modules\flowable-event-registry-spring\src\main\java\org\flowable\eventregistry\spring\jms\JmsChannelModelProcessor.java | 1 |
请完成以下Java代码 | public ILatchStragegy getLatchStrategy()
{
return NullLatchStrategy.INSTANCE;
}
public final <T> List<T> retrieveItems(final Class<T> modelType)
{
return Services.get(IQueueDAO.class).retrieveAllItemsSkipMissing(getC_Queue_WorkPackage(), modelType);
}
/**
* Retrieves all active POs, even the ones that are... | }
public final List<I_C_Queue_Element> retrieveQueueElements(final boolean skipAlreadyScheduledItems)
{
return Services.get(IQueueDAO.class).retrieveQueueElements(getC_Queue_WorkPackage(), skipAlreadyScheduledItems);
}
/**
* retrieves all active PO's IDs, even the ones that are caught in other packages
*/
... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\spi\WorkpackageProcessorAdapter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void configure(StateMachineConfigurationConfigurer<String, String> config)
throws Exception {
config
.withConfiguration()
.autoStartup(true)
.listener(new StateMachineListener());
}
@Override
public void configure(StateMachineStateC... | .source("SJ")
.first("high", highGuard())
.then("medium", mediumGuard())
.last("low")
.and().withExternal()
.source("low").target("SF").event("end");
}
@Bean
public Guard<String, String> mediumGuard() {
return ctx -> fa... | repos\tutorials-master\spring-state-machine\src\main\java\com\baeldung\spring\statemachine\config\JunctionStateMachineConfiguration.java | 2 |
请完成以下Java代码 | public void afterPropertiesSet() throws Exception {
if (this.debug) {
System.setProperty("sun.security.krb5.debug", "true");
}
if (this.krbConfLocation != null) {
System.setProperty("java.security.krb5.conf", this.krbConfLocation);
}
}
/**
* Enable debug logs from the Sun Kerberos Implementation. De... | // BeanPostProcessor to ensure that it
// is created before any other bean is created, because the system properties needed
// to be set very early
// in the startup-phase, but after the BeanFactoryPostProcessing.
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansExc... | repos\spring-security-main\kerberos\kerberos-core\src\main\java\org\springframework\security\kerberos\authentication\sun\GlobalSunJaasKerberosConfig.java | 1 |
请完成以下Java代码 | public void setUserElementString6 (final @Nullable String UserElementString6)
{
set_Value (COLUMNNAME_UserElementString6, UserElementString6);
}
@Override
public String getUserElementString6()
{
return get_ValueAsString(COLUMNNAME_UserElementString6);
}
@Override
public void setUserElementString7 (final @... | set_ValueFromPO(COLUMNNAME_C_CostClassification_Category_ID, org.compiere.model.I_C_CostClassification_Category.class, C_CostClassification_Category);
}
@Override
public void setC_CostClassification_Category_ID (final int C_CostClassification_Category_ID)
{
if (C_CostClassification_Category_ID < 1)
set_Value ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_Fact_Acct_Transactions_View.java | 1 |
请完成以下Java代码 | public int getTimeout() {
return timeout;
}
public void setTimeout(int timeout) {
this.timeout = timeout;
}
public boolean isWorking() {
return isWorking;
}
public void waitForComplete(int timeout) {
setTimeout(timeout);
waitForComplete();
}
public void stop() {
workerThread.inte... | int c = 0;
int i = 1000;
while(isWorking()) {
try {
Thread.sleep(i);
c+= to ? c+=i : -1;
}
catch(Exception e) {}
if(to && c >= getTimeout()) {
workerThread.interrupt();
workerThread = null;
break;
}
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\tools\worker\MultiWorker.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class EmployeeController {
@Autowired
EmployeeService employeeService;
@Autowired
private RedisTemplate redisTemplate;
@GetMapping(value = "/list")
public List<Employee> getEmployees() {
return employeeService.list( null );
}
@GetMapping(value = "/{id}")
public Em... | }
@DeleteMapping(value = "/{id}")
public String delete(@PathVariable(value = "id")int id) {
boolean b = employeeService.removeById( id );
if(b) {
return "delete success";
}else {
return "delete fail";
}
}
@PostMapping(value = "")
public Str... | repos\SpringBootLearning-master (1)\springboot-cache\src\main\java\com\gf\controller\EmployeeController.java | 2 |
请完成以下Java代码 | public class EventModel {
protected String key;
protected String name;
protected Map<String, EventPayload> payload = new LinkedHashMap<>();
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getName() {
retu... | }
}
public void addPayload(String name, String type) {
EventPayload eventPayload = payload.get(name);
if (eventPayload != null) {
eventPayload.setType(type);
} else {
payload.put(name, new EventPayload(name, type));
}
}
public void addPayload(Eve... | repos\flowable-engine-main\modules\flowable-event-registry-model\src\main\java\org\flowable\eventregistry\model\EventModel.java | 1 |
请完成以下Java代码 | protected void transformFunctions(List<FeelCustomFunctionProvider> functionProviders) {
functionProviders.forEach(functionProvider -> {
Collection<String> functionNames = functionProvider.getFunctionNames();
functionNames.forEach(functionName -> {
CustomFunction customFunction = functionProvide... | .collect(Collectors.toList());
}
protected Val toVal(Object rawResult) {
return valueMapper.toVal(rawResult);
}
protected Object unpackVal(Val arg) {
return valueMapper.unpackVal(arg);
}
@Override
public Optional<JavaFunction> resolveFunction(String functionName) {
return Optional.ofNullabl... | repos\camunda-bpm-platform-master\engine-dmn\feel-scala\src\main\java\org\camunda\bpm\dmn\feel\impl\scala\function\CustomFunctionTransformer.java | 1 |
请完成以下Java代码 | public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((country == null) ? 0 : country.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
... | } else if (!name.equals(other.name))
return false;
if (country == null) {
if (other.country != null)
return false;
} else if (!country.equals(other.country))
return false;
return true;
}
@Override
public String toString() {
... | repos\tutorials-master\spring-web-modules\spring-thymeleaf-attributes\accessing-session-attributes\src\main\java\com\baeldung\accesing_session_attributes\business\entities\NameCountriesEntity.java | 1 |
请完成以下Java代码 | public static void sendMessageTo(String userId, String pageId, String message) {
VxeSocket socketItem = getUserPool(userId).get(pageId);
if (socketItem != null) {
socketItem.sendMessage(message);
} else {
log.warn("【vxeSocket】消息发送失败:userId\"" + userId + "\"的pageId\"" + pa... | json = JSON.parseObject(message);
} catch (Exception e) {
log.warn("【vxeSocket】收到不合法的消息:" + message);
return;
}
String type = json.getString(VxeSocketConst.TYPE);
switch (type) {
// 心跳检测
case VxeSocketConst.TYPE_HB:
this.sen... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-module\jeecg-module-demo\src\main\java\org\jeecg\modules\demo\mock\vxe\websocket\VxeSocket.java | 1 |
请完成以下Java代码 | public static void updateWorkDates(final IRfQWorkDatesAware workDatesAware)
{
// Calculate Complete Date (also used to verify)
final Timestamp dateWorkStart = workDatesAware.getDateWorkStart();
final Timestamp dateWorkComplete = workDatesAware.getDateWorkComplete();
final int deliveryDays = workDatesAware.getD... | if(dateWorkComplete == null)
{
return;
}
setDeliveryDays(workDatesAware);
}
public static void updateFromDeliveryDays(final IRfQWorkDatesAware workDatesAware)
{
final Timestamp dateWorkStart = workDatesAware.getDateWorkStart();
if(dateWorkStart == null)
{
return;
}
setDateWorkComplete(workDa... | repos\metasfresh-new_dawn_uat\backend\de.metas.rfq\src\main\java\de\metas\rfq\util\RfQWorkDatesUtil.java | 1 |
请完成以下Java代码 | public void setAD_Image_ID (int AD_Image_ID)
{
if (AD_Image_ID < 1)
set_Value (COLUMNNAME_AD_Image_ID, null);
else
set_Value (COLUMNNAME_AD_Image_ID, Integer.valueOf(AD_Image_ID));
}
/** Get Image.
@return Image or Icon
*/
public int getAD_Image_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNA... | public static final int ENTITYTYPE_AD_Reference_ID=389;
/** Set Entity Type.
@param EntityType
Dictionary Entity Type; Determines ownership and synchronization
*/
public void setEntityType (String EntityType)
{
set_Value (COLUMNNAME_EntityType, EntityType);
}
/** Get Entity Type.
@return Dictionary E... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Workbench.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Person {
@Id
@GeneratedValue
private Long id;
private String name;
private int age;
@OneToMany(mappedBy = "author")
private Set<Post> posts = new HashSet<>();
public Person() {
}
public Person(String name, int age) {
this.name = name;
this.age =... | }
public Set<Post> getPosts() {
return posts;
}
public void setPosts(Set<Post> posts) {
this.posts = posts;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
retu... | repos\tutorials-master\persistence-modules\blaze-persistence\src\main\java\com\baeldung\model\Person.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class FileUploadController {
@RequestMapping(value = "/fileUpload", method = RequestMethod.GET)
public String displayForm() {
return "fileUploadForm";
}
@RequestMapping(value = "/uploadFile", method = RequestMethod.POST)
public String submit(@RequestParam("file") final MultipartFil... | public String submit(@RequestParam final MultipartFile file, @RequestParam final String name, @RequestParam final String email, final ModelMap modelMap) {
modelMap.addAttribute("name", name);
modelMap.addAttribute("email", email);
modelMap.addAttribute("file", file);
return "fileUploadV... | repos\tutorials-master\spring-web-modules\spring-mvc-java\src\main\java\com\baeldung\web\controller\FileUploadController.java | 2 |
请完成以下Java代码 | protected CoreModelElement getTargetElement(ProcessDefinitionImpl processDefinition) {
return findTransition(processDefinition);
}
protected TransitionImpl findTransition(ProcessDefinitionImpl processDefinition) {
PvmActivity activity = processDefinition.findActivity(activityId);
EnsureUtil.ensureNotN... | }
@Override
protected String describe() {
StringBuilder sb = new StringBuilder();
sb.append("Start after activity '");
sb.append(activityId);
sb.append("'");
if (ancestorActivityInstanceId != null) {
sb.append(" with ancestor activity instance '");
sb.append(ancestorActivityInstance... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\ActivityAfterInstantiationCmd.java | 1 |
请完成以下Java代码 | public String getBody() {
return super.getBody();
}
@NoXss(fieldName = "web notification button text")
@Length(fieldName = "web notification button text", max = 50, message = "cannot be longer than 50 chars")
@JsonIgnore
public String getButtonText() {
return getButtonConfigProperty... | .map(buttonConfig -> buttonConfig.get(property))
.filter(JsonNode::isTextual)
.map(JsonNode::asText).orElse(null);
}
private Optional<ObjectNode> getButtonConfig() {
return Optional.ofNullable(additionalConfig)
.map(config -> config.get("actionButtonConfi... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\notification\template\WebDeliveryMethodNotificationTemplate.java | 1 |
请完成以下Java代码 | private static <T extends Message> String buildTextMessage(String type, T message) {
JSONObject messageObject = new JSONObject();
messageObject.put("type", type);
messageObject.put("body", message);
return messageObject.toString();
}
/**
* 真正发送消息
*
* @param sessio... | }
RemoteEndpoint.Basic basic = session.getBasicRemote();
if (basic == null) {
LOGGER.error("[sendTextMessage][session 的 为 null]");
return;
}
try {
basic.sendText(messageText);
} catch (IOException e) {
LOGGER.error("[sendTextMessag... | repos\SpringBoot-Labs-master\lab-25\lab-websocket-25-01\src\main\java\cn\iocoder\springboot\lab25\springwebsocket\util\WebSocketUtil.java | 1 |
请完成以下Java代码 | protected boolean isAbleToHandle(@Nullable Resource resource) {
return resource != null;
}
/**
* Reads data from the target {@link Resource} (intentionally) by using the {@link InputStream} returned by
* {@link Resource#getInputStream()}.
*
* However, other algorithm/strategy implementations are free to re... | * @see java.io.InputStream
* @see #read(Resource)
*/
protected abstract @NonNull byte[] doRead(@NonNull InputStream resourceInputStream) throws IOException;
/**
* Pre-processes the target {@link Resource} before reading from the {@link Resource}.
*
* @param resource {@link Resource} to pre-process; never {... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\core\io\AbstractResourceReader.java | 1 |
请完成以下Java代码 | public int size() {
return deque.size();
}
@Override
public boolean isEmpty() {
return deque.isEmpty();
}
@Override
public boolean contains(Object o) {
return deque.contains(o);
}
@Override
public Iterator<E> iterator() {
return deque.iterator();
... | @Override
public boolean containsAll(Collection<?> c) {
return deque.containsAll(c);
}
@Override
public boolean addAll(Collection<? extends E> c) {
return deque.addAll(c);
}
@Override
public boolean removeAll(Collection<?> c) {
return deque.removeAll(c);
}
... | repos\tutorials-master\core-java-modules\core-java-collections-4\src\main\java\com\baeldung\collections\dequestack\ArrayLifoStack.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public void close() {
AppEngines.unregister(this);
appEngineConfiguration.close();
if (appEngineConfiguration.getEngineLifecycleListeners() != ... | @Override
public AppManagementService getAppManagementService() {
return appManagementService;
}
public void setAppManagementService(AppManagementService appManagementService) {
this.appManagementService = appManagementService;
}
@Override
public AppRepositoryService getAppRepo... | repos\flowable-engine-main\modules\flowable-app-engine\src\main\java\org\flowable\app\engine\impl\AppEngineImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public AllocationAmounts withInvoiceProcessingFee(@NonNull final Money invoiceProcessingFee)
{
return Objects.equals(this.invoiceProcessingFee, invoiceProcessingFee)
? this
: toBuilder().invoiceProcessingFee(invoiceProcessingFee).build();
}
public AllocationAmounts movePayAmtToDiscount()
{
if (payAmt.s... | .build();
}
public AllocationAmounts convertToRealAmounts(@NonNull final InvoiceAmtMultiplier invoiceAmtMultiplier)
{
return negateIf(invoiceAmtMultiplier.isNegateToConvertToRealValue());
}
private AllocationAmounts negateIf(final boolean condition)
{
return condition ? negate() : this;
}
public Allocati... | 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 |
请完成以下Java代码 | private IViewRowType getType()
{
return type;
}
public Builder setType(final IViewRowType type)
{
this.type = type;
return this;
}
public Builder setProcessed(final boolean processed)
{
this.processed = processed;
return this;
}
private boolean isProcessed()
{
if (processed == n... | return this;
}
private Map<String, Object> getValues()
{
return values;
}
public LookupValue getFieldValueAsLookupValue(final String fieldName)
{
return LookupValue.cast(values.get(fieldName));
}
public Builder addIncludedRow(final IViewRow includedRow)
{
if (includedRows == null)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\ViewRow.java | 1 |
请完成以下Java代码 | public class AmountAndDirection35 {
@XmlElement(name = "Amt", required = true)
protected BigDecimal amt;
@XmlElement(name = "CdtDbtInd", required = true)
@XmlSchemaType(name = "string")
protected CreditDebitCode cdtDbtInd;
/**
* Gets the value of the amt property.
*
* @return
... | /**
* Gets the value of the cdtDbtInd property.
*
* @return
* possible object is
* {@link CreditDebitCode }
*
*/
public CreditDebitCode getCdtDbtInd() {
return cdtDbtInd;
}
/**
* Sets the value of the cdtDbtInd property.
*
* @param va... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\AmountAndDirection35.java | 1 |
请完成以下Java代码 | public class MAccessLog extends X_AD_AccessLog
{
/**
*
*/
private static final long serialVersionUID = -7169782622717772940L;
/**
* Standard Constructor
* @param ctx context
* @param AD_AccessLog_ID id
* @param trxName transaction
*/
public MAccessLog (Properties ctx, int AD_AccessLog_ID, String t... | setTextMsg(TextMsg);
} // MAccessLog
/**
* New Constructor
* @param ctx context
* @param AD_Table_ID table
* @param AD_Column_ID column
* @param Record_ID record
* @param trxName transaction
*/
public MAccessLog (Properties ctx, int AD_Table_ID, int AD_Column_ID, int Record_ID, String trxName)
{
t... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MAccessLog.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getLogoURL() {
return logoURL;
}
/**
* Sets the value of the logoURL property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setLogoURL(String value) {
this.logoURL = value;
}
/**
* A cert... | public Boolean isSuppressZero() {
return suppressZero;
}
/**
* Sets the value of the suppressZero property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setSuppressZero(Boolean value) {
this.suppressZero = value;
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\PresentationDetailsType.java | 2 |
请完成以下Java代码 | private void actionPerformed0(final ActionEvent e)
{
if (m_updating)
return;
final Object src = e.getSource();
if (src == bOK)
{
updateCConnection();
// Make sure the database connection is OK.
// Else, there is no point to continue because it will fail a bit later.
if (!m_cc.isDatabaseOK())
... | //
dbUidLabel.setReadWrite(dbSettingsWritable);
dbUidField.setReadWrite(dbSettingsWritable);
dbUidField.setText(m_cc.getDbUid());
dbPwdField.setEditable(dbSettingsWritable);
dbPwdField.setText(m_cc.getDbPwd());
//
bTestDB.setToolTipText(m_cc.getConnectionURL());
bTestDB.setIcon(getStatusIcon(m_... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\db\CConnectionDialog.java | 1 |
请完成以下Java代码 | public final class CustomerEntity extends BaseVersionedEntity<Customer> {
@Column(name = ModelConstants.CUSTOMER_TENANT_ID_PROPERTY)
private UUID tenantId;
@Column(name = ModelConstants.CUSTOMER_TITLE_PROPERTY)
private String title;
@Column(name = ModelConstants.COUNTRY_PROPERTY)
private Stri... | this.isPublic = customer.isPublic();
if (customer.getExternalId() != null) {
this.externalId = customer.getExternalId().getId();
}
}
@Override
public Customer toData() {
Customer customer = new Customer(new CustomerId(this.getUuid()));
customer.setCreatedTime(cre... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\model\sql\CustomerEntity.java | 1 |
请完成以下Java代码 | public class InstructionForCreditorAgent1 {
@XmlElement(name = "Cd")
@XmlSchemaType(name = "string")
protected Instruction3Code cd;
@XmlElement(name = "InstrInf")
protected String instrInf;
/**
* Gets the value of the cd property.
*
* @return
* possible object is
... | *
*/
public String getInstrInf() {
return instrInf;
}
/**
* Sets the value of the instrInf property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setInstrInf(String value) {
this.instrInf = value;
... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\InstructionForCreditorAgent1.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DunningDocDocumentLocationAdapterFactory implements DocumentLocationAdapterFactory
{
public static DunningDocDocumentLocationAdapter locationAdapter(@NonNull final I_C_DunningDoc delegate)
{
return new DunningDocDocumentLocationAdapter(delegate);
}
@Override
public Optional<IDocumentLocationAdapter... | public Optional<IDocumentDeliveryLocationAdapter> getDocumentDeliveryLocationAdapter(final Object record)
{
return Optional.empty();
}
@Override
public Optional<IDocumentHandOverLocationAdapter> getDocumentHandOverLocationAdapter(final Object record)
{
return Optional.empty();
}
private static Optional<I_C... | repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java\de\metas\dunning\api\impl\DunningDocDocumentLocationAdapterFactory.java | 2 |
请完成以下Java代码 | public class X_AD_WF_Block extends org.compiere.model.PO implements I_AD_WF_Block, org.compiere.model.I_Persistent
{
private static final long serialVersionUID = 1036331149L;
/** Standard Constructor */
public X_AD_WF_Block (final Properties ctx, final int AD_WF_Block_ID, @Nullable final String trxName)
... | if (AD_Workflow_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_Workflow_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_Workflow_ID, AD_Workflow_ID);
}
@Override
public int getAD_Workflow_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_Workflow_ID);
}
@Override
public void setDescription (final java.lang.Stri... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_Block.java | 1 |
请完成以下Java代码 | public Object getOrgValue() {
return orgValue;
}
public void setOrgValue(Object orgValue) {
this.orgValue = orgValue;
}
public Object getNewValue() {
return newValue;
}
public void setNewValue(Object newValue) {
this.newValue = newValue;
}
public String getNewValueString() {
retu... | }
protected String valueAsString(Object value) {
if(value == null) {
return null;
} else if(value instanceof Date){
return String.valueOf(((Date)value).getTime());
} else {
return value.toString();
}
}
} | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\PropertyChange.java | 1 |
请完成以下Java代码 | private static String getMandatoryProperty(final String name, final String defaultValue)
{
final String systemPropertyValue = System.getProperty(name);
if (isNotBlank(systemPropertyValue))
{
return systemPropertyValue;
}
final String envVarValue = System.getenv(name);
if (isNotBlank(envVarValue))
{
... | {
return Boolean.parseBoolean(systemPropertyValue.trim());
}
final String evnVarValue = System.getenv(name);
if (isNotBlank(evnVarValue))
{
return Boolean.parseBoolean(evnVarValue);
}
final String envVarValueWithUnderscore = System.getenv(name.replace('.', '_'));
if (isNotBlank(envVarValueWithUnder... | repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.cli\src\main\java\de\metas\migration\cli\workspace_migrate\Main.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String findSimpleHelloWorld() {
String cacheKey = "simple-hello";
return simpleHelloWorldCache.computeIfAbsent(cacheKey, k -> repository.getHelloWorld());
}
public String findExpiringHelloWorld() {
String cacheKey = "expiring-hello";
String helloWorld = simpleHelloWorldCa... | }
public String findEvictingHelloWorld(String key) {
String value = evictingHelloWorldCache.get(key);
if (value == null) {
value = repository.getHelloWorld();
evictingHelloWorldCache.put(key, value);
}
return value;
}
public String findPassivatingHel... | repos\tutorials-master\libraries-data-2\src\main\java\com\baeldung\infinispan\service\HelloWorldService.java | 2 |
请完成以下Java代码 | public JsonSerde<T> noTypeInfo() {
this.jsonSerializer.noTypeInfo();
return this;
}
/**
* Don't remove type information headers after deserialization.
* @return the serde.
* @since 2.3
*/
public JsonSerde<T> dontRemoveTypeHeaders() {
this.jsonDeserializer.dontRemoveTypeHeaders();
return this;
}
/... | return this;
}
/**
* Use the supplied {@link org.springframework.kafka.support.mapping.Jackson2JavaTypeMapper}.
* @param mapper the mapper.
* @return the serde.
* @since 2.3
*/
public JsonSerde<T> typeMapper(org.springframework.kafka.support.mapping.Jackson2JavaTypeMapper mapper) {
this.jsonSerializer.s... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\serializer\JsonSerde.java | 1 |
请完成以下Java代码 | public void purgeBuffer()
{
synchronized (lock)
{
buffer.clear();
}
}
public void shutdown()
{
executor.shutdown();
}
/*
public static void main(String[] args) throws InterruptedException
{
final Debouncer<Integer> debouncer = Debouncer.<Integer>builder()
.name("test-debouncer")
.delayInM... | System.out.println("Start sending events...");
for (int i = 1; i <= 100; i++)
{
debouncer.add(i);
//Thread.yield();
Thread.sleep(0, 1);
}
System.out.println("Enqueuing done. Waiting a bit to finish...");
Thread.sleep(5000);
}
*/
} | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\async\Debouncer.java | 1 |
请完成以下Java代码 | public class X_C_Print_Job_Detail extends org.compiere.model.PO implements I_C_Print_Job_Detail, org.compiere.model.I_Persistent
{
private static final long serialVersionUID = -328508281L;
/** Standard Constructor */
public X_C_Print_Job_Detail (Properties ctx, int C_Print_Job_Detail_ID, String trxName)
... | public int getC_Print_Job_Detail_ID()
{
return get_ValueAsInt(COLUMNNAME_C_Print_Job_Detail_ID);
}
@Override
public de.metas.printing.model.I_C_Print_Job_Line getC_Print_Job_Line()
{
return get_ValueAsPO(COLUMNNAME_C_Print_Job_Line_ID, de.metas.printing.model.I_C_Print_Job_Line.class);
}
@Override
public... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java-gen\de\metas\printing\model\X_C_Print_Job_Detail.java | 1 |
请完成以下Java代码 | public class DoubleNonValue {
public static double findLargestThrowException(double[] array) {
if (array.length == 0) {
throw new IllegalArgumentException("Array cannot be empty");
}
double max = array[0];
for (int i = 1; i < array.length; i++) {
... | Double max = null;
for (double value : array) {
if (!Double.isNaN(value) && !Double.isInfinite(value)) {
if (max == null || value > max) {
max = value;
}
}
}
return max;
}
public static dou... | repos\tutorials-master\core-java-modules\core-java-numbers-10\src\main\java\com\baeldung\doublenonvalues\DoubleNonValue.java | 1 |
请完成以下Java代码 | public String variablesCss() {
return "variables.css";
}
@GetMapping(path = "/login", produces = MediaType.TEXT_HTML_VALUE)
public String login() {
return "login";
}
@lombok.Data
@lombok.Builder
public static class Settings {
private final String title;
private final String brand;
private final St... | /**
* A list of child views.
*/
private final List<ExternalView> children;
public ExternalView(String label, String url, Integer order, boolean iframe, List<ExternalView> children) {
Assert.hasText(label, "'label' must not be empty");
if (isEmpty(children)) {
Assert.hasText(url, "'url' must not be ... | repos\spring-boot-admin-master\spring-boot-admin-server-ui\src\main\java\de\codecentric\boot\admin\server\ui\web\UiController.java | 1 |
请完成以下Java代码 | public void incrementCountRetries() {
this.countRetries++;
}
public int getRetriesLeft() {
return Math.max(0, totalRetries - countRetries);
}
protected class FailedJobListenerCmd implements Command<Void> {
protected String jobId;
protected Command<Object> cmd;
public FailedJobListenerCmd... | JobEntity job = commandContext
.getJobManager()
.findJobById(jobId);
if (job != null) {
job.setFailedActivityId(jobFailureCollector.getFailedActivityId());
fireHistoricJobFailedEvt(job);
cmd.execute(commandContext);
} else {
LOG.debugFailedJobNotFound(job... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\FailedJobListener.java | 1 |
请完成以下Java代码 | public KeyStroke getKeyStroke()
{
return getActionType().getKeyStroke();
}
@Override
public boolean isAvailable()
{
return !NullCopyPasteSupportEditor.isNull(getCopyPasteSupport());
}
@Override
public boolean isRunnable()
{
return getCopyPasteSupport().isCopyPasteActionAllowed(getActionType... | }
@Override
public boolean isHideWhenNotRunnable()
{
return false; // just gray it out
}
@Override
public void run()
{
getCopyPasteSupport().executeCopyPasteAction(getActionType());
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\grid\ed\CopyPasteContextMenuAction.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getMEASUREUNIT() {
return measureunit;
}
/**
* Sets the value of the measureunit property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMEASUREUNIT(String value) {
this.measureunit = value;
}
... | *
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link PPACK1 }
*
*
*/
public List<PPACK1> getPPACK1() {
if (ppack1 == null) {
ppack1 = new ArrayList<PPACK1>();
}
return this.ppack1;
}
/**
* Gets the valu... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_stepcom_desadv\de\metas\edi\esb\jaxb\stepcom\desadv\PACKINXlief.java | 2 |
请完成以下Java代码 | public int hashCode()
{
return new HashcodeBuilder()
.append(C_City_ID)
.append(C_Region_ID)
.append(CityName)
.append(RegionName)
.toHashcode();
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
final CityVO other = EqualsBuilder.getOther(this, ... | if (this.RegionName != null)
{
sb.append(" (").append(this.RegionName).append(")");
}
return sb.toString();
}
public int getC_City_ID()
{
return C_City_ID;
}
public String getCityName()
{
return CityName;
}
public int getC_Region_ID()
{
return C_Region_ID;
}
public String getRegionName()... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\grid\ed\CityVO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ThreadPoolTaskSchedulerExamples {
@Autowired
private ThreadPoolTaskScheduler taskScheduler;
@Autowired
private CronTrigger cronTrigger;
@Autowired
private PeriodicTrigger periodicTrigger;
@PostConstruct
public void scheduleRunnableWithCronTrigger() {
taskScheduler... | taskScheduler.schedule(new RunnableTask("Periodic Trigger"), periodicTrigger);
}
class RunnableTask implements Runnable {
private String message;
public RunnableTask(String message) {
this.message = message;
}
@Override
public void run() {
}
}
... | repos\tutorials-master\spring-scheduling\src\main\java\com\baeldung\taskscheduler\ThreadPoolTaskSchedulerExamples.java | 2 |
请完成以下Java代码 | public void onGLJournalLineCompleted(final SAPGLJournalLine line)
{
final FAOpenItemTrxInfo openItemTrxInfo = line.getOpenItemTrxInfo();
if (openItemTrxInfo == null)
{
// shall not happen
return;
}
final AccountConceptualName accountConceptualName = openItemTrxInfo.getAccountConceptualName();
if (ac... | {
// shall not happen
return;
}
final AccountConceptualName accountConceptualName = openItemTrxInfo.getAccountConceptualName();
if (accountConceptualName == null)
{
return;
}
if (accountConceptualName.isAnyOf(B_InTransit_Acct))
{
openItemTrxInfo.getKey().getBankStatementLineId()
.ifPres... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\open_items_handler\BankStatementOIHandler.java | 1 |
请完成以下Java代码 | public boolean isEmpty() {return header.isEmpty() || rowsList.isEmpty();}
public void addRow(@NonNull final Row row)
{
rowsList.add(row);
}
public void addRows(@NonNull final Collection<Row> rows)
{
rowsList.addAll(rows);
}
public void addRows(@NonNull final Table other)
{
rowsList.addAll(other.rowsLis... | }
public Optional<Table> removeColumnsWithSameValue()
{
if (rowsList.isEmpty())
{
return Optional.empty();
}
final Table removedTable = new Table();
for (final String columnName : new ArrayList<>(header))
{
final Cell commonValue = getCommonValue(columnName).orElse(null);
if (commonValue != nu... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\text\tabular\Table.java | 1 |
请完成以下Java代码 | public ListenableFuture<AlarmComment> findAlarmCommentByIdAsync(TenantId tenantId, AlarmCommentId alarmCommentId) {
log.trace("Executing findAlarmCommentByIdAsync by alarmCommentId [{}]", alarmCommentId);
validateId(alarmCommentId, id -> "Incorrect alarmCommentId " + id);
return alarmCommentDao.... | private AlarmComment updateAlarmComment(TenantId tenantId, AlarmComment newAlarmComment) {
log.debug("Update Alarm comment : {}", newAlarmComment);
AlarmComment existing = alarmCommentDao.findAlarmCommentById(tenantId, newAlarmComment.getId().getId());
if (existing != null) {
if (ne... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\alarm\BaseAlarmCommentService.java | 1 |
请完成以下Java代码 | public void setTaskId(String taskId) {
this.taskId = taskId;
}
@Override
public String getExecutionId() {
return executionId;
}
@Override
public Long getLongValue() {
return longValue;
}
@Override
public void setLongValue(Long longValue) {
this.long... | }
sb.append("]");
return sb.toString();
}
// non-supported (v6)
@Override
public String getScopeId() {
return null;
}
@Override
public String getSubScopeId() {
return null;
}
@Override
public String getScopeType() {
return null;... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\VariableInstanceEntity.java | 1 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
@Override
public void setDescription (final @Nullable java.lang.String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
@Override
public java.lang.String getDescrip... | }
@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 setSurcharge_Calc_SQL (final java.lang.String Surcharge_Calc_SQL)
{
set_Value (COLUMN... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_DiscountSchema_Calculated_Surcharge.java | 1 |
请完成以下Java代码 | public boolean isFirstPage() {
return pageNo <= 1;
}
public boolean isLastPage() {
return pageNo >= getTotalPage();
}
public int getNextPage() {
if (isLastPage()) {
return pageNo;
} else {
return pageNo + 1;
}
}
public int getPrePage() {
if (isFirstPage()) {
return pageNo;
} else {
re... | public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
protected int filterNo;
public int getFilterNo() {
return filterNo;
}
public void setFilterNo(int filterNo) {
this.filterNo = filterNo;
}
} | repos\springboot-demo-master\elasticsearch\src\main\java\demo\et59\elaticsearch\page\SimplePage.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public UserEntity getCompanyEntity() {
return companyEntity;
}
public void setCompanyEntity(UserEntity companyEntity) {
this.companyEntity = companyEntity;
}
public int getSales() {
return sales;
}
public void setSales(int sales) {
this.sales = sales;
}
... | return "ProductEntity{" +
"id='" + id + '\'' +
", prodName='" + prodName + '\'' +
", marketPrice='" + marketPrice + '\'' +
", shopPrice='" + shopPrice + '\'' +
", stock=" + stock +
", sales=" + sales +
", wei... | repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Common-Service-Facade\src\main\java\com\gaoxi\entity\product\ProductEntity.java | 2 |
请完成以下Java代码 | public boolean isStoreAttachmentsOnFileSystem ()
{
Object oo = get_Value(COLUMNNAME_StoreAttachmentsOnFileSystem);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Unix Archive Path.
@param UnixArchivePath ... | }
/** Set Windows Archive Path.
@param WindowsArchivePath Windows Archive Path */
@Override
public void setWindowsArchivePath (java.lang.String WindowsArchivePath)
{
set_Value (COLUMNNAME_WindowsArchivePath, WindowsArchivePath);
}
/** Get Windows Archive Path.
@return Windows Archive Path */
@Overrid... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Client.java | 1 |
请完成以下Java代码 | default Instant getIssuedAt() {
return this.getClaimAsInstant(IdTokenClaimNames.IAT);
}
/**
* Returns the time when the End-User authentication occurred {@code (auth_time)}.
* @return the time when the End-User authentication occurred
*/
default Instant getAuthenticatedAt() {
return this.getClaimAsInstant... | */
default String getAuthorizedParty() {
return this.getClaimAsString(IdTokenClaimNames.AZP);
}
/**
* Returns the Access Token hash value {@code (at_hash)}.
* @return the Access Token hash value
*/
default String getAccessTokenHash() {
return this.getClaimAsString(IdTokenClaimNames.AT_HASH);
}
/**
*... | repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\oidc\IdTokenClaimAccessor.java | 1 |
请完成以下Java代码 | public void setWaitingTime (final int WaitingTime)
{
set_Value (COLUMNNAME_WaitingTime, WaitingTime);
}
@Override
public int getWaitingTime()
{
return get_ValueAsInt(COLUMNNAME_WaitingTime);
}
/**
* WorkflowType AD_Reference_ID=328
* Reference name: AD_Workflow Type
*/
public static final int WORK... | @Override
public void setWorkingTime (final int WorkingTime)
{
set_Value (COLUMNNAME_WorkingTime, WorkingTime);
}
@Override
public int getWorkingTime()
{
return get_ValueAsInt(COLUMNNAME_WorkingTime);
}
@Override
public void setYield (final int Yield)
{
set_Value (COLUMNNAME_Yield, Yield);
}
@Over... | 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代码 | class WebMvcEndpointChildContextConfiguration {
/*
* The error controller is present but not mapped as an endpoint in this context
* because of the DispatcherServlet having had its HandlerMapping explicitly disabled.
* So we expose the same feature but only for machine endpoints.
*/
@Bean
@ConditionalOnBean... | * {@link WebServerFactoryCustomizer} to add an {@link ErrorPage} so that the
* {@link ManagementErrorEndpoint} can be used.
*/
static class ManagementErrorPageCustomizer
implements WebServerFactoryCustomizer<ConfigurableServletWebServerFactory>, Ordered {
private final WebProperties properties;
Management... | repos\spring-boot-4.0.1\module\spring-boot-webmvc\src\main\java\org\springframework\boot\webmvc\autoconfigure\actuate\web\WebMvcEndpointChildContextConfiguration.java | 2 |
请完成以下Java代码 | public I_C_BP_BankAccount createNewC_BP_BankAccount(final IContextAware contextProvider, final int bpartnerId)
{
final PaymentString paymentString = getPaymentString();
final I_C_BP_BankAccount bpBankAccount = InterfaceWrapperHelper.newInstance(I_C_BP_BankAccount.class,
contextProvider);
Check.assume(bpart... | bpBankAccount.setQR_IBAN(paymentString.getIBAN());
bpBankAccount.setAccountNo(paymentString.getInnerAccountNo());
bpBankAccount.setESR_RenderedAccountNo(paymentString.getPostAccountNo()); // we can not know it
InterfaceWrapperHelper.save(bpBankAccount);
return bpBankAccount;
}
@Override
public String toSt... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java\de\metas\payment\api\impl\QRPaymentStringDataProvider.java | 1 |
请完成以下Java代码 | public class VertragsdatenAbfragen {
@XmlElement(namespace = "", required = true)
protected String clientSoftwareKennung;
/**
* Gets the value of the clientSoftwareKennung property.
*
* @return
* possible object is
* {@link String }
*
*/
public String g... | }
/**
* Sets the value of the clientSoftwareKennung property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setClientSoftwareKennung(String value) {
this.clientSoftwareKennung = value;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.schema.v1\src\main\java-xjc\de\metas\vertical\pharma\vendor\gateway\msv3\schema\v1\VertragsdatenAbfragen.java | 1 |
请完成以下Java代码 | public void validate(I_AD_ColumnCallout callout)
{
if (Check.isEmpty(callout.getClassname(), true))
{
throw new AdempiereException("No classname specified");
}
final String fqMethodName = callout.getClassname();
final int idx = fqMethodName.lastIndexOf('.');
final String classname = fqMethodName.substr... | {
final I_AD_ColumnCallout callout = InterfaceWrapperHelper.create(violation.getItem(), I_AD_ColumnCallout.class);
final I_AD_Column column = callout.getAD_Column();
final String tableName = Services.get(IADTableDAO.class).retrieveTableName(column.getAD_Table_ID());
message.append("Error on ").append(tabl... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\appdict\validation\spi\impl\ADColumnCalloutADValidator.java | 1 |
请完成以下Java代码 | public void setDescription (java.lang.String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Beschreibung.
@return Beschreibung */
@Override
public java.lang.String getDescription ()
{
return (java.lang.String)get_Value(COLUMNNAME_Description);
}
/** Set Standard.
@param I... | if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
@Override
public void setName (java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@retur... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Region.java | 1 |
请完成以下Java代码 | public void setThrowExceptionWhenTokenRejected(boolean throwExceptionWhenTokenRejected) {
this.throwExceptionWhenTokenRejected = throwExceptionWhenTokenRejected;
}
/**
* Sets the strategy which will be used to validate the loaded <tt>UserDetails</tt>
* object for the user. Defaults to an {@link AccountStatusUs... | */
public void setGrantedAuthoritySupplier(Supplier<Collection<GrantedAuthority>> grantedAuthoritySupplier) {
Assert.notNull(grantedAuthoritySupplier, "grantedAuthoritySupplier cannot be null");
this.grantedAuthoritySupplier = grantedAuthoritySupplier;
}
@Override
public int getOrder() {
return this.order;
... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\preauth\PreAuthenticatedAuthenticationProvider.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void fetchAuthorByBook() {
Book book = bookRepository.findById(4L).orElseThrow();
Author author = authorRepository.findByBooks(book);
System.out.println("Fetched author: " + author);
}
@Transactional
public void fetchBooksByAuthor() {
Author author = authorReposito... | Author author = authorRepository.findById(4L).orElseThrow();
List<BookDto> books = bookRepository.queryByAuthor(author);
System.out.println("Fetched books (DTO):");
books.forEach(b -> System.out.println(b.getTitle()));
}
@Transactional(readOnly = true)
public void fetchAuthorByBook... | repos\Hibernate-SpringBoot-master\HibernateSpringBootPropertyExpressions\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Java代码 | public class LambdaVariables {
private volatile boolean run = true;
private int start = 0;
private ExecutorService executor = Executors.newFixedThreadPool(3);
public static void main(String[] args) {
new LambdaVariables().localVariableMultithreading();
}
Supplier<Integer> incrementer... | * WARNING: always avoid this workaround!!
*/
public void workaroundSingleThread() {
int[] holder = new int[] { 2 };
IntStream sums = IntStream
.of(1, 2, 3)
.map(val -> val + holder[0]);
holder[0] = 0;
System.out.println(sums.sum());
}
/**
* WA... | repos\tutorials-master\core-java-modules\core-java-lambdas-2\src\main\java\com\baeldung\lambdas\LambdaVariables.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class User implements Serializable {
/**
* 编号
*/
@Id
@GeneratedValue
private Long id;
/**
* 名称
*/
@NotEmpty(message = "姓名不能为空")
@Size(min = 2, max = 8, message = "姓名长度必须大于 2 且小于 20 字")
private String name;
/**
* 年龄
*/
@NotNull(message = "年龄... | this.age = age;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public User(String name, Integer age, String birthday) {
this.name = name;
this.age = age;
this.birthday = birthda... | repos\springboot-learning-example-master\chapter-4-spring-boot-validating-form-input\src\main\java\spring\boot\core\domain\User.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public FileVisitResult visitFile(@NonNull final Path currentFile, final BasicFileAttributes attrs)
{
if (bpartnerFileMatcher.matches(currentFile.getFileName()))
{
existingMasterDataFile[0] = currentFile;
return FileVisitResult.TERMINATE;
}
if (warehouseFileMatcher.matches(currentFile.getFil... | final boolean atLEastOneFileFound = existingMasterDataFile[0] != null;
if (atLEastOneFileFound)
{
final String fileName = exchange.getIn().getBody(GenericFile.class).getFileName();
pInstanceLogger.logMessage("There is at least the masterdata file " + existingMasterDataFile[0].getFileName() + " which has to be... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-pcm-file-import\src\main\java\de\metas\camel\externalsystems\pcm\purchaseorder\StallWhileMasterdataFilesExistPolicy.java | 2 |
请完成以下Java代码 | public class UserAggregate {
private EventStore writeRepository;
public UserAggregate(EventStore repository) {
this.writeRepository = repository;
}
public List<Event> handleCreateUserCommand(CreateUserCommand command) {
UserCreatedEvent event = new UserCreatedEvent(command.getUserId()... | writeRepository.addEvent(command.getUserId(), contactAddedEvent);
}
List<Address> addressesToRemove = user.getAddresses()
.stream()
.filter(a -> !command.getAddresses()
.contains(a))
.collect(Collectors.toList());
for (Address address : addres... | repos\tutorials-master\patterns-modules\cqrs-es\src\main\java\com\baeldung\patterns\escqrs\aggregates\UserAggregate.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Guard<String, String> simpleGuard() {
return ctx -> {
int approvalCount = (int) ctx
.getExtendedState()
.getVariables()
.getOrDefault("approvalCount", 0);
return approvalCount > 0;
};
}
@Bean
public Action<String, Stri... | approvals++;
ctx
.getExtendedState()
.getVariables()
.put("approvalCount", approvals);
};
}
@Bean
public Action<String, String> exitAction() {
return ctx -> LOGGER.info("Exit " + ctx
.getSource()
.getId() + " -> " + c... | repos\tutorials-master\spring-state-machine\src\main\java\com\baeldung\spring\statemachine\config\SimpleStateMachineConfiguration.java | 2 |
请完成以下Java代码 | public class DeleteProcessInstanceStartEventSubscriptionCmd extends AbstractProcessStartEventSubscriptionCmd implements Command<Void>, Serializable {
private static final long serialVersionUID = 1L;
protected final ProcessInstanceStartEventSubscriptionDeletionBuilderImpl builder;
public DeleteProcessInsta... | String eventDefinitionKey = eventTypeElements.get(0).getElementText();
String correlationKey = null;
if (builder.hasCorrelationParameterValues()) {
correlationKey = generateCorrelationConfiguration(eventDefinitionKey, builder.getTenantId(),
... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\cmd\DeleteProcessInstanceStartEventSubscriptionCmd.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BookController {
@Autowired
private BookService bookService;
@GetMapping
public List<Book> findAllBooks() {
return bookService.findAllBooks();
}
@GetMapping("/{bookId}")
public Book findBook(@PathVariable("bookId") Long bookId) {
return bookService.findBookByI... | }
@DeleteMapping("/{bookId}")
public void deleteBook(@PathVariable("bookId") Long bookId) {
bookService.deleteBook(bookId);
}
@PutMapping("/{bookId}")
public Book updateBook(@RequestBody Book book, @PathVariable("bookId") Long bookId) {
return bookService.updateBook(book, bookId);
... | repos\tutorials-master\spring-cloud-modules\spring-cloud-bootstrap\zipkin-log-svc-book\src\main\java\com\baeldung\spring\cloud\bootstrap\svcbook\book\BookController.java | 2 |
请完成以下Java代码 | public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public Book title(String title) {
this.title = title;
return this;
}
public void setTitle(String title) {
this.title = title;
}
public String getIsbn() {
... | if (this == obj) {
return true;
}
if (!(obj instanceof Book)) {
return false;
}
return id != null && id.equals(((Book) obj).id);
}
@Override
public int hashCode() {
return 2021;
}
@Override
public String toString() {
retur... | repos\Hibernate-SpringBoot-master\HibernateSpringBootFluentApiAdditionalMethods\src\main\java\com\bookstore\entity\Book.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setPercentage(BigDecimal value) {
this.percentage = value;
}
/**
* Gets the value of the amount property.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getAmount(... | /**
* Sets the value of the vatRate property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
*/
public void setVATRate(BigDecimal value) {
this.vatRate = value;
}
/**
* Gets the value... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\extensions\edifact\AdditionalChargesAndReductionsType.java | 2 |
请完成以下Java代码 | public void setAD_User_ID (int AD_User_ID)
{
if (AD_User_ID < 0)
set_ValueNoCheck (COLUMNNAME_AD_User_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID));
}
/** Get Ansprechpartner.
@return User within the system - Internal or Business Partner Contact
*/
@Override... | {
if (Node_ID < 0)
set_Value (COLUMNNAME_Node_ID, null);
else
set_Value (COLUMNNAME_Node_ID, Integer.valueOf(Node_ID));
}
/** Get Node_ID.
@return Node_ID */
@Override
public int getNode_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Node_ID);
if (ii == null)
return 0;
return ii.int... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_TreeBar.java | 1 |
请完成以下Java代码 | public class Signal extends BaseElement {
public static final String SCOPE_GLOBAL = "global";
public static final String SCOPE_PROCESS_INSTANCE = "processInstance";
protected String name;
protected String scope;
public Signal() {}
public Signal(String id, String name) {
this.id = id... | this.scope = scope;
}
public Signal clone() {
Signal clone = new Signal();
clone.setValues(this);
return clone;
}
public void setValues(Signal otherElement) {
super.setValues(otherElement);
setName(otherElement.getName());
setScope(otherElement.getScope(... | repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\Signal.java | 1 |
请完成以下Java代码 | public String getTour() {
return tour;
}
/**
* Sets the value of the tour property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTour(String value) {
this.tour = value;
}
/**
* Gets the value of the... | *
* @param value
* allowed object is
* {@link VerfuegbarkeitDefektgrund }
*
*/
public void setGrund(VerfuegbarkeitDefektgrund value) {
this.grund = value;
}
/**
* Gets the value of the tourabweichung property.
*
*/
public boolean isTourabwe... | 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 |
请完成以下Java代码 | public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassWord() {
return passWord;
}
public void setPassWord(String passWord) {
this.passWord = passWord;
}
public int g... | }
public Date getRegTime() {
return regTime;
}
public void setRegTime(Date regTime) {
this.regTime = regTime;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
} | repos\spring-boot-leaning-master\1.x\第06课:Jpa 和 Thymeleaf 实践\spring-boot-jpa-thymeleaf\src\main\java\com\neo\entity\User.java | 1 |
请完成以下Java代码 | public void setSttlmPlc(BranchAndFinancialInstitutionIdentification4 value) {
this.sttlmPlc = value;
}
/**
* Gets the value of the prtry property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
... | *
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ProprietaryAgent2 }
*
*
*/
public List<ProprietaryAgent2> getPrtry() {
if (prtry == null) {
prtry = new ArrayList<ProprietaryAgent2>();
}
return this.prtry;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\TransactionAgents2.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DataSource dataSource() {
final DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName(env.getProperty("driverClassName"));
dataSource.setUrl(env.getProperty("url"));
dataSource.setUsername(env.getProperty("user"));
dataSource.set... | final Properties additionalProperties() {
final Properties hibernateProperties = new Properties();
if (env.getProperty("hibernate.hbm2ddl.auto") != null) {
hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto"));
}
if (env.getPrope... | repos\tutorials-master\spring-security-modules\spring-security-web-boot-3\src\main\java\com\baeldung\relationships\AppConfig.java | 2 |
请完成以下Java代码 | public void setSeparator (final java.lang.String Separator)
{
set_Value (COLUMNNAME_Separator, Separator);
}
@Override
public java.lang.String getSeparator()
{
return get_ValueAsString(COLUMNNAME_Separator);
}
/**
* TaxCorrectionType AD_Reference_ID=392
* Reference name: C_AcctSchema TaxCorrectionTyp... | /** DiscountOnly = D */
public static final String TAXCORRECTIONTYPE_DiscountOnly = "D";
/** Write_OffAndDiscount = B */
public static final String TAXCORRECTIONTYPE_Write_OffAndDiscount = "B";
@Override
public void setTaxCorrectionType (final java.lang.String TaxCorrectionType)
{
set_Value (COLUMNNAME_TaxCorre... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_AcctSchema.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public LocalDateTime getCreatedAt() {
return createdAt;
}
public void setCreatedAt(LocalDateTime createdAt) {
this.createdAt = createdAt;
}
public LocalDate... | public void setUpdatedAt(LocalDateTime updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public String toString() {
return "Event{" +
"id=" + id +
", name='" + name + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
... | repos\tutorials-master\persistence-modules\spring-jpa-3\src\main\java\com\baeldung\jpa\localdatetimequery\Event.java | 1 |
请完成以下Java代码 | public class MqttTopicMatcher {
@Getter
private final String topic;
private final Pattern topicRegex;
public MqttTopicMatcher(String topic) {
if (topic == null) {
throw new NullPointerException("topic");
}
this.topic = topic;
this.topicRegex = Pattern.compil... | public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MqttTopicMatcher that = (MqttTopicMatcher) o;
return topic.equals(that.topic);
}
@Override
public int hashCode() {
return topic.hashCode();
... | repos\thingsboard-master\common\transport\mqtt\src\main\java\org\thingsboard\server\transport\mqtt\session\MqttTopicMatcher.java | 1 |
请完成以下Java代码 | private static String newEventId()
{
return UUID.randomUUID().toString();
}
public ClientId getClientId()
{
return getClientAndOrgId().getClientId();
}
public OrgId getOrgId()
{
return getClientAndOrgId().getOrgId();
} | @NonNull
public EventDescriptor withNewEventId()
{
return toBuilder()
.eventId(newEventId())
.build();
}
@NonNull
public EventDescriptor withClientAndOrg(@NonNull final ClientAndOrgId clientAndOrgId)
{
return toBuilder()
.clientAndOrgId(clientAndOrgId)
.build();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\commons\EventDescriptor.java | 1 |
请完成以下Java代码 | public static final class Builder
{
private final Map<DependencyType, ImmutableSetMultimap.Builder<String, String>> type2name2dependencies = new HashMap<>();
private Builder()
{
super();
}
public DocumentFieldDependencyMap build()
{
if (type2name2dependencies.isEmpty())
{
return EMPTY;
}
... | final ImmutableSetMultimap.Builder<String, String> fieldName2dependsOnFieldNames
= type2name2dependencies.computeIfAbsent(dependencyType, k -> ImmutableSetMultimap.builder());
for (final String dependsOnFieldName : dependsOnFieldNames)
{
fieldName2dependsOnFieldNames.put(dependsOnFieldName, fieldName);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\DocumentFieldDependencyMap.java | 1 |
请完成以下Java代码 | public void show(Component invoker, int x, int y)
{
boolean available = checkAvailableActions();
if (available)
{
super.show(invoker, x, y);
}
else
{
setVisible(false);
}
}
/**
* Check and update all menu items if available
*
* @return true if ANY item is available
*/
private boolean c... | else
{
itemComp.setVisible(true);
itemComp.setEnabled(true);
}
return true;
}
private final IContextMenuAction getAction(MenuElement me)
{
final Component c = me.getComponent();
if (c instanceof JComponent)
{
final JComponent jc = (JComponent)c;
final IContextMenuAction action = (IContextMe... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\grid\ed\menu\EditorContextPopupMenu.java | 1 |
请完成以下Java代码 | public synchronized boolean hasActiveSubscriptions()
{
return !activeSubscriptionIds.isEmpty();
}
public synchronized boolean isShallBeDestroyed()
{
return destroyIfNoActiveSubscriptions && !hasActiveSubscriptions();
}
private WebSocketProducerInstance toNullIfShallBeDestroyed()
{
return isShal... | if (scheduledFuture == null)
{
return;
}
try
{
scheduledFuture.cancel(true);
}
catch (final Exception ex)
{
logger.warn("{}: Failed stopping scheduled future: {}. Ignored and considering it as stopped", this, scheduledFuture, ex);
}
scheduledFuture = null;
}
private void pol... | repos\metasfresh-new_dawn_uat\backend\de.metas.util.web\src\main\java\de\metas\websocket\producers\WebSocketProducersRegistry.java | 1 |
请完成以下Java代码 | public Builder attribute(String name, Object value) {
if (this.attributes == null) {
this.attributes = new HashMap<>();
}
this.attributes.put(name, value);
return this;
}
/**
* Builds a new {@link OAuth2AuthorizationContext}.
* @return a {@link OAuth2AuthorizationContext}
*/
public OAuth... | context.clientRegistration = this.authorizedClient.getClientRegistration();
context.authorizedClient = this.authorizedClient;
}
else {
context.clientRegistration = this.clientRegistration;
}
context.principal = this.principal;
context.attributes = Collections.unmodifiableMap(CollectionUtils.isEmp... | repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\OAuth2AuthorizationContext.java | 1 |
请完成以下Java代码 | public TbMsgBuilder metaData(TbMsgMetaData metaData) {
this.metaData = metaData;
return this;
}
public TbMsgBuilder copyMetaData(TbMsgMetaData metaData) {
this.metaData = metaData.copy();
return this;
}
public TbMsgBuilder dataType(TbMsgD... | }
public TbMsgBuilder ctx(TbMsgProcessingCtx ctx) {
this.ctx = ctx;
return this;
}
public TbMsgBuilder callback(TbMsgCallback callback) {
this.callback = callback;
return this;
}
public TbMsg build() {
return new TbMs... | repos\thingsboard-master\common\message\src\main\java\org\thingsboard\server\common\msg\TbMsg.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public UnitPriceType getSalesValue() {
return salesValue;
}
/**
* Sets the value of the salesValue property.
*
* @param value
* allowed object is
* {@link UnitPriceType }
*
*/
public void setSalesValue(UnitPriceType value) {
this.salesValue =... | }
/**
* The overall amount for this line item (net value).
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getLineItemAmount() {
return lineItemAmount;
}
/**
* Sets the value of the lineItemAmount property.
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ListLineItemType.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.