instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public class SysRolePermission implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
private String id;
/**
* 角色id
*/
private String roleId;
/**
* 权限id
*/
private String permissionId;... | /**
* 操作ip
*/
private String operateIp;
public SysRolePermission() {
}
public SysRolePermission(String roleId, String permissionId) {
this.roleId = roleId;
this.permissionId = permissionId;
}
} | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\entity\SysRolePermission.java | 1 |
请完成以下Java代码 | public class AtomicOperationTransitionCreateScope implements AtomicOperation {
private static final Logger LOGGER = LoggerFactory.getLogger(AtomicOperationTransitionCreateScope.class);
@Override
public boolean isAsync(InterpretableExecution execution) {
ActivityImpl activity = (ActivityImpl) execu... | propagatingExecution.setActivity(activity);
propagatingExecution.setTransition(execution.getTransition());
execution.setTransition(null);
execution.setActivity(null);
execution.setActive(false);
LOGGER.debug("create scope: parent {} continues as execution {}",... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\pvm\runtime\AtomicOperationTransitionCreateScope.java | 1 |
请完成以下Java代码 | private static IZoomSource retrieveZoomSourceOrNull(final String tableName, final MQuery query, final AdWindowId adWindowId)
{
final PO po = new Query(Env.getCtx(), tableName, query.getWhereClause(), ITrx.TRXNAME_None)
.firstOnly(PO.class);
if (po == null)
{
return null;
}
return POZoomSource.of(po, a... | }
// in Swing this is not needed because we have the Posted button
SpringContextHolder.instance.getBean(FactAcctRelatedDocumentsProvider.class).disable();
final RelatedDocumentsFactory relatedDocumentsFactory = SpringContextHolder.instance.getBean(RelatedDocumentsFactory.class);
final RelatedDocumentsPermissi... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\AZoomAcross.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Object aggregationGroupAvg() {
// 使用管道操作符 $group 进行分组,然后统计各个组文档某字段值平均值
AggregationOperation group = Aggregation.group("sex").avg("salary").as("salaryAvg");
// 将操作加入到聚合对象中
Aggregation aggregation = Aggregation.newAggregation(group);
// 执行聚合查询
AggregationResults<Map>... | AggregationOperation sort = Aggregation.sort(Sort.by("salary").ascending());
AggregationOperation group = Aggregation.group("sex").last("salary").as("salaryLast");
// 将操作加入到聚合对象中
Aggregation aggregation = Aggregation.newAggregation(sort, group);
// 执行聚合查询
AggregationResults<Map> ... | repos\springboot-demo-master\mongodb\src\main\java\demo\et\mongodb\service\AggregateGroupService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Result<?> getRedisInfo() throws Exception {
List<RedisInfo> infoList = this.redisService.getRedisInfo();
//log.info(infoList.toString());
return Result.ok(infoList);
}
/**
* Redis历史性能指标查询(过去一小时)
* @return
* @throws Exception
* @author chenrui
* @date 2024/5/14 14:56
*/
... | */
@GetMapping("/infoForReport")
public Map<String, JSONArray> infoForReport() throws Exception {
return redisService.getMapForReport("3");
}
@GetMapping("/memoryInfo")
public Map<String, Object> getMemoryInfo() throws Exception {
return redisService.getMemoryInfo();
}
/**
... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\monitor\controller\ActuatorRedisController.java | 2 |
请完成以下Java代码 | public void updateFAOpenItemTrxInfo()
{
if (openItemTrxInfo != null)
{
return;
}
this.openItemTrxInfo = services.computeOpenItemTrxInfo(this).orElse(null);
}
void setOpenItemTrxInfo(@Nullable final FAOpenItemTrxInfo openItemTrxInfo)
{
this.openItemTrxInfo = openItemTrxInfo;
}
public void updateFro... | setAmtAcct(changes.getAmtAcctDr(), changes.getAmtAcctCr());
updateCurrencyRate();
if (changes.getAccountId() != null)
{
this.accountId = changes.getAccountId();
}
setTaxIdAndUpdateVatCode(changes.getTaxId());
setDescription(changes.getDescription());
this.M_Product_ID = changes.getProductId();
this... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\FactLine.java | 1 |
请完成以下Java代码 | public EventDeploymentEntity getDeployment() {
return deploymentEntity;
}
public List<EventDefinitionEntity> getAllEventDefinitions() {
return eventDefinitions;
}
public List<ChannelDefinitionEntity> getAllChannelDefinitions() {
return channelDefinitions;
}
public ... | public EventResourceEntity getResourceForChannelDefinition(ChannelDefinitionEntity channelDefinition) {
return mapChannelDefinitionsToResources.get(channelDefinition);
}
public ChannelDefinitionParse getChannelDefinitionParseForChannelDefinition(ChannelDefinitionEntity channelDefinition) {
retu... | repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\deployer\ParsedDeployment.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void addQtyPickedAndUpdateHU(final AddQtyPickedRequest request)
{
huShipmentScheduleBL.addQtyPickedAndUpdateHU(request);
}
public void deleteByTopLevelHUsAndShipmentScheduleId(@NonNull final Collection<I_M_HU> topLevelHUs, @NonNull final ShipmentScheduleId shipmentScheduleId)
{
huShipmentScheduleBL.dele... | {
return huShipmentScheduleBL.getQtyRemainingToScheduleForPicking(shipmentScheduleRecord);
}
public void flagForRecompute(@NonNull final Set<ShipmentScheduleId> shipmentScheduleIds)
{
huShipmentScheduleBL.flagForRecompute(shipmentScheduleIds);
}
public ShipmentScheduleLoadingCache<de.metas.handlingunits.mode... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\external\shipmentschedule\PickingJobShipmentScheduleService.java | 2 |
请完成以下Java代码 | public void setC_DocBaseType_Counter_ID (int C_DocBaseType_Counter_ID)
{
if (C_DocBaseType_Counter_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_DocBaseType_Counter_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_DocBaseType_Counter_ID, Integer.valueOf(C_DocBaseType_Counter_ID));
}
/** Get C_DocBaseType_Counter... | public java.lang.String getCounter_DocBaseType ()
{
return (java.lang.String)get_Value(COLUMNNAME_Counter_DocBaseType);
}
/** Set Document BaseType.
@param DocBaseType
Logical type of document
*/
@Override
public void setDocBaseType (java.lang.String DocBaseType)
{
set_Value (COLUMNNAME_DocBaseType,... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_DocBaseType_Counter.java | 1 |
请完成以下Java代码 | private int getInsertBatchSize()
{
return sysConfigBL.getIntValue(SYSCONFIG_InsertBatchSize, -1);
}
private PInstanceId getOrCreateRecordsToImportSelectionId()
{
if (_recordsToImportSelectionId == null)
{
final ImportTableDescriptor importTableDescriptor = importFormat.getImportTableDescriptor();
final... | private DataImportResult createResult()
{
final Duration duration = Duration.between(startTime, SystemTime.asInstant());
return DataImportResult.builder()
.dataImportConfigId(dataImportConfigId)
.duration(duration)
//
.insertIntoImportTable(insertIntoImportTableResult)
.importRecordsValidation... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\DataImportCommand.java | 1 |
请完成以下Java代码 | public void setHUAttributesDAO(final IHUAttributesDAO huAttributesDAO)
{
this.huAttributesDAO = huAttributesDAO;
//
// Update factory if is instantiated
if (factory != null)
{
factory.setHUAttributesDAO(huAttributesDAO);
}
}
@Override
public IHUStorageDAO getHUStorageDAO()
{
return getHUStorageF... | factory.setHUStorageFactory(huStorageFactory);
}
}
@Override
public IHUStorageFactory getHUStorageFactory()
{
return huStorageFactory;
}
@Override
public void flush()
{
final IHUAttributesDAO huAttributesDAO = this.huAttributesDAO;
if (huAttributesDAO != null)
{
huAttributesDAO.flush();
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\storage\impl\ClassAttributeStorageFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PaymentReservation
{
ClientId clientId;
OrgId orgId;
Money amount;
LocalDate dateTrx;
PaymentRule paymentRule;
BPartnerContactId payerContactId;
EMailAddress payerEmail;
@NonNull
@NonFinal
PaymentReservationStatus status;
OrderId salesOrderId;
@Nullable
@NonFinal
@Setter(AccessLevel.PACKA... | {
this.clientId = clientId;
this.orgId = orgId;
this.amount = amount;
this.payerContactId = payerContactId;
this.payerEmail = payerEmail;
this.salesOrderId = salesOrderId;
this.dateTrx = dateTrx;
this.paymentRule = paymentRule;
this.status = status;
this.id = id;
}
public void changeStatusTo(@Non... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\payment\reservation\PaymentReservation.java | 2 |
请完成以下Java代码 | public Result train(String trainingFile, String modelFile) throws IOException
{
return train(trainingFile, trainingFile, modelFile);
}
public Result train(String trainingFile, String developFile, String modelFile) throws IOException
{
return train(trainingFile, developFile, modelFile, 0... | storage.add(word);
}
}
else
{
line = line.trim();
if (line.length() != 0)
{
storage.add(line);
}
}
}
br.close();
}
} | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\perceptron\PerceptronTrainer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class AwsConfigurationProperties {
@NotBlank(message = "AWS region must be configured")
private String region;
@NotBlank(message = "AWS access key must be configured")
private String accessKey;
@NotBlank(message = "AWS secret key must be configured")
private String secretKey;
publ... | return accessKey;
}
public void setAccessKey(String accessKey) {
this.accessKey = accessKey;
}
public String getSecretKey() {
return secretKey;
}
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
} | repos\tutorials-master\aws-modules\amazon-textract\src\main\java\com\baeldung\textract\configuration\AwsConfigurationProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void initPay(@ModelAttribute ProgramPayRequestBo programPayRequestBo, BindingResult bindingResult, HttpServletResponse httpServletResponse, HttpServletRequest httpServletRequest) {
String payResultJson = "";
try{
RpUserPayConfig rpUserPayConfig = cnpPayService.checkParamAndGetUserPay... | }
@RequestMapping("/authorize")
@ResponseBody
public String wxAuthorize(@RequestParam("code") String code) {
String authUrl = WeixinConfigUtil.xAuthUrl.replace("{APPID}", WeixinConfigUtil.xAppId).replace("{SECRET}", WeixinConfigUtil.xPartnerKey).replace("{JSCODE}", code).replace("{GRANTTYPE}", Weix... | repos\roncoo-pay-master\roncoo-pay-web-gateway\src\main\java\com\roncoo\pay\controller\ProgramPayController.java | 2 |
请完成以下Java代码 | protected DirContext getDirContextInstance(final @SuppressWarnings("rawtypes") Hashtable environment)
throws NamingException {
environment.put(Context.SECURITY_AUTHENTICATION, "GSSAPI");
Subject serviceSubject = login();
final NamingException[] suppressedException = new NamingException[] { null };
DirConte... | private Subject login() throws AuthenticationException {
try {
LoginContext lc = new LoginContext(KerberosLdapContextSource.class.getSimpleName(), null, null,
this.loginConfig);
lc.login();
return lc.getSubject();
}
catch (LoginException ex) {
AuthenticationException ae = new AuthenticationExce... | repos\spring-security-main\kerberos\kerberos-client\src\main\java\org\springframework\security\kerberos\client\ldap\KerberosLdapContextSource.java | 1 |
请完成以下Java代码 | public void execute(PvmExecutionImpl execution) {
// reset activity instance id before creating the scope
execution.setActivityInstanceId(execution.getParentActivityInstanceId());
PvmExecutionImpl propagatingExecution = null;
PvmActivity activity = execution.getActivity();
if (activity.isScope()) ... | propagatingExecution.initialize();
} else {
propagatingExecution = execution;
}
scopeCreated(propagatingExecution);
}
/**
* Called with the propagating execution
*/
protected abstract void scopeCreated(PvmExecutionImpl execution);
} | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\pvm\runtime\operation\PvmAtomicOperationCreateScope.java | 1 |
请完成以下Java代码 | public ProcessEngineException resolveDelegateExpressionException(Expression expression, Class<?> parentClass, Class<JavaDelegate> javaDelegateClass) {
return new ProcessEngineException(exceptionMessage(
"033",
"Delegate Expression '{}' did neither resolve to an implementation of '{}' nor '{}'.",
e... | return new ProcessEngineException(
exceptionMessage("041", "Class '{}' doesn't implement '{}'.", className, delegateVarMapping));
}
public ProcessEngineException missingBoundaryCatchEventError(String executionId, String errorCode, String errorMessage) {
return new ProcessEngineException(
exceptionM... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\behavior\BpmnBehaviorLogger.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/user/**")
.allowedMethods("GET", "POST")
.allowedOrigins("https://javastack.cn")
.allowedHeaders("header1", "header2", "header3")
.exposedHeaders("header1", "header2")
... | public RestTemplate defaultRestTemplate(RestTemplateBuilder restTemplateBuilder) {
return restTemplateBuilder
.setConnectTimeout(Duration.ofSeconds(5))
.setReadTimeout(Duration.ofSeconds(5))
.basicAuthentication("test", "test")
.build();
}
... | repos\spring-boot-best-practice-master\spring-boot-web\src\main\java\cn\javastack\springboot\web\config\WebConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class M_HU_Reservation
{
@ModelChange( //
timings = { ModelValidator.TYPE_BEFORE_NEW, ModelValidator.TYPE_BEFORE_CHANGE }, //
ifColumnsChanged = I_M_HU_Reservation.COLUMNNAME_C_OrderLineSO_ID)
public void updateC_BPartner_ID(@NonNull final I_M_HU_Reservation huReservationRecord)
{
final I_C_OrderLine ... | timings = { ModelValidator.TYPE_AFTER_CHANGE, ModelValidator.TYPE_BEFORE_DELETE }, //
ifColumnsChanged = I_M_HU_Reservation.COLUMNNAME_IsActive)
public void unsetVhuReservedFlag(
@NonNull final I_M_HU_Reservation huReservationRecord,
@NonNull final ModelChangeType type)
{
final boolean reservationIsGone = ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\reservation\interceptor\M_HU_Reservation.java | 2 |
请完成以下Java代码 | public class PosTagCompiler
{
/**
* 编译,比如将词性为数词的转为##数##
* @param tag 标签
* @param name 原词
* @return 编译后的等效词
*/
public static String compile(String tag, String name)
{
if (tag.startsWith("m")) return Predefine.TAG_NUMBER;
else if (tag.startsWith("nr")) return Predefine... | // case "nr":
// case "nr1":
// case "nr2":
// case "nrf":
// case "nrj":
// return Predefine.TAG_PEOPLE;
// case "ns":
// case "nsf":
// return Predefine.TAG_PLACE;
// case "nt":
// retu... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\dependency\CoNll\PosTagCompiler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JavaPersonBean {
public String jj;
private String firstName;
private String lastName;
private String age;
private String eyesColor;
private String hairColor;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName)... | return age;
}
public void setAge(String age) {
this.age = age;
}
public String getEyesColor() {
return eyesColor;
}
public void setEyesColor(String eyesColor) {
this.eyesColor = eyesColor;
}
public String getHairColor() {
return hairColor;
}
p... | repos\tutorials-master\spring-boot-modules\spring-boot-groovy\src\main\java\com\baeldung\groovyconfig\JavaPersonBean.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public LocalStorageDto findById(Long id){
LocalStorage localStorage = localStorageRepository.findById(id).orElseGet(LocalStorage::new);
ValidationUtil.isNull(localStorage.getId(),"LocalStorage","id",id);
return localStorageMapper.toDto(localStorage);
}
@Override
@Transactional(rollb... | FileUtil.del(storage.getPath());
localStorageRepository.delete(storage);
}
}
@Override
public void download(List<LocalStorageDto> queryAll, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (LocalStorageDto localSt... | repos\eladmin-master\eladmin-tools\src\main\java\me\zhengjie\service\impl\LocalStorageServiceImpl.java | 2 |
请完成以下Java代码 | public class PaymentAllocationLineId implements RepoIdAware
{
@Getter private final PaymentAllocationId headerId;
private final int lineRecordId;
public PaymentAllocationLineId(@NonNull final PaymentAllocationId headerId, final int C_AllocationLine_ID)
{
this.headerId = headerId;
this.lineRecordId = Check.assu... | {
return null;
}
return new PaymentAllocationLineId(PaymentAllocationId.ofRepoId(C_AllocationHdr_ID), C_AllocationLine_ID);
}
@JsonValue
@Override
public int getRepoId() {return lineRecordId;}
public static int toRepoId(final PaymentAllocationLineId id)
{
return id != null ? id.getRepoId() : -1;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\allocation\api\PaymentAllocationLineId.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setLINENUMBER(String value) {
this.linenumber = value;
}
/**
* Gets the value of the amountqual property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAMOUNTQUAL() {
return amountqual;
}
/**
... | }
/**
* Gets the value of the currency property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCURRENCY() {
return currency;
}
/**
* Sets the value of the currency property.
*
* @param value
* ... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_stepcom_desadv\de\metas\edi\esb\jaxb\stepcom\desadv\DAMOU1.java | 2 |
请完成以下Java代码 | public void sendMail(Session session) throws MessagingException, IOException {
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("mail@gmail.com"));
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("mail@gmail.com"));
message.setSubject(... | message.setContent(multipart);
Transport.send(message);
}
private File getFile(String filename) {
try {
URI uri = this.getClass()
.getClassLoader()
.getResource(filename)
.toURI();
return new File(uri);
} catch (Exception... | repos\tutorials-master\core-java-modules\core-java-networking-2\src\main\java\com\baeldung\mail\mailwithattachment\MailWithAttachmentService.java | 1 |
请完成以下Java代码 | public void setSerializerList(List<TypedValueSerializer<?>> serializerList) {
this.serializerList.clear();
this.serializerList.addAll(serializerList);
this.serializerMap.clear();
for (TypedValueSerializer<?> serializer : serializerList) {
serializerMap.put(serializer.getName(), serializer);
}
... | if (serializer == null) {
serializer = thisSerializer;
}
copy.addSerializer(serializer);
}
// add all "other" serializers that did not exist before to the end of the list
for (TypedValueSerializer<?> otherSerializer : other.getSerializers()) {
if (!copy.serializerMap.containsKey(... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\variable\serializer\DefaultVariableSerializers.java | 1 |
请完成以下Java代码 | public LicenseKeyDataDto getLicenseKey() {
return licenseKey;
}
public void setLicenseKey(LicenseKeyDataDto licenseKey) {
this.licenseKey = licenseKey;
}
public Set<String> getWebapps() {
return webapps;
}
public void setWebapps(Set<String> webapps) {
this.webapps = webapps;
}
public... | InternalsDto dto = new InternalsDto(
DatabaseDto.fromEngineDto(other.getDatabase()),
ApplicationServerDto.fromEngineDto(other.getApplicationServer()),
licenseKey != null ? LicenseKeyDataDto.fromEngineDto(licenseKey) : null,
JdkDto.fromEngineDto(other.getJdk()));
dto.dataCollectionSt... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\telemetry\InternalsDto.java | 1 |
请完成以下Java代码 | public void setPortMapper(PortMapper portMapper) {
Assert.notNull(portMapper, "portMapper cannot be null");
this.portMapper = portMapper;
}
/**
* Use this {@link RequestMatcher} to narrow which requests are redirected to HTTPS.
*
* The filter already first checks for HTTPS in the uri scheme, so it is not n... | private String createRedirectUri(HttpServletRequest request) {
String url = UrlUtils.buildFullRequestUrl(request);
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(url);
UriComponents components = builder.build();
int port = components.getPort();
if (port > 0) {
Integer httpsPort = this.po... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\transport\HttpsRedirectFilter.java | 1 |
请完成以下Java代码 | public int getM_PriceList_Version_ID()
{
return get_ValueAsInt(COLUMNNAME_M_PriceList_Version_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);
}
@Overri... | {
set_Value (COLUMNNAME_Processed, Processed);
}
@Override
public boolean isProcessed()
{
return get_ValueAsBoolean(COLUMNNAME_Processed);
}
@Override
public void setValidFrom (final java.sql.Timestamp ValidFrom)
{
set_Value (COLUMNNAME_ValidFrom, ValidFrom);
}
@Override
public java.sql.Timestamp g... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_PriceList_Version.java | 1 |
请完成以下Java代码 | final class DefaultTransportGraphQlClientBuilder
extends AbstractGraphQlClientBuilder<DefaultTransportGraphQlClientBuilder> {
private final GraphQlTransport transport;
DefaultTransportGraphQlClientBuilder(GraphQlTransport transport) {
Assert.notNull(transport, "GraphQlTransport is required");
this.transport ... | DefaultTransportGraphQlClient(
GraphQlClient graphQlClient, GraphQlTransport transport,
Consumer<AbstractGraphQlClientBuilder<?>> builderInitializer) {
super(graphQlClient);
Assert.notNull(transport, "GraphQlTransport is required");
Assert.notNull(builderInitializer, "'builderInitializer' is required"... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\client\DefaultTransportGraphQlClientBuilder.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ExternalWorkerJobFailureRequest {
@ApiModelProperty(value = "The id of the external worker that reports the failure. Must match the id of the worker who has most recently locked the job.", required = true)
protected String workerId;
@ApiModelProperty(value = "Error message for the failure", e... | this.errorMessage = errorMessage;
}
public String getErrorDetails() {
return errorDetails;
}
public void setErrorDetails(String errorDetails) {
this.errorDetails = errorDetails;
}
public Integer getRetries() {
return retries;
}
public void setRetries(Integer r... | repos\flowable-engine-main\modules\flowable-external-job-rest\src\main\java\org\flowable\external\job\rest\service\api\acquire\ExternalWorkerJobFailureRequest.java | 2 |
请完成以下Java代码 | public class Customer {
private Person person;
private String city;
private Phone homePhone;
private Phone officePhone;
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
public String getCity() {
return city;
}
public void setCity(String ci... | return homePhone;
}
public void setHomePhone(Phone homePhone) {
this.homePhone = homePhone;
}
public Phone getOfficePhone() {
return officePhone;
}
public void setOfficePhone(Phone officePhone) {
this.officePhone = officePhone;
}
public String toString() {
return ToStringBuilder.reflectionToString(t... | repos\tutorials-master\xml-modules\xml-2\src\main\java\com\baeldung\xml\jibx\Customer.java | 1 |
请完成以下Java代码 | public void setIsTranslated (final boolean IsTranslated)
{
set_Value (COLUMNNAME_IsTranslated, IsTranslated);
}
@Override
public boolean isTranslated()
{
return get_ValueAsBoolean(COLUMNNAME_IsTranslated);
}
@Override
public org.compiere.model.I_M_Allergen getM_Allergen()
{
return get_ValueAsPO(COLUMN... | set_ValueNoCheck (COLUMNNAME_M_Allergen_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_Allergen_ID, M_Allergen_ID);
}
@Override
public int getM_Allergen_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Allergen_ID);
}
@Override
public void setName (final java.lang.String Name)
{
set_Value (COLUMNNAME_Name... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Allergen_Trl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable String getDataDirectory() {
return this.dataDirectory;
}
public void setDataDirectory(@Nullable String dataDirectory) {
this.dataDirectory = dataDirectory;
}
public String[] getQueues() {
return this.queues;
}
public void setQueues(String[] queues) {
this.queues = queues;
}... | this.clusterPassword = clusterPassword;
this.defaultClusterPassword = false;
}
public boolean isDefaultClusterPassword() {
return this.defaultClusterPassword;
}
/**
* Creates the minimal transport parameters for an embedded transport
* configuration.
* @return the transport parameters
* @see... | repos\spring-boot-4.0.1\module\spring-boot-artemis\src\main\java\org\springframework\boot\artemis\autoconfigure\ArtemisProperties.java | 2 |
请完成以下Java代码 | public void setPA_GoalParent_ID (int PA_GoalParent_ID)
{
if (PA_GoalParent_ID < 1)
set_Value (COLUMNNAME_PA_GoalParent_ID, null);
else
set_Value (COLUMNNAME_PA_GoalParent_ID, Integer.valueOf(PA_GoalParent_ID));
}
/** Get Parent Goal.
@return Parent Goal
*/
public int getPA_GoalParent_ID ()
{
I... | public void setRelativeWeight (BigDecimal RelativeWeight)
{
set_Value (COLUMNNAME_RelativeWeight, RelativeWeight);
}
/** Get Relative Weight.
@return Relative weight of this step (0 = ignored)
*/
public BigDecimal getRelativeWeight ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_RelativeWeight);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_Goal.java | 1 |
请完成以下Spring Boot application配置 | server.port=8888
spring.cloud.config.server.git.uri=
spring.cloud.config.server.git.clone-on-start=true
spring.security.user.name=root
spring.security.user.password=s3cr3t
encrypt.keyStore.location=classpath:/config-server.jks
encrypt.keyStor | e.password=my-s70r3-s3cr3t
encrypt.keyStore.alias=config-server-key
encrypt.keyStore.secret=my-k34-s3cr3t | repos\tutorials-master\spring-cloud-modules\spring-cloud-config\spring-cloud-config-server\src\main\resources\application.properties | 2 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable ShowSummary getShowSummary() {
return this.showSummary;
}
public void setShowSummary(@Nullable ShowSummary showSummary) {
this.showSummary = showSummary;
}
public @Nullable ShowSummaryOutput getShowSummaryOutput() {
return this.showSummaryOutput;
}
public void setShowSummaryOutput(@Nulla... | */
SUMMARY,
/**
* Show a verbose summary.
*/
VERBOSE
}
/**
* Enumeration of destinations to which the summary should be output. Values are the
* same as those on {@link UpdateSummaryOutputEnum}. To maximize backwards
* compatibility, the Liquibase enum is not used directly.
*/
public enum Show... | repos\spring-boot-4.0.1\module\spring-boot-liquibase\src\main\java\org\springframework\boot\liquibase\autoconfigure\LiquibaseProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public GroupResponse createGroupResponse(Group group) {
return createGroupResponse(group, createUrlBuilder());
}
public GroupResponse createGroupResponse(Group group, RestUrlBuilder urlBuilder) {
GroupResponse response = new GroupResponse();
response.setId(group.getId());
respon... | }
public PrivilegeResponse createPrivilegeResponse(Privilege privilege, List<User> users, List<Group> groups) {
PrivilegeResponse response = createPrivilegeResponse(privilege);
List<UserResponse> userResponses = new ArrayList<>(users.size());
for (User user : users) {
... | repos\flowable-engine-main\modules\flowable-idm-rest\src\main\java\org\flowable\idm\rest\service\api\IdmRestResponseFactory.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void setVATaxID(String value) {
this.vaTaxID = value;
}
/**
* Gets the value of the referenceNo property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getReferenceNo() {
return referenceNo;
}
/**
... | * @return
* possible object is
* {@link String }
*
*/
public String getSiteName() {
return siteName;
}
/**
* Sets the value of the siteName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
pub... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_metasfreshinhousev1\de\metas\edi\esb\jaxb\metasfreshinhousev1\EDICctop119VType.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class AdColumnId implements RepoIdAware
{
@JsonCreator
public static AdColumnId ofRepoId(final int repoId)
{
return new AdColumnId(repoId);
}
public static AdColumnId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? new AdColumnId(repoId) : null;
}
public static int toRepoId(final AdColumnId ... | this.repoId = Check.assumeGreaterThanZero(repoId, "AD_Column_ID");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public static boolean equals(@Nullable final AdColumnId id1, @Nullable final AdColumnId id2)
{
return Objects.equals(id1, id2);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\column\AdColumnId.java | 2 |
请完成以下Java代码 | default void nack(Duration sleep) {
throw new UnsupportedOperationException("nack(sleep) is not supported by this Acknowledgment");
}
/**
* Acknowledge the record at an index in the batch - commit the offset(s) of records
* in the batch up to and including the index. Requires
* {@link AckMode#MANUAL_IMMEDIAT... | * <p>
* @param index the index of the failed record in the batch.
* @param sleep the duration to sleep; the actual sleep time will be larger of this value
* and the container's {@code pollTimeout}, which defaults to 5 seconds.
* @since 2.8.7
*/
default void nack(int index, Duration sleep) {
throw new Unsup... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\Acknowledgment.java | 1 |
请完成以下Java代码 | public void onCancel()
{
dispose();
};
@Override
public void onOpenAsNewRecord()
{
dispose();
};
};
Find(final FindPanelBuilder builder)
{
super(builder.getParentFrame(),
Services.get(IMsgBL.class).getMsg(Env.getCtx(), "Find") + ": " + builder.getTitle(),
true // modal=true
);
fi... | public void windowOpened(WindowEvent e)
{
findPanel.requestFocus();
}
@Override
public void windowClosing(WindowEvent e)
{
findPanel.doCancel();
}
});
AEnv.showCenterWindow(builder.getParentFrame(), this);
} // Find
@Override
public void dispose()
{
findPanel.dispose();
remo... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\apps\search\Find.java | 1 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public LocalDate getDateCreated() {
return dateCreated;
}
public void setDateCreated(LocalDate dateCreated) {
this.dateCreated = dateCreated;
}
public String getStatus() {
... | this.status = status;
}
public List<OrderProduct> getOrderProducts() {
return orderProducts;
}
public void setOrderProducts(List<OrderProduct> orderProducts) {
this.orderProducts = orderProducts;
}
@Transient
public int getNumberOfProducts() {
return this.orderProd... | repos\tutorials-master\spring-boot-modules\spring-boot-angular\src\main\java\com\baeldung\ecommerce\model\Order.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Message createMessage(Session session) throws JMSException {
return session.createTextMessage(str);
}
});
}
/**
* 订单通知
*
* @param merchantOrderNo
*/
@Override
public void orderSend(String bankOrderNo) {
final String orderNo = bankOrderNo;
jmsTemplate.setDefaultDestinationName(MqConf... | String merchantOrderNo, String notifyType) {
return rpNotifyRecordDao.getNotifyByMerchantNoAndMerchantOrderNoAndNotifyType(merchantNo, merchantOrderNo,
notifyType);
}
@Override
public PageBean<RpNotifyRecord> queryNotifyRecordListPage(PageParam pageParam, Map<String, Object> paramMap) {
return rpNotifyRecor... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\notify\service\impl\RpNotifyServiceImpl.java | 2 |
请完成以下Java代码 | public String getPostLogoutRedirectUri() {
return postLogoutRedirectUri;
}
public void setPostLogoutRedirectUri(String postLogoutRedirectUri) {
this.postLogoutRedirectUri = postLogoutRedirectUri;
}
}
public static class OAuth2IdentityProviderProperties {
/**
* Enable {@link OAuth2... | public String getGroupNameDelimiter() {
return groupNameDelimiter;
}
public void setGroupNameDelimiter(String groupNameDelimiter) {
this.groupNameDelimiter = groupNameDelimiter;
}
}
public OAuth2SSOLogoutProperties getSsoLogout() {
return ssoLogout;
}
public void setSsoLogout(OAut... | repos\camunda-bpm-platform-master\spring-boot-starter\starter-security\src\main\java\org\camunda\bpm\spring\boot\starter\security\oauth2\OAuth2Properties.java | 1 |
请完成以下Java代码 | protected ProcessPreconditionsResolution checkPreconditionsApplicable()
{
final Set<Integer> productIds = getProductIds();
if (productIds.isEmpty())
{
return ProcessPreconditionsResolution.rejectBecauseNoSelection();
}
return ProcessPreconditionsResolution.accept();
}
@Override
protected String doIt(... | return MSG_OK;
}
private Set<Integer> getProductIds()
{
return streamSelectedRows()
.map(MaterialCockpitRow::getProductId)
.map(ProductId::toRepoId)
.filter(productId -> productId > 0)
.distinct()
.limit(2)
.collect(ImmutableSet.toImmutableSet());
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\material\cockpit\process\MD_Cockpit_PricingConditions.java | 1 |
请完成以下Java代码 | public void messageEventReceivedAsync(String messageName, String executionId) {
commandExecutor.execute(new MessageEventReceivedCmd(messageName, executionId, true));
}
@Override
public void addEventListener(FlowableEventListener listenerToAdd) {
commandExecutor.execute(new AddEventListenerC... | }
@Override
public ProcessInstanceBuilder createProcessInstanceBuilder() {
return new ProcessInstanceBuilderImpl(this);
}
public ProcessInstance startProcessInstance(ProcessInstanceBuilderImpl processInstanceBuilder) {
if (processInstanceBuilder.getProcessDefinitionId() != null
... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\RuntimeServiceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class FileStorageService {
private final Path fileStorageLocation;
@Autowired
public FileStorageService(FileStorageProperties fileStorageProperties) {
this.fileStorageLocation = Paths.get(fileStorageProperties.getUploadDir())
.toAbsolutePath().normalize();
try {
... | // Copy file to the target location (Replacing existing file with the same name)
Path targetLocation = this.fileStorageLocation.resolve(fileName);
Files.copy(file.getInputStream(), targetLocation, StandardCopyOption.REPLACE_EXISTING);
return fileName;
} catch (IOException ex... | repos\Spring-Boot-Advanced-Projects-main\springboot-upload-download-file-rest-api-example\src\main\java\net\alanbinu\springboot\fileuploaddownload\service\FileStorageService.java | 2 |
请完成以下Java代码 | default String getSubject() {
return this.getClaimAsString(LogoutTokenClaimNames.SUB);
}
/**
* Returns the Audience(s) {@code (aud)} that this ID Token is intended for.
* @return the Audience(s) that this ID Token is intended for
*/
default List<String> getAudience() {
return this.getClaimAsStringList(Log... | }
/**
* Returns a {@code String} value {@code (sid)} representing the OIDC Provider session
* @return the value representing the OIDC Provider session
*/
default String getSessionId() {
return getClaimAsString(LogoutTokenClaimNames.SID);
}
/**
* Returns the JWT ID {@code (jti)} claim which provides a un... | repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\oidc\authentication\logout\LogoutTokenClaimAccessor.java | 1 |
请完成以下Java代码 | public Rate3 getRate() {
return rate;
}
/**
* Sets the value of the rate property.
*
* @param value
* allowed object is
* {@link Rate3 }
*
*/
public void setRate(Rate3 value) {
this.rate = value;
}
/**
* Gets the value of the fr... | return rsn;
}
/**
* Sets the value of the rsn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRsn(String value) {
this.rsn = value;
}
/**
* Gets the value of the tax property.
*
* @return
... | 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\InterestRecord1.java | 1 |
请完成以下Java代码 | public void assertBasePricingIsValid(final I_M_PriceList priceList)
{
final IPriceListDAO priceListsRepo = Services.get(IPriceListDAO.class);
// final PriceListVersionId basePriceListVersionId = priceListsRepo.getBasePriceListVersionIdForPricingCalculationOrNull(plv);
// if (basePriceListVersionId != null)
//... | final CountryId baseCountryId = CountryId.ofRepoIdOrNull(basePriceList.getC_Country_ID());
final CountryId countryId = CountryId.ofRepoIdOrNull(priceList.getC_Country_ID());
if (!CountryId.equals(baseCountryId, countryId))
{
throw new AdempiereException("@PriceListAndBasePriceListCountryMismatchError@")
.... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\interceptor\M_PriceList.java | 1 |
请完成以下Java代码 | public BankTransactionCodeStructure5 getDomn() {
return domn;
}
/**
* Sets the value of the domn property.
*
* @param value
* allowed object is
* {@link BankTransactionCodeStructure5 }
*
*/
public void setDomn(BankTransactionCodeStructure5 value) {
... | *
*/
public ProprietaryBankTransactionCodeStructure1 getPrtry() {
return prtry;
}
/**
* Sets the value of the prtry property.
*
* @param value
* allowed object is
* {@link ProprietaryBankTransactionCodeStructure1 }
*
*/
public void setP... | 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\BankTransactionCodeStructure4.java | 1 |
请完成以下Java代码 | public class ProductHelperWithEventListener {
final Logger LOGGER = LoggerFactory.getLogger(ProductHelperWithEventListener.class);
private Cache<String, Integer> cachedDiscounts;
private int cacheMissCount = 0;
public ProductHelperWithEventListener() {
cachedDiscounts = Cache2kBuilder.of(Str... | LOGGER.info("Entry created: [{}, {}].", entry.getKey(), entry.getValue());
}
})
.build();
}
public Integer getDiscount(String productType) {
return cachedDiscounts.get(productType);
}
public int getCacheMissCount() {
return cacheMissCount;
}
... | repos\tutorials-master\libraries-data-3\src\main\java\com\baeldung\cache2k\ProductHelperWithEventListener.java | 1 |
请完成以下Java代码 | public LookupValue getToByUserId(final Integer adUserId)
{
return emailToLookup.findById(adUserId);
}
@ToString
private static final class WebuiEmailEntry
{
private WebuiEmail email;
public WebuiEmailEntry(@NonNull final WebuiEmail email)
{
this.email = email;
}
public synchronized WebuiEmail get... | throw new NullPointerException("email");
}
email = emailNew;
return WebuiEmailChangeResult.builder().email(emailNew).originalEmail(emailOld).build();
}
}
@Value
@AllArgsConstructor
public static class WebuiEmailRemovedEvent
{
@NonNull WebuiEmail email;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\mail\WebuiMailRepository.java | 1 |
请完成以下Java代码 | public boolean isPossibleHighVolume(final int highVolumeThreshold)
{
final Integer estimatedSize = estimateSize();
return estimatedSize == null || estimatedSize > highVolumeThreshold;
}
@Nullable
private Integer estimateSize()
{
return getFixedHUIds().map(HuIdsFilterList::estimateSize).orElse(null);
}
in... | mustHUIds.stream())
.distinct()
.filter(huId -> !shallNotHUIds.contains(huId)) // not excluded
.collect(ImmutableSet.toImmutableSet());
if (fixedHUIds.isEmpty())
{
return converter.acceptNone();
}
else
{
return converter.acceptOnly(HuIdsFilterList.of(fixedHUIds), Immutab... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\filter\HUIdsFilterData.java | 1 |
请完成以下Java代码 | public ValueNamePair getSelectedLook()
{
return lookList.getSelectedValue();
}
/**
* Get theme selected by user
* @return selected theme
*/
public ValueNamePair getSelectedTheme()
{
return themeList.getSelectedValue();
}
/** Sets the action listener for "Edit UI defaults" button */
public PLAFEdit... | private boolean capture = true;
private LookAndFeel laf = null;
private MetalTheme theme = null;
private BufferedImage image;
@Override
public void paint(Graphics g)
{
if (capture) {
//capture preview image
image = (BufferedImage)createImage(this.getWidth(),this.getHeight());
super.paint(image.create... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\plaf\PLAFEditorPanel.java | 1 |
请完成以下Java代码 | private @Nullable O createOperation(EndpointId endpointId, Object target, Method method) {
return OPERATION_TYPES.entrySet()
.stream()
.map((entry) -> createOperation(endpointId, target, method, entry.getKey(), entry.getValue()))
.filter(Objects::nonNull)
.findFirst()
.orElse(null);
}
private @Nulla... | private OperationInvoker applyAdvisors(EndpointId endpointId, OperationMethod operationMethod,
OperationInvoker invoker) {
if (this.invokerAdvisors != null) {
for (OperationInvokerAdvisor advisor : this.invokerAdvisors) {
invoker = advisor.apply(endpointId, operationMethod.getOperationType(), operationMetho... | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\endpoint\annotation\DiscoveredOperationsFactory.java | 1 |
请完成以下Java代码 | public void beforeSave(final I_PP_Order_Weighting_Run record)
{
if (InterfaceWrapperHelper.isUIAction(record))
{
final boolean isUOMChanged = InterfaceWrapperHelper.isValueChanged(record, I_PP_Order_Weighting_Run.COLUMNNAME_C_UOM_ID);
if (InterfaceWrapperHelper.isValueChanged(record, I_PP_Order_Weighting_Run... | weightingRun.updateTargetWeightRange();
}
);
}
}
}
@ModelChange(timings = { ModelValidator.TYPE_BEFORE_DELETE })
public void beforeDelete(final I_PP_Order_Weighting_Run record)
{
final PPOrderWeightingRunId weightingRunId = PPOrderWeightingRunId.ofRepoId(record.getPP_Order_Weighting_Run_ID());
p... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\de\metas\manufacturing\order\weighting\run\interceptor\PP_Order_Weighting_Run.java | 1 |
请完成以下Java代码 | public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public List<String> getImageUrls() {
return imageUrls;
}
public void setImageUrls(List<String> imageUrls) {
this.imageUrls = imageUrls;
}
public List<... | public Integer getStock() {
return stock;
}
public void setStock(Integer stock) {
this.stock = stock;
}
public Float getAverageRating() {
return averageRating;
}
public void setAverageRating(Float averageRating) {
this.averageRating = averageRating;
}
} | repos\tutorials-master\spring-boot-modules\spring-boot-graphql-2\src\main\java\com\baeldung\graphqlvsrest\entity\Product.java | 1 |
请完成以下Java代码 | private static QuickInputDescriptorKey createQuickInputDescriptorKey(final DocumentEntityDescriptor includedDocumentDescriptor)
{
return QuickInputDescriptorKey.builder()
.documentType(includedDocumentDescriptor.getDocumentType()) // i.e. Window
.documentTypeId(includedDocumentDescriptor.getDocumentTypeId())... | return null;
}
private IQuickInputDescriptorFactory getQuickInputDescriptorFactory(final IQuickInputDescriptorFactory.MatchingKey matchingKey)
{
final ImmutableList<IQuickInputDescriptorFactory> matchingFactories = factories.get(matchingKey);
if (matchingFactories.isEmpty())
{
return null;
}
if (match... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\quickinput\QuickInputDescriptorFactoryService.java | 1 |
请完成以下Java代码 | protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO(Properties ctx)
{
POInfo poi = POInfo.getPOInfo(ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer("X_M_PackagingTreeItemSched[")
... | * Get Packaging Tree Item.
*
* @return Packaging Tree Item
*/
public int getM_PackagingTreeItem_ID()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_PackagingTreeItem_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public I_M_ShipmentSchedule getM_ShipmentSchedule() throws RuntimeE... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\org\compiere\model\X_M_PackagingTreeItemSched.java | 1 |
请完成以下Java代码 | public BigDecimal getQtyOverride()
{
return InterfaceWrapperHelper.getValueOrNull(shipmentSchedule, I_M_ShipmentSchedule.COLUMNNAME_QtyToDeliver_Override);
}
public BigDecimal getInitialSchedQtyDelivered()
{
return initialSchedQtyDelivered;
}
public void setShipmentScheduleLineNetAmt(final BigDecimal lineNe... | @Nullable
public InputDataSourceId getSalesOrderADInputDatasourceID()
{
if(!salesOrder.isPresent())
{
return null;
}
final I_C_Order orderRecord = salesOrder.get();
return InputDataSourceId.ofRepoIdOrNull(orderRecord.getAD_InputDataSource_ID());
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\api\OlAndSched.java | 1 |
请完成以下Java代码 | public Integer getMode() {
return mode;
}
public ClusterServerModifyRequest setMode(Integer mode) {
this.mode = mode;
return this;
}
public ServerFlowConfig getFlowConfig() {
return flowConfig;
}
public ClusterServerModifyRequest setFlowConfig(
ServerFl... | this.namespaceSet = namespaceSet;
return this;
}
@Override
public String toString() {
return "ClusterServerModifyRequest{" +
"app='" + app + '\'' +
", ip='" + ip + '\'' +
", port=" + port +
", mode=" + mode +
", flowConfig=" + flow... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\domain\cluster\request\ClusterServerModifyRequest.java | 1 |
请完成以下Java代码 | public void setCustomer(String customer) {
this.customer = customer;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getValidUntil() {
return validUntil;
}
public void setValidUntil(String validUntil) {
this.validUnt... | return features;
}
public void setFeatures(Map<String, String> features) {
this.features = features;
}
public String getRaw() {
return raw;
}
public void setRaw(String raw) {
this.raw = raw;
}
public static LicenseKeyDataDto fromEngineDto(LicenseKeyData other) {
return new LicenseKey... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\telemetry\LicenseKeyDataDto.java | 1 |
请完成以下Java代码 | public boolean supportsCustomEditor()
{
return true;
} // supportsCustomEditor
/**
* Register a listener for the PropertyChange event. When a
* PropertyEditor changes its value it should fire a PropertyChange
* event on all registered PropertyChangeListeners, specifying the
* null value for the property... | public void addPropertyChangeListener(PropertyChangeListener listener)
{
super.addPropertyChangeListener(listener);
} // addPropertyChangeListener
/**
* Remove a listener for the PropertyChange event.
*
* @param listener The PropertyChange listener to be removed.
*/
@Override
public void removePropert... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\swing\ColorEditor.java | 1 |
请完成以下Java代码 | public GroupTemplateId getGroupTemplateId(@NonNull final GroupId groupId)
{
return queryBL
.createQueryBuilder(I_C_Order_CompensationGroup.class)
.addEqualsFilter(I_C_Order_CompensationGroup.COLUMNNAME_C_Order_CompensationGroup_ID, groupId.getOrderCompensationGroupId())
.andCollect(I_C_Order_Compensation... | final I_C_OrderLine orderLine = orderLineBL.createOrderLine(targetOrder);
final ProductId productId = from.getProductId();
orderLine.setM_Product_ID(productId.getRepoId());
orderLine.setM_AttributeSetInstance_ID(AttributeSetInstanceId.NONE.getRepoId());
orderLine.setC_UOM_ID(from.getQty().getUomId().getRepoId()... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\compensationGroup\OrderGroupRepository.java | 1 |
请完成以下Java代码 | public PaymentRule getPaymentRule(final JsonOLCandCreateRequest request)
{
final JSONPaymentRule jsonPaymentRule = request.getPaymentRule();
if (jsonPaymentRule == null)
{
return null;
}
if (JSONPaymentRule.Paypal.equals(jsonPaymentRule))
{
return PaymentRule.PayPal;
}
if (JSONPaymentRule.OnCr... | }
final IdentifierString paymentTerm = IdentifierString.of(paymentTermCode);
final PaymentTermQueryBuilder queryBuilder = PaymentTermQuery.builder();
queryBuilder.orgId(orgId);
switch (paymentTerm.getType())
{
case EXTERNAL_ID:
queryBuilder.externalId(paymentTerm.asExternalId());
break;
ca... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v1\ordercandidates\impl\MasterdataProvider.java | 1 |
请完成以下Java代码 | public boolean reActivateIt()
{
log.info(toString());
// Before reActivate
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE);
if (m_processMsg != null)
return false;
// After reActivate
m_processMsg = ModelValidationEngine.get().fireDocValidate(thi... | * @return clear text error message
*/
@Override
public String getProcessMsg()
{
return m_processMsg;
} // getProcessMsg
/**
* Get Document Owner (Responsible)
* @return AD_User_ID
*/
@Override
public int getDoc_User_ID()
{
return getUpdatedBy();
} // getDoc_User_ID
/**
* Get Document Currenc... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MInOutConfirm.java | 1 |
请完成以下Java代码 | public int getDPD_StoreOrder_Log_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_DPD_StoreOrder_Log_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Duration (ms).
@param DurationMillis Duration (ms) */
@Override
public void setDurationMillis (int DurationMillis)
{
set_Value (CO... | return "Y".equals(oo);
}
return false;
}
/** Set Request Message.
@param RequestMessage Request Message */
@Override
public void setRequestMessage (java.lang.String RequestMessage)
{
set_Value (COLUMNNAME_RequestMessage, RequestMessage);
}
/** Get Request Message.
@return Request Message */
@Ove... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dpd\src\main\java-gen\de\metas\shipper\gateway\dpd\model\X_DPD_StoreOrder_Log.java | 1 |
请完成以下Java代码 | protected String getBusinessKey(ActivityExecution execution) {
return getCallableElement().getBusinessKey(execution);
}
protected VariableMap getInputVariables(ActivityExecution callingExecution) {
return getCallableElement().getInputVariables(callingExecution);
}
protected VariableMap getOutputVariab... | protected CallableElementBinding getBinding() {
return getCallableElement().getBinding();
}
protected boolean isLatestBinding() {
return getCallableElement().isLatestBinding();
}
protected boolean isDeploymentBinding() {
return getCallableElement().isDeploymentBinding();
}
protected boolean i... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\behavior\CallableElementActivityBehavior.java | 1 |
请完成以下Java代码 | public void setIsTradeDiscountPosted (final boolean IsTradeDiscountPosted)
{
set_Value (COLUMNNAME_IsTradeDiscountPosted, IsTradeDiscountPosted);
}
@Override
public boolean isTradeDiscountPosted()
{
return get_ValueAsBoolean(COLUMNNAME_IsTradeDiscountPosted);
}
@Override
public org.compiere.model.I_M_Cos... | @Override
public boolean isProcessing()
{
return get_ValueAsBoolean(COLUMNNAME_Processing);
}
@Override
public void setSeparator (final java.lang.String Separator)
{
set_Value (COLUMNNAME_Separator, Separator);
}
@Override
public java.lang.String getSeparator()
{
return get_ValueAsString(COLUMNNAME_... | 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 void setProcessInstanceName(String processInstanceId, String name) {
commandExecutor.execute(new SetProcessInstanceNameCmd(processInstanceId, name));
}
@Override
public List<Event> getProcessInstanceEvents(String processInstanceId) {
return commandExecutor.execute(new GetProcessInsta... | @Override
public ProcessInstance startCreatedProcessInstance(
ProcessInstance createdProcessInstance,
Map<String, Object> variables
) {
return commandExecutor.execute(new StartCreatedProcessInstanceCmd<>(createdProcessInstance, variables));
}
public ProcessInstance startProcessI... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\RuntimeServiceImpl.java | 1 |
请完成以下Java代码 | private PackageLabels createPackageLabels(final Label.Sendung goPackageLabels)
{
final Label.Sendung.PDFs pdfs = goPackageLabels.getPDFs();
return PackageLabels.builder()
.orderId(GOUtils.createOrderId(goPackageLabels.getSendungsnummerAX4()))
.defaultLabelType(GOPackageLabelType.DIN_A6_ROUTER_LABEL)
... | .labelData(pdfs.getRouterlabelZebra())
.build())
.build();
}
@Override
public @NonNull JsonDeliveryAdvisorResponse adviseShipment(final @NonNull JsonDeliveryAdvisorRequest request)
{
return JsonDeliveryAdvisorResponse.builder()
.requestId(request.getId())
.shipperProduct(JsonShipperProduct.buil... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.go\src\main\java\de\metas\shipper\gateway\go\GOClient.java | 1 |
请完成以下Java代码 | public class CurrentUserToken extends DefaultOidcUser {
@Serial
private static final long serialVersionUID = 332175240400944267L;
private final Collection<GrantedAuthority> authorities;
private final UUID userId;
private final String username;
private final String email;
public CurrentUser... | return new UserToken(getUsername(), getIdToken().getTokenValue(), getGrantedAuthorities());
}
public record UserToken(String username, String token, Collection<String> roles) {
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o =... | repos\spring-boot-web-application-sample-master\main-app\main-webapp\src\main\java\gt\app\config\security\CurrentUserToken.java | 1 |
请完成以下Java代码 | private PurchaseRow getToplevelRowById(@NonNull final PurchaseRowId topLevelRowId)
{
final PurchaseRow topLevelRow = topLevelRowsById.get(topLevelRowId);
if (topLevelRow != null)
{
return topLevelRow;
}
throw new EntityNotFoundException("topLevelRow not found")
.appendParametersToMessage()
.setPa... | }
final PurchaseRow newGroupRow = groupRow.copy();
if (idOfRowToPatch.isGroupRowId())
{
final PurchaseRowId includedRowId = null;
editor.edit(newGroupRow, includedRowId, request);
}
else
{
final PurchaseRowId includedRowId = idOfRowToPatch;
editor.edit(newGroupRow, includedRowId, requ... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\sales\purchasePlanning\view\PurchaseRowsCollection.java | 1 |
请完成以下Java代码 | public static void addToEnvironment(ConfigurableEnvironment environment) {
addToEnvironment(environment, logger);
}
/**
* Add a {@link RandomValuePropertySource} to the given {@link Environment}.
* @param environment the environment to add the random property source to
* @param logger logger used for debug a... | }
T getMin() {
return this.min;
}
T getMax() {
return this.max;
}
@Override
public String toString() {
return this.value;
}
static <T extends Number & Comparable<T>> Range<T> of(String value, Function<String, T> parse) {
T zero = parse.apply("0");
String[] tokens = StringUtils.commaDe... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\env\RandomValuePropertySource.java | 1 |
请完成以下Java代码 | public class DefaultIdentityLinkInterceptor implements IdentityLinkInterceptor {
@Override
public void handleCompleteTask(TaskEntity task) {
if (Authentication.getAuthenticatedUserId() != null && task.getProcessInstanceId() != null) {
ExecutionEntity processInstanceEntity = CommandContextUt... | String authenticatedUserId = Authentication.getAuthenticatedUserId();
if (authenticatedUserId != null) {
IdentityLinkUtil.createProcessInstanceIdentityLink(subProcessInstanceExecution, authenticatedUserId, null, IdentityLinkType.STARTER);
}
}
protected void addUserIdentityLinkTo... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\interceptor\DefaultIdentityLinkInterceptor.java | 1 |
请完成以下Java代码 | public ReactorClientHttpConnectorBuilder withCustomizers(
Collection<Consumer<ReactorClientHttpConnector>> customizers) {
return new ReactorClientHttpConnectorBuilder(mergedCustomizers(customizers), this.httpClientBuilder);
}
/**
* Return a new {@link ReactorClientHttpConnectorBuilder} that uses the given
*... | return new ReactorClientHttpConnectorBuilder(getCustomizers(),
this.httpClientBuilder.withHttpClientCustomizer(httpClientCustomizer));
}
/**
* Return a new {@link ReactorClientHttpConnectorBuilder} that applies the given
* customizer. This can be useful for applying pre-packaged customizations.
* @param cu... | repos\spring-boot-4.0.1\module\spring-boot-http-client\src\main\java\org\springframework\boot\http\client\reactive\ReactorClientHttpConnectorBuilder.java | 1 |
请完成以下Java代码 | public B type(String type) {
return header(JoseHeaderNames.TYP, type);
}
/**
* Sets the content type header that declares the media type of the secured
* content (the payload).
* @param contentType the content type header
* @return the {@link AbstractBuilder}
*/
public B contentType(String cont... | /**
* A {@code Consumer} to be provided access to the headers allowing the ability to
* add, replace, or remove.
* @param headersConsumer a {@code Consumer} of the headers
* @return the {@link AbstractBuilder}
*/
public B headers(Consumer<Map<String, Object>> headersConsumer) {
headersConsumer.accep... | repos\spring-security-main\oauth2\oauth2-jose\src\main\java\org\springframework\security\oauth2\jwt\JoseHeader.java | 1 |
请完成以下Java代码 | public String getResource() {
return rule.getResource();
}
@JsonIgnore
@JSONField(serialize = false)
public int getGrade() {
return rule.getGrade();
}
@JsonIgnore
@JSONField(serialize = false)
public Integer getParamIdx() {
return rule.getParamIdx();
}
... | @JSONField(serialize = false)
public int getBurstCount() {
return rule.getBurstCount();
}
@JsonIgnore
@JSONField(serialize = false)
public long getDurationInSec() {
return rule.getDurationInSec();
}
@JsonIgnore
@JSONField(serialize = false)
public boolean isClusterM... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\datasource\entity\rule\ParamFlowRuleEntity.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MyChannelInterceptor implements ChannelInterceptor {
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
System.out.println("----------------------------preSend------------------------------");
return message;
}
@Override
public void post... | }
@Override
public boolean preReceive(MessageChannel channel) {
return true;
}
@Override
public Message<?> postReceive(Message<?> message, MessageChannel channel) {
System.out.println("----------------------------postReceive------------------------------");
return message;
... | repos\springboot-demo-master\sftp\src\main\java\com\et\sftp\Interceptor\MyChannelInterceptor.java | 2 |
请完成以下Java代码 | public void setAdditionalInfoField(String field, JsonNode value) {
JsonNode additionalInfo = getAdditionalInfo();
if (!(additionalInfo instanceof ObjectNode)) {
additionalInfo = mapper.createObjectNode();
}
((ObjectNode) additionalInfo).set(field, value);
setAdditiona... | return mapper.readTree(new ByteArrayInputStream(data));
} catch (IOException e) {
log.warn("Can't deserialize json data: ", e);
return null;
}
} else {
return null;
}
}
}
public static void s... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\BaseDataWithAdditionalInfo.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Config {
@Bean(initMethod = "init", destroyMethod = "close")
public AtomikosDataSourceBean inventoryDataSource() {
AtomikosDataSourceBean dataSource = new AtomikosDataSourceBean();
dataSource.setLocalTransactionMode(true);
dataSource.setUniqueResourceName("db1");
da... | return userTransactionManager;
}
@Bean
public JtaTransactionManager jtaTransactionManager() throws SystemException {
JtaTransactionManager jtaTransactionManager = new JtaTransactionManager();
jtaTransactionManager.setTransactionManager(userTransactionManager());
jtaTransactionManage... | repos\tutorials-master\persistence-modules\atomikos\src\main\java\com\baeldung\atomikos\spring\config\Config.java | 2 |
请完成以下Java代码 | public class VariableListenerInvocationListener implements VariableInstanceLifecycleListener<VariableInstanceEntity> {
protected final AbstractVariableScope targetScope;
public VariableListenerInvocationListener(AbstractVariableScope targetScope) {
this.targetScope = targetScope;
}
@Override
public voi... | } else if(sourceScope.getParentVariableScope() instanceof ExecutionEntity) {
addEventToScopeExecution((ExecutionEntity)sourceScope.getParentVariableScope(), event);
}
else {
throw new ProcessEngineException("BPMN execution scope expected");
}
}
protected void addEventToScopeExecution(Execut... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\core\variable\scope\VariableListenerInvocationListener.java | 1 |
请完成以下Java代码 | private static ITranslatableString toTrl(@Nullable final String reasonStr)
{
if (reasonStr == null || Check.isBlank(reasonStr))
{
return TranslatableStrings.empty();
}
else
{
return TranslatableStrings.anyLanguage(reasonStr.trim());
}
}
public static final BooleanWithReason TRUE = new BooleanWithR... | public boolean isTrue()
{
return value;
}
public boolean isFalse()
{
return !value;
}
public String getReasonAsString()
{
return reason.getDefaultValue();
}
public void assertTrue()
{
if (isFalse())
{
throw new AdempiereException(reason);
}
}
public BooleanWithReason and(@NonNull final Su... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\BooleanWithReason.java | 1 |
请完成以下Java代码 | public CardAggregated1 getAggtd() {
return aggtd;
}
/**
* Sets the value of the aggtd property.
*
* @param value
* allowed object is
* {@link CardAggregated1 }
*
*/
public void setAggtd(CardAggregated1 value) {
this.aggtd = value;
}
... | public CardIndividualTransaction1 getIndv() {
return indv;
}
/**
* Sets the value of the indv property.
*
* @param value
* allowed object is
* {@link CardIndividualTransaction1 }
*
*/
public void setIndv(CardIndividualTransaction1 value) {
th... | 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\CardTransaction1Choice.java | 1 |
请完成以下Java代码 | protected String getDeploymentMode() {
return DEPLOYMENT_MODE;
}
@Override
public void deployResources(String deploymentNameHint, Resource[] resources, RepositoryService repositoryService) {
DeploymentBuilder deploymentBuilder = repositoryService
.createDeployment()
... | LOGGER.error(
"The following resource wasn't included in the deployment since it is invalid:\n{}",
resourceName
);
}
}
deploymentBuilder = loadApplicationUpgradeContext(deploymentBuilder);
if (validProcessCount != 0) {
... | repos\Activiti-develop\activiti-core\activiti-spring\src\main\java\org\activiti\spring\autodeployment\FailOnNoProcessAutoDeploymentStrategy.java | 1 |
请完成以下Java代码 | public static boolean removeDelegateAppender(ch.qos.logback.classic.Logger logger) {
return removeAppender(logger, DELEGATE_APPENDER_NAME);
}
/**
* Converts an SLF4J {@link Logger} to a Logback {@link ch.qos.logback.classic.Logger}.
*
* @param logger SLF4J {@link Logger} to convert.
* @return an {@link Opt... | private static String nullSafeTypeName(Class<?> type) {
return type != null ? type.getName() : null;
}
private static String nullSafeTypeName(Object obj) {
return nullSafeTypeName(nullSafeType(obj));
}
private static String nullSafeTypeSimpleName(Class<?> type) {
return type != null ? type.getSimpleName() :... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-starters\spring-geode-starter-logging\src\main\java\org\springframework\geode\logging\slf4j\logback\support\LogbackSupport.java | 1 |
请完成以下Java代码 | public void setC_BPartner_Alberta_ID (final int C_BPartner_Alberta_ID)
{
if (C_BPartner_Alberta_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_BPartner_Alberta_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_BPartner_Alberta_ID, C_BPartner_Alberta_ID);
}
@Override
public int getC_BPartner_Alberta_ID()
{
ret... | return get_ValueAsBoolean(COLUMNNAME_IsArchived);
}
@Override
public void setTimestamp (final @Nullable java.sql.Timestamp Timestamp)
{
set_Value (COLUMNNAME_Timestamp, Timestamp);
}
@Override
public java.sql.Timestamp getTimestamp()
{
return get_ValueAsTimestamp(COLUMNNAME_Timestamp);
}
@Override
pu... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.healthcare.alberta\src\main\java-gen\de\metas\vertical\healthcare\alberta\model\X_C_BPartner_Alberta.java | 1 |
请完成以下Java代码 | public final class TableColumnResource implements Resource
{
/** Any table column */
public static final TableColumnResource ANY = new TableColumnResource();
public static final TableColumnResource of(final int adTableId, final int adColumnId)
{
return new TableColumnResource(adTableId, adColumnId);
}
private... | {
if (this == obj)
{
return true;
}
final TableColumnResource other = EqualsBuilder.getOther(this, obj);
if (other == null)
{
return false;
}
return new EqualsBuilder()
.append(AD_Table_ID, other.AD_Table_ID)
.append(AD_Column_ID, other.AD_Column_ID)
.isEqual();
}
public int getAD... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\permissions\TableColumnResource.java | 1 |
请完成以下Java代码 | public String decrypt(String value) {
if (StringUtils.isEmpty(value)) {
return "";
}
try {
byte[] encryptData = Hex.hexStringToBytes(value);
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, secretKeySpe... | private static SecretKeySpec getSecretKey(final String password) throws NoSuchAlgorithmException {
//返回生成指定算法密钥生成器的 KeyGenerator 对象
KeyGenerator kg = KeyGenerator.getInstance(KEY_ALGORITHM);
//AES 要求密钥长度为 128
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
random.setS... | repos\spring-boot-quick-master\mybatis-crypt-plugin\src\main\java\com\quick\db\crypt\encrypt\AesDesDefaultEncrypt.java | 1 |
请完成以下Java代码 | public class AD_Role_RevokePermission extends JavaProcess
{
private int p_AD_Role_PermRequest_ID = -1;
@Override
protected void prepare()
{
if (getTable_ID() == MRolePermRequest.Table_ID)
{
p_AD_Role_PermRequest_ID = getRecord_ID();
}
}
@Override
protected String doIt() throws Exception
{
if (p_AD_... | //
final MRolePermRequest req = new MRolePermRequest(getCtx(), p_AD_Role_PermRequest_ID, get_TrxName());
RolePermRevokeAccess.revokeAccess(req);
req.saveEx();
//
return "Ok";
}
@Override
protected void postProcess(boolean success)
{
if (success)
{
Services.get(IUserRolePermissionsDAO.class).res... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\org\adempiere\process\AD_Role_RevokePermission.java | 1 |
请完成以下Java代码 | public void onAttributeValueChanged(final IAttributeValueContext attributeValueContext, final IAttributeStorage storage, final IAttributeValue attributeValue, final Object valueOld)
{
for (final IAttributeStorageListener listener : listeners)
{
listener.onAttributeValueChanged(attributeValueContext, storage, at... | final ArrayList<IAttributeStorageListener> listenersToIterate = new ArrayList<>(listeners);
for (final IAttributeStorageListener listener : listenersToIterate)
{
listener.onAttributeStorageDisposed(storage);
}
}
@Override
public String toString()
{
return "CompositeAttributeStorageListener [listeners="... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\storage\impl\CompositeAttributeStorageListener.java | 1 |
请完成以下Java代码 | public static <T> CommonPage<T> restPage(Page<T> pageInfo) {
CommonPage<T> result = new CommonPage<T>();
result.setTotalPage(pageInfo.getTotalPages());
result.setPageNum(pageInfo.getNumber());
result.setPageSize(pageInfo.getSize());
result.setTotal(pageInfo.getTotalElements());
... | public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
} | repos\mall-master\mall-common\src\main\java\com\macro\mall\common\api\CommonPage.java | 1 |
请完成以下Java代码 | private String convert (long number)
{
/* special case */
if (number == 0)
{
return "Kosong";
}
String prefix = "";
if (number < 0)
{
number = -number;
prefix = "Negatif ";
}
String soFar = "";
int place = 0;
do
{
long n = number % 1000;
if (n != 0)
{
String s = convertLes... | long dollars = Long.parseLong(amount.substring (0, newpos));
sb.append (convert (dollars));
for (int i = 0; i < oldamt.length (); i++)
{
if (pos == i) // we are done
{
String cents = oldamt.substring (i + 1);
long sen = Long.parseLong(cents); //red1 convert cents to words
sb.append(" dan SEN");
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\AmtInWords_MS.java | 1 |
请完成以下Java代码 | private Map<String, String> prepareParameterList(final @NonNull GeoCoordinatesRequest request)
{
final String defaultEmptyValue = "";
final Map<String, String> m = new HashMap<>();
m.put("numberAndStreet", CoalesceUtil.coalesce(request.getAddress(), defaultEmptyValue));
m.put("postalcode", CoalesceUtil.coales... | .build();
}
private void sleepMillis(final long timeToSleep)
{
if (timeToSleep <= 0)
{
return;
}
try
{
logger.trace("Sleeping {}ms (rate limit)", timeToSleep);
TimeUnit.MILLISECONDS.sleep(timeToSleep);
}
catch (final InterruptedException e)
{
// nothing to do here
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\location\geocoding\provider\openstreetmap\NominatimOSMGeocodingProviderImpl.java | 1 |
请完成以下Java代码 | public void processRow(ResultSet resultSet) throws SQLException {
while (resultSet.next()) {
String name = resultSet.getString("Name");
// process it
}
}
});
}
void startBookBatchUpdateRollBack(int size) {
jdb... | // batch insert
bookRepository.batchInsert(books);
List<Book> bookFromDatabase = bookRepository.findAll();
// count
log.info("Total books: {}", bookFromDatabase.size());
// random
log.info("{}", bookRepository.findById(2L).orElseThrow(IllegalArgumentException::new));
... | repos\spring-boot-master\spring-jdbc\src\main\java\com\mkyong\StartApplication.java | 1 |
请完成以下Java代码 | public class FileSearchCost {
private final static String FILE_NAME = "src/main/resources/Test";
@Setup(Level.Trial)
public void setup() throws IOException {
for (int i = 0; i < 1500; i++) {
File targetFile = new File(FILE_NAME + i);
FileUtils.writeStringToFile(targetFile, "Test", "UTF8");
}
}
@TearDo... | @Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public static void textFileSearchSequential() throws IOException {
Files.walk(Paths.get("src/main/resources/")).map(Path::normalize).filter(Files::isRegularFile)
.filter(path -> path.getFileName().toString().endsWith(".txt")).col... | repos\tutorials-master\core-java-modules\core-java-streams-7\src\main\java\com\baeldung\streams\parallel\FileSearchCost.java | 1 |
请完成以下Java代码 | public class Book {
private Long id;
private String name;
private String author;
private Date date;
@XmlAttribute
public void setId(Long id) {
this.id = id;
}
@XmlElement(name = "title")
public void setName(String name) {
this.name = name;
}
@XmlTransient
... | this.date = date;
}
public Long getId() {
return id;
}
public String getAuthor() {
return author;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
@Override
public boolean equals(Object obj) {
return Equ... | repos\tutorials-master\xml-modules\jaxb\src\main\java\com\baeldung\jaxb\Book.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.