instruction
string | input
string | output
string | source_file
string | priority
int64 |
|---|---|---|---|---|
请完成以下Java代码
|
public String getActionName()
{
return ACTION_Name;
}
public List<SwingRelatedProcessDescriptor> fetchProcesses(final Properties ctx, final GridTab gridTab)
{
if (gridTab == null)
{
return ImmutableList.of();
}
final IUserRolePermissions role = Env.getUserRolePermissions(ctx);
Check.assumeNotNull(role, "No role found for {}", ctx);
final IProcessPreconditionsContext preconditionsContext = gridTab.toPreconditionsContext();
final AdTableId adTableId = AdTableId.ofRepoId(gridTab.getAD_Table_ID());
final AdWindowId adWindowId = preconditionsContext.getAdWindowId();
final AdTabId adTabId = preconditionsContext.getAdTabId();
return SpringContextHolder.instance.getBean(ADProcessService.class).getRelatedProcessDescriptors(adTableId, adWindowId, adTabId)
.stream()
.filter(relatedProcess -> isExecutionGrantedOrLog(relatedProcess, role))
.map(relatedProcess -> createSwingRelatedProcess(relatedProcess, preconditionsContext))
.filter(this::isEnabledOrLog)
.collect(GuavaCollectors.toImmutableList());
}
private SwingRelatedProcessDescriptor createSwingRelatedProcess(final RelatedProcessDescriptor relatedProcess, final IProcessPreconditionsContext preconditionsContext)
{
final Supplier<ProcessPreconditionsResolution> preconditionsResolutionSupplier = () -> checkPreconditionApplicable(relatedProcess, preconditionsContext);
return SwingRelatedProcessDescriptor.of(relatedProcess, preconditionsResolutionSupplier);
}
private boolean isExecutionGrantedOrLog(final RelatedProcessDescriptor relatedProcess, final IUserRolePermissions permissions)
{
if (relatedProcess.isExecutionGranted(permissions))
{
return true;
}
if (logger.isDebugEnabled())
{
logger.debug("Skip process {} because execution was not granted using {}", relatedProcess, permissions);
}
return false;
}
private boolean isEnabledOrLog(final SwingRelatedProcessDescriptor relatedProcess)
{
|
if (relatedProcess.isEnabled())
{
return true;
}
if (!relatedProcess.isSilentRejection())
{
return true;
}
//
// Log and filter it out
if (logger.isDebugEnabled())
{
final String disabledReason = relatedProcess.getDisabledReason(Env.getAD_Language(Env.getCtx()));
logger.debug("Skip process {} because {} (silent={})", relatedProcess, disabledReason, relatedProcess.isSilentRejection());
}
return false;
}
@VisibleForTesting
/* package */ProcessPreconditionsResolution checkPreconditionApplicable(final RelatedProcessDescriptor relatedProcess, final IProcessPreconditionsContext preconditionsContext)
{
return ProcessPreconditionChecker.newInstance()
.setProcess(relatedProcess)
.setPreconditionsContext(preconditionsContext)
.checkApplies();
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\process\ui\AProcessModel.java
| 1
|
请完成以下Java代码
|
public class GetDeploymentProcessModelCmd implements Command<InputStream>, Serializable {
private static final long serialVersionUID = 1L;
protected String processDefinitionId;
public GetDeploymentProcessModelCmd(String processDefinitionId) {
if (processDefinitionId == null || processDefinitionId.length() < 1) {
throw new ProcessEngineException("The process definition id is mandatory, but '" + processDefinitionId + "' has been provided.");
}
this.processDefinitionId = processDefinitionId;
}
public InputStream execute(final CommandContext commandContext) {
ProcessDefinitionEntity processDefinition = Context
.getProcessEngineConfiguration()
.getDeploymentCache()
|
.findDeployedProcessDefinitionById(processDefinitionId);
for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadProcessDefinition(processDefinition);
}
final String deploymentId = processDefinition.getDeploymentId();
final String resourceName = processDefinition.getResourceName();
InputStream processModelStream = commandContext.runWithoutAuthorization(
new GetDeploymentResourceCmd(deploymentId, resourceName));
return processModelStream;
}
}
|
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\GetDeploymentProcessModelCmd.java
| 1
|
请完成以下Java代码
|
public void setBytes(byte[] bytes) {
this.bytes = bytes;
}
@Override
public String getDeploymentId() {
return deploymentId;
}
@Override
public void setDeploymentId(String deploymentId) {
this.deploymentId = deploymentId;
}
@Override
public Object getPersistentState() {
return AppResourceEntityImpl.class;
}
|
@Override
public boolean isGenerated() {
return false;
}
@Override
public void setGenerated(boolean generated) {
this.generated = generated;
}
@Override
public String toString() {
return "CmmnResourceEntity[id=" + id + ", name=" + name + "]";
}
}
|
repos\flowable-engine-main\modules\flowable-app-engine\src\main\java\org\flowable\app\engine\impl\persistence\entity\AppResourceEntityImpl.java
| 1
|
请完成以下Java代码
|
public static boolean isInvalidUserPassError(final Exception e)
{
return isErrorCode(e, 1017);
}
/**
* Check if "time out" exception (aka ORA-01013)
*/
public static boolean isTimeout(final Exception e)
{
if (DB.isPostgreSQL())
{
return isSQLState(e, PG_SQLSTATE_query_canceled);
}
return isErrorCode(e, 1013);
|
}
/**
* Task 08353
*/
public static boolean isDeadLockDetected(final Throwable e)
{
if (DB.isPostgreSQL())
{
return isSQLState(e, PG_SQLSTATE_deadlock_detected);
}
return isErrorCode(e, 40001); // not tested for oracle, just did a brief googling
}
} // DBException
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\exceptions\DBException.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public ModelAndView add() {
ModelAndView result = new ModelAndView("view");
result.addObject("country", new Country());
return result;
}
@RequestMapping(value = "/view/{id}")
public ModelAndView view(@PathVariable Integer id) {
ModelAndView result = new ModelAndView("view");
Country country = countryService.getById(id);
result.addObject("country", country);
return result;
}
@RequestMapping(value = "/delete/{id}")
public ModelAndView delete(@PathVariable Integer id, RedirectAttributes ra) {
ModelAndView result = new ModelAndView("redirect:/countries");
|
countryService.deleteById(id);
ra.addFlashAttribute("msg", "删除成功!");
return result;
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
public ModelAndView save(Country country) {
ModelAndView result = new ModelAndView("view");
String msg = country.getId() == null ? "新增成功!" : "更新成功!";
countryService.save(country);
result.addObject("country", country);
result.addObject("msg", msg);
return result;
}
}
|
repos\MyBatis-Spring-Boot-master\src\main\java\tk\mybatis\springboot\controller\CountryController.java
| 2
|
请在Spring Boot框架中完成以下Java代码
|
public FanoutExchange demo03Exchange() {
return new FanoutExchange(Demo03Message.EXCHANGE,
true, // durable: 是否持久化
false); // exclusive: 是否排它
}
// 创建 Binding A
// Exchange:Demo03Message.EXCHANGE
// Queue:Demo03Message.QUEUE_A
@Bean
public Binding demo03BindingA() {
return BindingBuilder.bind(demo03QueueA()).to(demo03Exchange());
}
// 创建 Binding B
// Exchange:Demo03Message.EXCHANGE
// Queue:Demo03Message.QUEUE_B
@Bean
public Binding demo03BindingB() {
return BindingBuilder.bind(demo03QueueB()).to(demo03Exchange());
}
}
/**
* Headers Exchange 示例的配置类
*/
public static class HeadersExchangeDemoConfiguration {
// 创建 Queue
@Bean
public Queue demo04Queue() {
return new Queue(Demo04Message.QUEUE, // Queue 名字
true, // durable: 是否持久化
false, // exclusive: 是否排它
false); // autoDelete: 是否自动删除
}
// 创建 Headers Exchange
|
@Bean
public HeadersExchange demo04Exchange() {
return new HeadersExchange(Demo04Message.EXCHANGE,
true, // durable: 是否持久化
false); // exclusive: 是否排它
}
// 创建 Binding
// Exchange:Demo04Message.EXCHANGE
// Queue:Demo04Message.QUEUE
// Headers: Demo04Message.HEADER_KEY + Demo04Message.HEADER_VALUE
@Bean
public Binding demo4Binding() {
return BindingBuilder.bind(demo04Queue()).to(demo04Exchange())
.where(Demo04Message.HEADER_KEY).matches(Demo04Message.HEADER_VALUE); // 配置 Headers 匹配
}
}
}
|
repos\SpringBoot-Labs-master\lab-04-rabbitmq\lab-04-rabbitmq-demo\src\main\java\cn\iocoder\springboot\lab04\rabbitmqdemo\config\RabbitConfig.java
| 2
|
请完成以下Java代码
|
final class JarFileUrlKey {
private final String protocol;
private final String host;
private final int port;
private final String file;
private final boolean runtimeRef;
JarFileUrlKey(URL url) {
this.protocol = url.getProtocol();
this.host = url.getHost();
this.port = (url.getPort() != -1) ? url.getPort() : url.getDefaultPort();
this.file = url.getFile();
this.runtimeRef = "runtime".equals(url.getRef());
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
|
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
JarFileUrlKey other = (JarFileUrlKey) obj;
// We check file first as case sensitive and the most likely item to be different
return Objects.equals(this.file, other.file) && equalsIgnoringCase(this.protocol, other.protocol)
&& equalsIgnoringCase(this.host, other.host) && (this.port == other.port)
&& (this.runtimeRef == other.runtimeRef);
}
@Override
public int hashCode() {
return Objects.hashCode(this.file);
}
private boolean equalsIgnoringCase(String s1, String s2) {
return (s1 == s2) || (s1 != null && s1.equalsIgnoreCase(s2));
}
}
|
repos\spring-boot-4.0.1\loader\spring-boot-loader\src\main\java\org\springframework\boot\loader\net\protocol\jar\JarFileUrlKey.java
| 1
|
请完成以下Java代码
|
public boolean isCreateLevelsSequentially ()
{
Object oo = get_Value(COLUMNNAME_CreateLevelsSequentially);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Default.
@param IsDefault
Default value
*/
public void setIsDefault (boolean IsDefault)
{
set_Value (COLUMNNAME_IsDefault, Boolean.valueOf(IsDefault));
}
/** Get Default.
@return Default value
*/
public boolean isDefault ()
{
Object oo = get_Value(COLUMNNAME_IsDefault);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
|
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Send dunning letters.
@param SendDunningLetter
Indicates if dunning letters will be sent
*/
public void setSendDunningLetter (boolean SendDunningLetter)
{
set_Value (COLUMNNAME_SendDunningLetter, Boolean.valueOf(SendDunningLetter));
}
/** Get Send dunning letters.
@return Indicates if dunning letters will be sent
*/
public boolean isSendDunningLetter ()
{
Object oo = get_Value(COLUMNNAME_SendDunningLetter);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Dunning.java
| 1
|
请完成以下Java代码
|
public static InvoiceAndLineId ofRepoId(@NonNull final InvoiceId invoiceId, final int invoiceLineId)
{
return new InvoiceAndLineId(invoiceId, invoiceLineId);
}
public static InvoiceAndLineId ofRepoId(final int invoiceId, final int invoiceLineId)
{
return new InvoiceAndLineId(InvoiceId.ofRepoId(invoiceId), invoiceLineId);
}
@Nullable
public static InvoiceAndLineId ofRepoIdOrNull(
@Nullable final Integer invoiceId,
@Nullable final Integer invoiceLineId)
{
return invoiceId != null && invoiceId > 0 && invoiceLineId != null && invoiceLineId > 0
? ofRepoId(invoiceId, invoiceLineId)
: null;
}
@Nullable
public static InvoiceAndLineId ofRepoIdOrNull(
@Nullable final InvoiceId bpartnerId,
final int bpartnerLocationId)
{
return bpartnerId != null && bpartnerLocationId > 0 ? ofRepoId(bpartnerId, bpartnerLocationId) : null;
}
private InvoiceAndLineId(@NonNull final InvoiceId invoiceId, final int invoiceLineId)
{
this.repoId = Check.assumeGreaterThanZero(invoiceLineId, "invoiceLineId");
this.invoiceId = invoiceId;
}
public static int toRepoId(@Nullable final InvoiceAndLineId invoiceAndLineId)
{
|
return toRepoIdOr(invoiceAndLineId, -1);
}
public static int toRepoIdOr(@Nullable final InvoiceAndLineId invoiceAndLineId, final int defaultValue)
{
return invoiceAndLineId != null ? invoiceAndLineId.getRepoId() : defaultValue;
}
public static boolean equals(final InvoiceAndLineId id1, final InvoiceAndLineId id2)
{
return Objects.equals(id1, id2);
}
public void assertInvoiceId(@NonNull final InvoiceId expectedInvoiceId)
{
if (!InvoiceId.equals(this.invoiceId, expectedInvoiceId))
{
throw new AdempiereException("InvoiceId does not match for " + this + ". Expected invoiceId was " + expectedInvoiceId);
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\invoice\InvoiceAndLineId.java
| 1
|
请完成以下Java代码
|
private boolean isReversal()
{
final int reversalId = getReversal_ID();
return reversalId > 0 && reversalId > getPP_Cost_Collector_ID();
}
@Override
public String getSummary()
{
return getDescription();
}
@Override
public LocalDate getDocumentDate()
{
return TimeUtil.asLocalDate(getMovementDate());
}
@Override
public String getProcessMsg()
{
return null;
}
@Override
public int getDoc_User_ID()
{
return getCreatedBy();
}
@Override
public int getC_Currency_ID()
{
return 0; // N/A
}
@Override
public BigDecimal getApprovalAmt()
{
return BigDecimal.ZERO; // N/A
}
@Override
public File createPDF()
{
|
throw new UnsupportedOperationException(); // N/A
}
@Override
public String getDocumentInfo()
{
final I_C_DocType dt = MDocType.get(getCtx(), getC_DocType_ID());
return dt.getName() + " " + getDocumentNo();
}
private PPOrderRouting getOrderRouting()
{
final IPPOrderRoutingRepository orderRoutingsRepo = Services.get(IPPOrderRoutingRepository.class);
final PPOrderId orderId = PPOrderId.ofRepoId(getPP_Order_ID());
return orderRoutingsRepo.getByOrderId(orderId);
}
private PPOrderRoutingActivityId getActivityId()
{
final PPOrderId orderId = PPOrderId.ofRepoId(getPP_Order_ID());
return PPOrderRoutingActivityId.ofRepoId(orderId, getPP_Order_Node_ID());
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\model\MPPCostCollector.java
| 1
|
请完成以下Java代码
|
public int getAD_Window_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Window_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Comment/Help.
@param Help
Comment or Hint
*/
public void setHelp (String Help)
{
set_Value (COLUMNNAME_Help, Help);
}
/** Get Comment/Help.
@return Comment or Hint
*/
public String getHelp ()
{
return (String)get_Value(COLUMNNAME_Help);
}
/** Set Default.
@param IsDefault
Default value
*/
public void setIsDefault (boolean IsDefault)
{
set_Value (COLUMNNAME_IsDefault, Boolean.valueOf(IsDefault));
}
/** Get Default.
@return Default value
*/
public boolean isDefault ()
{
Object oo = get_Value(COLUMNNAME_IsDefault);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Read Only.
@param IsReadOnly
Field is read only
*/
public void setIsReadOnly (boolean IsReadOnly)
|
{
set_Value (COLUMNNAME_IsReadOnly, Boolean.valueOf(IsReadOnly));
}
/** Get Read Only.
@return Field is read only
*/
public boolean isReadOnly ()
{
Object oo = get_Value(COLUMNNAME_IsReadOnly);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set User updateable.
@param IsUserUpdateable
The field can be updated by the user
*/
public void setIsUserUpdateable (boolean IsUserUpdateable)
{
set_Value (COLUMNNAME_IsUserUpdateable, Boolean.valueOf(IsUserUpdateable));
}
/** Get User updateable.
@return The field can be updated by the user
*/
public boolean isUserUpdateable ()
{
Object oo = get_Value(COLUMNNAME_IsUserUpdateable);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_UserDef_Win.java
| 1
|
请完成以下Java代码
|
public Integer getUserType() {
return userType;
}
public void setUserType(Integer userType) {
this.userType = userType;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getDisabled() {
return disabled;
}
|
public void setDisabled(Integer disabled) {
this.disabled = disabled;
}
public String getTheme() {
return theme;
}
public void setTheme(String theme) {
this.theme = theme;
}
public Integer getIsLdap() {
return isLdap;
}
public void setIsLdap(Integer isLdap) {
this.isLdap = isLdap;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
|
repos\springBoot-master\springboot-jpa\src\main\java\com\us\example\bean\User.java
| 1
|
请完成以下Java代码
|
public EventDefinitionQuery orderByEventDefinitionCategory() {
return orderBy(EventDefinitionQueryProperty.CATEGORY);
}
@Override
public EventDefinitionQuery orderByEventDefinitionId() {
return orderBy(EventDefinitionQueryProperty.ID);
}
@Override
public EventDefinitionQuery orderByEventDefinitionName() {
return orderBy(EventDefinitionQueryProperty.NAME);
}
@Override
public EventDefinitionQuery orderByTenantId() {
return orderBy(EventDefinitionQueryProperty.TENANT_ID);
}
// results ////////////////////////////////////////////
@Override
public long executeCount(CommandContext commandContext) {
return CommandContextUtil.getEventDefinitionEntityManager(commandContext).findEventDefinitionCountByQueryCriteria(this);
}
@Override
public List<EventDefinition> executeList(CommandContext commandContext) {
return CommandContextUtil.getEventDefinitionEntityManager(commandContext).findEventDefinitionsByQueryCriteria(this);
}
// getters ////////////////////////////////////////////
public String getDeploymentId() {
return deploymentId;
}
public Set<String> getDeploymentIds() {
return deploymentIds;
}
public String getParentDeploymentId() {
return parentDeploymentId;
}
public String getId() {
return id;
}
public Set<String> getIds() {
return ids;
}
public String getName() {
return name;
}
public String getNameLike() {
return nameLike;
}
public String getNameLikeIgnoreCase() {
return nameLikeIgnoreCase;
}
public String getKey() {
return key;
}
|
public String getKeyLike() {
return keyLike;
}
public String getKeyLikeIgnoreCase() {
return keyLikeIgnoreCase;
}
public String getCategory() {
return category;
}
public String getCategoryLike() {
return categoryLike;
}
public String getResourceName() {
return resourceName;
}
public String getResourceNameLike() {
return resourceNameLike;
}
public String getCategoryNotEquals() {
return categoryNotEquals;
}
public String getTenantId() {
return tenantId;
}
public String getTenantIdLike() {
return tenantIdLike;
}
public boolean isWithoutTenantId() {
return withoutTenantId;
}
}
|
repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\EventDefinitionQueryImpl.java
| 1
|
请完成以下Java代码
|
public static void main(String[] args) throws IOException
{
if (args.length < 1) usage();
new WordAnalogy(args[0]).execute();
}
protected Result getTargetVector()
{
final int words = vectorsReader.getNumWords();
final int size = vectorsReader.getSize();
String[] input = null;
while ((input = nextWords(3, "Enter 3 words")) != null)
{
// linear search the input word in vocabulary
int[] bi = new int[input.length];
int found = 0;
for (int k = 0; k < input.length; k++)
{
for (int i = 0; i < words; i++)
{
if (input[k].equals(vectorsReader.getWord(i)))
{
bi[k] = i;
System.out.printf("\nWord: %s Position in vocabulary: %d\n", input[k], bi[k]);
found++;
}
}
if (found == k)
{
System.out.printf("%s : Out of dictionary word!\n", input[k]);
}
}
if (found < input.length)
{
continue;
}
float[] vec = new float[size];
|
double len = 0;
for (int j = 0; j < size; j++)
{
vec[j] = vectorsReader.getMatrixElement(bi[1], j) -
vectorsReader.getMatrixElement(bi[0], j) + vectorsReader.getMatrixElement(bi[2], j);
len += vec[j] * vec[j];
}
len = Math.sqrt(len);
for (int i = 0; i < size; i++)
{
vec[i] /= len;
}
return new Result(vec, bi);
}
return null;
}
}
|
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\mining\word2vec\WordAnalogy.java
| 1
|
请完成以下Java代码
|
public void setProductColumn (String ProductColumn)
{
set_Value (COLUMNNAME_ProductColumn, ProductColumn);
}
/** Get Product Column.
@return Fully qualified Product column (M_Product_ID)
*/
public String getProductColumn ()
{
return (String)get_Value(COLUMNNAME_ProductColumn);
}
/** Set Sql SELECT.
@param SelectClause
SQL SELECT clause
*/
public void setSelectClause (String SelectClause)
{
set_Value (COLUMNNAME_SelectClause, SelectClause);
}
/** Get Sql SELECT.
@return SQL SELECT clause
*/
public String getSelectClause ()
{
return (String)get_Value(COLUMNNAME_SelectClause);
}
|
/** Set Sql WHERE.
@param WhereClause
Fully qualified SQL WHERE clause
*/
public void setWhereClause (String WhereClause)
{
set_Value (COLUMNNAME_WhereClause, WhereClause);
}
/** Get Sql WHERE.
@return Fully qualified SQL WHERE clause
*/
public String getWhereClause ()
{
return (String)get_Value(COLUMNNAME_WhereClause);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_MeasureCalc.java
| 1
|
请完成以下Java代码
|
public class MessageCorrelationResultImpl implements MessageCorrelationResultWithVariables {
protected final Execution execution;
protected final MessageCorrelationResultType resultType;
protected ProcessInstance processInstance;
protected VariableMap variables;
public MessageCorrelationResultImpl(CorrelationHandlerResult handlerResult) {
this.execution = handlerResult.getExecution();
this.resultType = handlerResult.getResultType();
}
@Override
public Execution getExecution() {
return execution;
}
@Override
public ProcessInstance getProcessInstance() {
return processInstance;
}
|
public void setProcessInstance(ProcessInstance processInstance) {
this.processInstance = processInstance;
}
@Override
public MessageCorrelationResultType getResultType() {
return resultType;
}
@Override
public VariableMap getVariables() {
return variables;
}
public void setVariables(VariableMap variables) {
this.variables = variables;
}
}
|
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\runtime\MessageCorrelationResultImpl.java
| 1
|
请完成以下Java代码
|
public class Person {
public Person(String firstName, String lastName, String emailAddress, String password, List<BankAccount> bankAccounts) {
this.firstName = firstName;
this.lastName = lastName;
this.emailAddress = emailAddress;
this.password = password;
this.bankAccounts = bankAccounts;
}
@Expose(serialize = true)
private String firstName;
@Expose(serialize = true)
private String lastName;
@Expose()
private String emailAddress;
@Expose(serialize = false)
private String password;
@Expose(serialize = true)
private List<BankAccount> bankAccounts;
public List<BankAccount> getBankAccounts() {
return bankAccounts;
}
public void setBankAccounts(List<BankAccount> bankAccounts) {
this.bankAccounts = bankAccounts;
}
public String getLastName() {
return lastName;
}
|
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
}
|
repos\tutorials-master\json-modules\gson-2\src\main\java\com\baeldung\gson\entities\Person.java
| 1
|
请完成以下Java代码
|
public void calculate(final IPricingContext pricingCtx, final IPricingResult result)
{
final PMMPricingAware_C_OrderLine pricingAware;
if (pricingAwareFromApplies.get() != null)
{
pricingAware = pricingAwareFromApplies.get();
pricingAwareFromApplies.set(null); // set it to null now to avoid stale references.
}
else
{
final Object referencedObject = pricingCtx.getReferencedObject();
final I_C_OrderLine ol = InterfaceWrapperHelper.create(referencedObject, I_C_OrderLine.class);
pricingAware = PMMPricingAware_C_OrderLine.of(ol);
if (pricingAware.getC_Flatrate_Term() == null)
{
return;
}
|
// update the price from procurement contract
final boolean priceComputed = Services.get(IPMMPricingBL.class).updatePriceFromContract(pricingAware);
if (!priceComputed)
{
return;
}
}
// set details in result
result.setPriceStd(pricingAware.getPrice());
result.setCurrencyId(pricingAware.getCurrencyId());
// Mark the result as calculated.
// This price will be the final one if there is no superior rule to be applied.
result.setCalculated(true);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\pricing\spi\impl\ProcurementFlatrateRule.java
| 1
|
请完成以下Java代码
|
public ResponseEntity<Flux<DataBuffer>> downloadFiles() {
String boundary = "filesBoundary";
List<Path> files = List.of(
UPLOAD_DIR.resolve("file1.txt"),
UPLOAD_DIR.resolve("file2.txt")
);
// Use concatMap to ensure files are streamed one after another, sequentially.
Flux<DataBuffer> fileFlux = Flux.fromIterable(files)
.concatMap(file -> {
String partHeader = "--" + boundary + "\r\n" +
"Content-Type: application/octet-stream\r\n" +
"Content-Disposition: attachment; filename=\"" + file.getFileName() + "\"\r\n\r\n";
Flux<DataBuffer> fileContentFlux = DataBufferUtils.read(file, new DefaultDataBufferFactory(), 4096);
DataBuffer footerBuffer = new DefaultDataBufferFactory().wrap("\r\n".getBytes());
|
// Build the flux for this specific part: header + content + footer
return Flux.concat(
Flux.just(new DefaultDataBufferFactory().wrap(partHeader.getBytes())),
fileContentFlux,
Flux.just(footerBuffer)
);
})
// After all parts, concat the final boundary
.concatWith(Flux.just(
new DefaultDataBufferFactory().wrap(("--" + boundary + "--\r\n").getBytes())
));
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_TYPE, "multipart/mixed; boundary=" + boundary)
.body(fileFlux);
}
}
|
repos\tutorials-master\spring-web-modules\spring-rest-http-3\src\main\java\com\baeldung\streaming\ReactiveStreamingController.java
| 1
|
请完成以下Java代码
|
public MigrationPlan getMigrationPlan() {
return migrationPlan;
}
public MigrationPlanExecutionBuilder processInstanceIds(List<String> processInstanceIds) {
this.processInstanceIds = processInstanceIds;
return this;
}
@Override
public MigrationPlanExecutionBuilder processInstanceIds(String... processInstanceIds) {
if (processInstanceIds == null) {
this.processInstanceIds = Collections.emptyList();
}
else {
this.processInstanceIds = Arrays.asList(processInstanceIds);
}
return this;
}
public List<String> getProcessInstanceIds() {
return processInstanceIds;
}
public MigrationPlanExecutionBuilder processInstanceQuery(ProcessInstanceQuery processInstanceQuery) {
this.processInstanceQuery = processInstanceQuery;
return this;
}
public ProcessInstanceQuery getProcessInstanceQuery() {
return processInstanceQuery;
}
|
public MigrationPlanExecutionBuilder skipCustomListeners() {
this.skipCustomListeners = true;
return this;
}
public boolean isSkipCustomListeners() {
return skipCustomListeners;
}
public MigrationPlanExecutionBuilder skipIoMappings() {
this.skipIoMappings = true;
return this;
}
public boolean isSkipIoMappings() {
return skipIoMappings;
}
public void execute() {
commandExecutor.execute(new MigrateProcessInstanceCmd(this, false));
}
public Batch executeAsync() {
return commandExecutor.execute(new MigrateProcessInstanceBatchCmd(this));
}
}
|
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\migration\MigrationPlanExecutionBuilderImpl.java
| 1
|
请完成以下Java代码
|
public String getName() {
return OBSERVATION_NAME;
}
@Override
public String getContextualName(AuthenticationObservationContext context) {
if (context.getAuthenticationRequest() != null) {
String authenticationType = context.getAuthenticationRequest().getClass().getSimpleName();
if (authenticationType.endsWith("Token")) {
authenticationType = authenticationType.substring(0, authenticationType.lastIndexOf("Token"));
}
if (authenticationType.endsWith("Authentication")) {
authenticationType = authenticationType.substring(0, authenticationType.lastIndexOf("Authentication"));
}
return "authenticate " + authenticationType.toLowerCase(Locale.ENGLISH);
}
return "authenticate";
}
/**
* {@inheritDoc}
*/
@Override
public @NonNull KeyValues getLowCardinalityKeyValues(@NonNull AuthenticationObservationContext context) {
return KeyValues.of("authentication.request.type", getAuthenticationType(context))
.and("authentication.method", getAuthenticationMethod(context))
.and("authentication.result.type", getAuthenticationResult(context))
.and("authentication.failure.type", getAuthenticationFailureType(context));
}
private String getAuthenticationType(AuthenticationObservationContext context) {
if (context.getAuthenticationRequest() == null) {
return "unknown";
}
return context.getAuthenticationRequest().getClass().getSimpleName();
}
|
private String getAuthenticationMethod(AuthenticationObservationContext context) {
if (context.getAuthenticationManagerClass() == null) {
return "unknown";
}
return context.getAuthenticationManagerClass().getSimpleName();
}
private String getAuthenticationResult(AuthenticationObservationContext context) {
if (context.getAuthenticationResult() == null) {
return "n/a";
}
return context.getAuthenticationResult().getClass().getSimpleName();
}
private String getAuthenticationFailureType(AuthenticationObservationContext context) {
if (context.getError() == null) {
return "n/a";
}
return context.getError().getClass().getSimpleName();
}
/**
* {@inheritDoc}
*/
@Override
public boolean supportsContext(Observation.Context context) {
return context instanceof AuthenticationObservationContext;
}
}
|
repos\spring-security-main\core\src\main\java\org\springframework\security\authentication\AuthenticationObservationConvention.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public static BPartnerCreditLimitId ofRepoId(@NonNull final BPartnerId bpartnerId, final int bPartnerCreditLimitId)
{
return new BPartnerCreditLimitId(bpartnerId, bPartnerCreditLimitId);
}
public static BPartnerCreditLimitId ofRepoId(final int bpartnerId, final int bPartnerCreditLimitId)
{
return new BPartnerCreditLimitId(BPartnerId.ofRepoId(bpartnerId), bPartnerCreditLimitId);
}
@Nullable
public static BPartnerCreditLimitId ofRepoIdOrNull(
@Nullable final Integer bpartnerId,
@Nullable final Integer bPartnerCreditLimitId)
{
return bpartnerId != null && bpartnerId > 0 && bPartnerCreditLimitId != null && bPartnerCreditLimitId > 0
? ofRepoId(bpartnerId, bPartnerCreditLimitId)
: null;
}
public static Optional<BPartnerCreditLimitId> optionalOfRepoId(
@Nullable final Integer bpartnerId,
@Nullable final Integer bPartnerCreditLimitId)
{
return Optional.ofNullable(ofRepoIdOrNull(bpartnerId, bPartnerCreditLimitId));
}
@Nullable
public static BPartnerCreditLimitId ofRepoIdOrNull(
@Nullable final BPartnerId bpartnerId,
@Nullable final Integer bPartnerCreditLimitId)
{
return bpartnerId != null && bPartnerCreditLimitId != null && bPartnerCreditLimitId > 0 ? ofRepoId(bpartnerId, bPartnerCreditLimitId) : null;
}
@Jacksonized
@Builder
private BPartnerCreditLimitId(@NonNull final BPartnerId bpartnerId, final int bPartnerCreditLimitId)
|
{
this.bpartnerId = bpartnerId;
this.repoId = Check.assumeGreaterThanZero(bPartnerCreditLimitId, "C_BPartner_CreditLimit_ID");
}
public static int toRepoId(@Nullable final BPartnerCreditLimitId bPartnerCreditLimitId)
{
return bPartnerCreditLimitId != null ? bPartnerCreditLimitId.getRepoId() : -1;
}
public static boolean equals(final @Nullable BPartnerCreditLimitId id1, final @Nullable BPartnerCreditLimitId id2)
{
return Objects.equals(id1, id2);
}
@JsonValue
public int toJson()
{
return getRepoId();
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\bpartner\service\BPartnerCreditLimitId.java
| 2
|
请完成以下Java代码
|
public int getCM_ChatType_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_CM_ChatType_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/**
* ConfidentialType AD_Reference_ID=340
* Reference name: R_Request Confidential
*/
public static final int CONFIDENTIALTYPE_AD_Reference_ID=340;
/** Public Information = A */
public static final String CONFIDENTIALTYPE_PublicInformation = "A";
/** Partner Confidential = C */
public static final String CONFIDENTIALTYPE_PartnerConfidential = "C";
/** Internal = I */
public static final String CONFIDENTIALTYPE_Internal = "I";
/** Private Information = P */
public static final String CONFIDENTIALTYPE_PrivateInformation = "P";
/** Set Vertraulichkeit.
@param ConfidentialType
Type of Confidentiality
*/
@Override
public void setConfidentialType (java.lang.String ConfidentialType)
{
set_Value (COLUMNNAME_ConfidentialType, ConfidentialType);
}
/** Get Vertraulichkeit.
@return Type of Confidentiality
*/
@Override
public java.lang.String getConfidentialType ()
{
return (java.lang.String)get_Value(COLUMNNAME_ConfidentialType);
}
/** Set Beschreibung.
@param Description Beschreibung */
@Override
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);
}
/**
* ModerationType AD_Reference_ID=395
* Reference name: CM_Chat ModerationType
*/
public static final int MODERATIONTYPE_AD_Reference_ID=395;
|
/** Not moderated = N */
public static final String MODERATIONTYPE_NotModerated = "N";
/** Before Publishing = B */
public static final String MODERATIONTYPE_BeforePublishing = "B";
/** After Publishing = A */
public static final String MODERATIONTYPE_AfterPublishing = "A";
/** Set Moderation Type.
@param ModerationType
Type of moderation
*/
@Override
public void setModerationType (java.lang.String ModerationType)
{
set_Value (COLUMNNAME_ModerationType, ModerationType);
}
/** Get Moderation Type.
@return Type of moderation
*/
@Override
public java.lang.String getModerationType ()
{
return (java.lang.String)get_Value(COLUMNNAME_ModerationType);
}
/** Set Datensatz-ID.
@param Record_ID
Direct internal record ID
*/
@Override
public void setRecord_ID (int Record_ID)
{
if (Record_ID < 0)
set_ValueNoCheck (COLUMNNAME_Record_ID, null);
else
set_ValueNoCheck (COLUMNNAME_Record_ID, Integer.valueOf(Record_ID));
}
/** Get Datensatz-ID.
@return Direct internal record ID
*/
@Override
public int getRecord_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Record_ID);
if (ii == null)
return 0;
return ii.intValue();
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Chat.java
| 1
|
请完成以下Java代码
|
public void putHeader(@NonNull final List<String> header)
{
if (m_columnHeaders != null)
{
logger.debug("columnHeaders were already set to {}; -> ignore given list {}", m_columnHeaders, header);
return;
}
m_columnHeaders = header;
}
@Override
public void putResult(@NonNull final ResultSet result)
{
m_resultSet = result;
if (resultFile != null)
{
exportToFile(resultFile);
}
else
{
resultFile = exportToTempFile(fileNamePrefix);
}
}
@Override
protected Properties getCtx()
{
return m_ctx;
}
@Override
public int getColumnCount()
{
try
{
return m_resultSet.getMetaData().getColumnCount();
}
catch (SQLException e)
{
throw DBException.wrapIfNeeded(e);
}
}
@Override
public int getDisplayType(final int IGNORED, final int col)
{
final Object value = getValue(col);
return CellValues.extractDisplayTypeFromValue(value);
}
@Override
public List<CellValue> getHeaderNames()
{
final List<String> headerNames = new ArrayList<>();
if (m_columnHeaders == null || m_columnHeaders.isEmpty())
{
// use the next data row; can be the first, but if we add another sheet, it can also be another one.
final List<Object> currentRow = getNextRawDataRow();
for (Object headerNameObj : currentRow)
{
headerNames.add(headerNameObj != null ? headerNameObj.toString() : null);
}
}
else
{
headerNames.addAll(m_columnHeaders);
}
final ArrayList<CellValue> result = new ArrayList<>();
final String adLanguage = getLanguage().getAD_Language();
for (final String rawHeaderName : headerNames)
{
final String headerName;
if (translateHeaders)
{
headerName = msgBL.translatable(rawHeaderName).translate(adLanguage);
}
else
{
headerName = rawHeaderName;
}
result.add(CellValues.toCellValue(headerName));
}
return result;
|
}
private Object getValue(final int col)
{
try
{
return m_resultSet.getObject(col + 1);
}
catch (SQLException e)
{
throw DBException.wrapIfNeeded(e);
}
}
@Override
public int getRowCount()
{
return -1; // TODO remove
}
@Override
public boolean isColumnPrinted(final int col)
{
return true;
}
@Override
public boolean isFunctionRow(final int row)
{
return false;
}
@Override
public boolean isPageBreak(final int row, final int col)
{
return false;
}
@Override
protected List<CellValue> getNextRow()
{
return CellValues.toCellValues(getNextRawDataRow());
}
private List<Object> getNextRawDataRow()
{
try
{
final List<Object> row = new ArrayList<>();
for (int col = 1; col <= getColumnCount(); col++)
{
final Object o = m_resultSet.getObject(col);
row.add(o);
}
noDataAddedYet = false;
return row;
}
catch (final SQLException e)
{
throw DBException.wrapIfNeeded(e);
}
}
@Override
protected boolean hasNextRow()
{
try
{
return m_resultSet.next();
}
catch (SQLException e)
{
throw DBException.wrapIfNeeded(e);
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\spreadsheet\excel\JdbcExcelExporter.java
| 1
|
请完成以下Java代码
|
public void settaxfree (final boolean taxfree)
{
set_Value (COLUMNNAME_taxfree, taxfree);
}
@Override
public boolean istaxfree()
{
return get_ValueAsBoolean(COLUMNNAME_taxfree);
}
@Override
public void setUPC_CU (final @Nullable java.lang.String UPC_CU)
{
set_ValueNoCheck (COLUMNNAME_UPC_CU, UPC_CU);
}
@Override
public java.lang.String getUPC_CU()
{
return get_ValueAsString(COLUMNNAME_UPC_CU);
}
@Override
public void setUPC_TU (final @Nullable java.lang.String UPC_TU)
|
{
set_ValueNoCheck (COLUMNNAME_UPC_TU, UPC_TU);
}
@Override
public java.lang.String getUPC_TU()
{
return get_ValueAsString(COLUMNNAME_UPC_TU);
}
@Override
public void setValue (final @Nullable java.lang.String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
@Override
public java.lang.String getValue()
{
return get_ValueAsString(COLUMNNAME_Value);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_cctop_invoic_500_v.java
| 1
|
请完成以下Java代码
|
public NonCaseString replace(char oldChar, char newChar) {
return NonCaseString.of(this.value.replace(oldChar, newChar));
}
public NonCaseString replaceAll(String regex, String replacement) {
return NonCaseString.of(this.value.replaceAll(regex, replacement));
}
public NonCaseString substring(int beginIndex) {
return NonCaseString.of(this.value.substring(beginIndex));
}
public NonCaseString substring(int beginIndex, int endIndex) {
return NonCaseString.of(this.value.substring(beginIndex, endIndex));
}
public boolean isNotEmpty() {
return !this.value.isEmpty();
}
@Override
public int length() {
return this.value.length();
}
@Override
public char charAt(int index) {
|
return this.value.charAt(index);
}
@Override
public CharSequence subSequence(int start, int end) {
return this.value.subSequence(start, end);
}
public String[] split(String regex) {
return this.value.split(regex);
}
/**
* @return 原始字符串
*/
public String get() {
return this.value;
}
@Override
public String toString() {
return this.value;
}
}
|
repos\SpringBootCodeGenerator-master\src\main\java\com\softdev\system\generator\entity\NonCaseString.java
| 1
|
请完成以下Spring Boot application配置
|
spring.ai.openai.api-key=${OPENAI_API_KEY}
spring.ai.openai.audio.transcription.options.model=whisper-1
spring.ai.openai.audio.transcription.options.language=en
spring.ai.openai.audio.speech.options.model=tts-1
spring.ai.openai.audio.speech.options.voice=alloy
spring.ai.openai.audio.speech.options.response-format=mp3
s
|
pring.ai.openai.audio.speech.options.speed=1.0
spring.servlet.multipart.max-file-size=25MB
spring.servlet.multipart.max-request-size=25MB
|
repos\tutorials-master\spring-ai-modules\spring-ai-3\src\main\resources\application-transcribe.properties
| 2
|
请完成以下Java代码
|
public List<I_C_ElementValue> getAllRecordsByChartOfAccountsId(final ChartOfAccountsId chartOfAccountsId)
{
return queryBL.createQueryBuilder(I_C_ElementValue.class)
//.addOnlyActiveRecordsFilter() // commented because we return ALL
.addEqualsFilter(I_C_ElementValue.COLUMNNAME_C_Element_ID, chartOfAccountsId)
.create()
.list();
}
public IValidationRule isOpenItemRule()
{
return SQLValidationRule.ofSqlWhereClause(I_C_ElementValue.COLUMNNAME_IsOpenItem + "=" + DB.TO_BOOLEAN(true));
}
//
//
//
//
//
private static final class ElementValuesMap
{
private final ImmutableMap<ElementValueId, ElementValue> byId;
private ImmutableSet<ElementValueId> _openItemIds;
private ElementValuesMap(final List<ElementValue> list)
{
byId = Maps.uniqueIndex(list, ElementValue::getId);
|
}
public ElementValue getById(final ElementValueId id)
{
final ElementValue elementValue = byId.get(id);
if (elementValue == null)
{
throw new AdempiereException("No Element Value found for " + id);
}
return elementValue;
}
public ImmutableSet<ElementValueId> getOpenItemIds()
{
ImmutableSet<ElementValueId> openItemIds = this._openItemIds;
if (openItemIds == null)
{
openItemIds = this._openItemIds = byId.values()
.stream()
.filter(ElementValue::isOpenItem)
.map(ElementValue::getId)
.collect(ImmutableSet.toImmutableSet());
}
return openItemIds;
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\elementvalue\ElementValueRepository.java
| 1
|
请完成以下Java代码
|
public java.sql.Timestamp getValidFrom ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_ValidFrom);
}
/** Set Gültig bis.
@param ValidTo
Gültig bis inklusiv (letzter Tag)
*/
@Override
public void setValidTo (java.sql.Timestamp ValidTo)
{
set_Value (COLUMNNAME_ValidTo, ValidTo);
}
/** Get Gültig bis.
@return Gültig bis inklusiv (letzter Tag)
*/
@Override
public java.sql.Timestamp getValidTo ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_ValidTo);
|
}
/** Set Umsatzsteuer-ID.
@param VATaxID Umsatzsteuer-ID */
@Override
public void setVATaxID (java.lang.String VATaxID)
{
set_Value (COLUMNNAME_VATaxID, VATaxID);
}
/** Get Umsatzsteuer-ID.
@return Umsatzsteuer-ID */
@Override
public java.lang.String getVATaxID ()
{
return (java.lang.String)get_Value(COLUMNNAME_VATaxID);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\tax\model\X_C_VAT_SmallBusiness.java
| 1
|
请完成以下Java代码
|
public void setR_Request_ID (int R_Request_ID)
{
if (R_Request_ID < 1)
set_Value (COLUMNNAME_R_Request_ID, null);
else
set_Value (COLUMNNAME_R_Request_ID, Integer.valueOf(R_Request_ID));
}
/** Get Request.
@return Request from a Business Partner or Prospect
*/
public int getR_Request_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_R_Request_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Source Class.
@param SourceClassName
Source Class Name
*/
public void setSourceClassName (String SourceClassName)
{
set_Value (COLUMNNAME_SourceClassName, SourceClassName);
}
/** Get Source Class.
@return Source Class Name
*/
public String getSourceClassName ()
{
return (String)get_Value(COLUMNNAME_SourceClassName);
}
/** Set Source Method.
|
@param SourceMethodName
Source Method Name
*/
public void setSourceMethodName (String SourceMethodName)
{
set_Value (COLUMNNAME_SourceMethodName, SourceMethodName);
}
/** Get Source Method.
@return Source Method Name
*/
public String getSourceMethodName ()
{
return (String)get_Value(COLUMNNAME_SourceMethodName);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_R_IssueKnown.java
| 1
|
请完成以下Java代码
|
public void format(LogEvent event, StringBuilder toAppendTo) {
StringBuilder buf = new StringBuilder();
for (PatternFormatter formatter : this.formatters) {
formatter.format(event, buf);
}
if (buf.isEmpty()) {
return;
}
toAppendTo.append("[");
toAppendTo.append(buf);
toAppendTo.append("] ");
}
/**
* Creates a new instance of the class. Required by Log4J2.
* @param config the configuration
|
* @param options the options
* @return a new instance, or {@code null} if the options are invalid
*/
public static @Nullable EnclosedInSquareBracketsConverter newInstance(@Nullable Configuration config,
String[] options) {
if (options.length < 1) {
LOGGER.error("Incorrect number of options on style. Expected at least 1, received {}", options.length);
return null;
}
PatternParser parser = PatternLayout.createPatternParser(config);
List<PatternFormatter> formatters = parser.parse(options[0]);
return new EnclosedInSquareBracketsConverter(formatters);
}
}
|
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\logging\log4j2\EnclosedInSquareBracketsConverter.java
| 1
|
请完成以下Java代码
|
public void assertLockType(@NonNull final ShipmentScheduleLockType expectedLockType)
{
if (isEmpty())
{
return;
}
final List<ShipmentScheduleLock> locksWithDifferentLockType = locks.values()
.stream()
.filter(lock -> !lock.isLockType(expectedLockType))
.collect(ImmutableList.toImmutableList());
if (!locksWithDifferentLockType.isEmpty())
{
throw new AdempiereException("Following locks are not for " + expectedLockType + ": " + locksWithDifferentLockType);
}
}
|
public Set<ShipmentScheduleId> getShipmentScheduleIdsNotLocked(@NonNull final Set<ShipmentScheduleId> shipmentScheduleIdsToCheck)
{
if (isEmpty())
{
return shipmentScheduleIdsToCheck;
}
return shipmentScheduleIdsToCheck.stream()
.filter(this::isNotLocked)
.collect(ImmutableSet.toImmutableSet());
}
public Set<ShipmentScheduleId> getShipmentScheduleIdsLocked()
{
return locks.keySet();
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\lock\ShipmentScheduleLocksMap.java
| 1
|
请完成以下Java代码
|
public void onEvent(@NonNull final IEventBus eventBus, @NonNull final Event event)
{
final AsyncBatchNotifyRequest request = extractAsyncBatchNotifyRequest(event);
try (final IAutoCloseable ignored = switchCtx(request);
final MDC.MDCCloseable ignored1 = MDC.putCloseable("eventHandler.className", handler.getClass().getName()))
{
eventLogUserService.invokeHandlerAndLog(EventLogUserService.InvokeHandlerAndLogRequest.builder()
.handlerClass(handler.getClass())
.invokaction(() -> handleRequest(request))
.build());
}
}
private void handleRequest(@NonNull final AsyncBatchNotifyRequest request)
{
|
handler.handleRequest(request);
}
private IAutoCloseable switchCtx(@NonNull final AsyncBatchNotifyRequest request)
{
final Properties ctx = createCtx(request);
return Env.switchContext(ctx);
}
private Properties createCtx(@NonNull final AsyncBatchNotifyRequest request)
{
final Properties ctx = Env.newTemporaryCtx();
Env.setClientId(ctx, request.getClientId());
return ctx;
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\eventbus\AsyncBatchEventBusService.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
private static class TableInfo
{
@NonNull
AdTableId adTableId;
@NonNull
String tableName;
@NonNull
String entityType;
@NonNull
TooltipType tooltipType;
}
private static class TableInfoMap
{
private final ImmutableMap<TableNameKey, TableInfo> tableInfoByTableName;
private final ImmutableMap<AdTableId, TableInfo> tableInfoByTableId;
TableInfoMap(@NonNull final List<TableInfo> list)
{
tableInfoByTableName = Maps.uniqueIndex(list, tableInfo -> TableNameKey.of(tableInfo.getTableName()));
tableInfoByTableId = Maps.uniqueIndex(list, TableInfo::getAdTableId);
}
@Override
public String toString()
{
return MoreObjects.toStringHelper(this)
.add("size", tableInfoByTableName.size())
.toString();
}
@Nullable
public TableInfo getTableInfoOrNull(final String tableName)
{
final TableNameKey tableNameKey = TableNameKey.of(tableName);
return tableInfoByTableName.get(tableNameKey);
}
@Nullable
public TableInfo getTableInfoOrNull(final AdTableId adTableId)
{
return tableInfoByTableId.get(adTableId);
}
}
private static class JUnitGeneratedTableInfoMap
{
private final AtomicInteger nextTableId2 = new AtomicInteger(1);
private final HashMap<TableNameKey, TableInfo> tableInfoByTableName = new HashMap<>();
private final HashMap<AdTableId, TableInfo> tableInfoByTableId = new HashMap<>();
public AdTableId getOrCreateTableId(@NonNull final String tableName)
{
final TableNameKey tableNameKey = TableNameKey.of(tableName);
TableInfo tableInfo = tableInfoByTableName.get(tableNameKey);
if (tableInfo == null)
{
tableInfo = TableInfo.builder()
.adTableId(AdTableId.ofRepoId(nextTableId2.getAndIncrement()))
.tableName(tableName)
.entityType("D")
.tooltipType(TooltipType.DEFAULT)
.build();
|
tableInfoByTableName.put(tableNameKey, tableInfo);
tableInfoByTableId.put(tableInfo.getAdTableId(), tableInfo);
}
return tableInfo.getAdTableId();
}
public String getTableName(@NonNull final AdTableId adTableId)
{
final TableInfo tableInfo = tableInfoByTableId.get(adTableId);
if (tableInfo != null)
{
return tableInfo.getTableName();
}
//noinspection ConstantConditions
final I_AD_Table adTable = POJOLookupMap.get().lookup("AD_Table", adTableId.getRepoId());
if (adTable != null)
{
final String tableName = adTable.getTableName();
if (Check.isBlank(tableName))
{
throw new AdempiereException("No TableName set for " + adTable);
}
return tableName;
}
//
throw new AdempiereException("No TableName found for AD_Table_ID=" + adTableId);
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\table\api\impl\TableIdsCache.java
| 2
|
请在Spring Boot框架中完成以下Java代码
|
private Config loadConfig(Resource configLocation) throws IOException {
URL configUrl = configLocation.getURL();
Config config = loadConfig(configUrl);
if (ResourceUtils.isFileURL(configUrl)) {
config.setConfigurationFile(configLocation.getFile());
}
else {
config.setConfigurationUrl(configUrl);
}
return config;
}
private Config loadConfig(URL configUrl) throws IOException {
try (InputStream stream = configUrl.openStream()) {
return Config.loadFromStream(stream);
}
}
}
@Configuration(proxyBeanMethods = false)
@ConditionalOnSingleCandidate(Config.class)
static class HazelcastServerConfigConfiguration {
@Bean
HazelcastInstance hazelcastInstance(Config config) {
return getHazelcastInstance(config);
}
}
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(SpringManagedContext.class)
static class SpringManagedContextHazelcastConfigCustomizerConfiguration {
@Bean
@Order(0)
HazelcastConfigCustomizer springManagedContextHazelcastConfigCustomizer(ApplicationContext applicationContext) {
return (config) -> {
|
SpringManagedContext managementContext = new SpringManagedContext();
managementContext.setApplicationContext(applicationContext);
config.setManagedContext(managementContext);
};
}
}
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(org.slf4j.Logger.class)
static class HazelcastLoggingConfigCustomizerConfiguration {
@Bean
@Order(0)
HazelcastConfigCustomizer loggingHazelcastConfigCustomizer() {
return (config) -> {
if (!config.getProperties().containsKey(HAZELCAST_LOGGING_TYPE)) {
config.setProperty(HAZELCAST_LOGGING_TYPE, "slf4j");
}
};
}
}
/**
* {@link HazelcastConfigResourceCondition} that checks if the
* {@code spring.hazelcast.config} configuration key is defined.
*/
static class ConfigAvailableCondition extends HazelcastConfigResourceCondition {
ConfigAvailableCondition() {
super(CONFIG_SYSTEM_PROPERTY, "file:./hazelcast.xml", "classpath:/hazelcast.xml", "file:./hazelcast.yaml",
"classpath:/hazelcast.yaml", "file:./hazelcast.yml", "classpath:/hazelcast.yml");
}
}
}
|
repos\spring-boot-4.0.1\module\spring-boot-hazelcast\src\main\java\org\springframework\boot\hazelcast\autoconfigure\HazelcastServerConfiguration.java
| 2
|
请在Spring Boot框架中完成以下Java代码
|
public BeanDefinition parse(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(getBeanClassName(element));
doParse(element, parserContext, builder);
RootBeanDefinition userService = (RootBeanDefinition) builder.getBeanDefinition();
String beanId = resolveId(element, userService, parserContext);
parserContext.registerBeanComponent(new BeanComponentDefinition(userService, beanId));
String cacheRef = element.getAttribute(CACHE_REF);
// Register a caching version of the user service if there's a cache-ref
if (StringUtils.hasText(cacheRef)) {
BeanDefinitionBuilder cachingUSBuilder = BeanDefinitionBuilder
.rootBeanDefinition(CachingUserDetailsService.class);
cachingUSBuilder.addConstructorArgReference(beanId);
cachingUSBuilder.addPropertyValue("userCache", new RuntimeBeanReference(cacheRef));
BeanDefinition cachingUserService = cachingUSBuilder.getBeanDefinition();
parserContext
.registerBeanComponent(new BeanComponentDefinition(cachingUserService, beanId + CACHING_SUFFIX));
}
return null;
}
private String resolveId(Element element, AbstractBeanDefinition definition, ParserContext pc)
throws BeanDefinitionStoreException {
|
String id = element.getAttribute("id");
if (pc.isNested()) {
// We're inside an <authentication-provider> element
if (!StringUtils.hasText(id)) {
id = pc.getReaderContext().generateBeanName(definition);
}
ValueHolder userDetailsServiceValueHolder = new ValueHolder(new RuntimeBeanReference(id));
userDetailsServiceValueHolder.setName("userDetailsService");
BeanDefinition container = pc.getContainingBeanDefinition();
container.getConstructorArgumentValues().addGenericArgumentValue(userDetailsServiceValueHolder);
}
if (StringUtils.hasText(id)) {
return id;
}
// If top level, use the default name or throw an exception if already used
if (pc.getRegistry().containsBeanDefinition(BeanIds.USER_DETAILS_SERVICE)) {
throw new BeanDefinitionStoreException(
"No id supplied and another bean is already registered as " + BeanIds.USER_DETAILS_SERVICE);
}
return BeanIds.USER_DETAILS_SERVICE;
}
}
|
repos\spring-security-main\config\src\main\java\org\springframework\security\config\authentication\AbstractUserDetailsServiceBeanDefinitionParser.java
| 2
|
请完成以下Java代码
|
public List<CaseInstance> findByCriteria(CaseInstanceQueryImpl query) {
// Not going through cache as the case instance should always be loaded with all related plan item instances
// when not doing a query call
setSafeInValueLists(query);
return getDbSqlSession().selectListNoCacheLoadAndStore("selectCaseInstancesByQueryCriteria", query, getManagedEntityClass());
}
@SuppressWarnings("unchecked")
@Override
public List<CaseInstance> findWithVariablesByCriteria(CaseInstanceQueryImpl query) {
setSafeInValueLists(query);
return getDbSqlSession().selectListNoCacheLoadAndStore("selectCaseInstanceWithVariablesByQueryCriteria", query, getManagedEntityClass());
}
@Override
public long countByCriteria(CaseInstanceQueryImpl query) {
setSafeInValueLists(query);
return (Long) getDbSqlSession().selectOne("selectCaseInstanceCountByQueryCriteria", query);
}
@Override
public void updateLockTime(String caseInstanceId, Date lockDate, String lockOwner, Date expirationTime) {
HashMap<String, Object> params = new HashMap<>();
params.put("id", caseInstanceId);
params.put("lockTime", lockDate);
params.put("expirationTime", expirationTime);
params.put("lockOwner", lockOwner);
int result = getDbSqlSession().directUpdate("updateCaseInstanceLockTime", params);
if (result == 0) {
throw new FlowableOptimisticLockingException("Could not lock case instance");
}
}
|
@Override
public void clearLockTime(String caseInstanceId) {
HashMap<String, Object> params = new HashMap<>();
params.put("id", caseInstanceId);
getDbSqlSession().directUpdate("clearCaseInstanceLockTime", params);
}
@Override
public void clearAllLockTimes(String lockOwner) {
HashMap<String, Object> params = new HashMap<>();
params.put("lockOwner", lockOwner);
getDbSqlSession().directUpdate("clearAllCaseInstanceLockTimes", params);
}
protected void setSafeInValueLists(CaseInstanceQueryImpl caseInstanceQuery) {
if (caseInstanceQuery.getCaseInstanceIds() != null) {
caseInstanceQuery.setSafeCaseInstanceIds(createSafeInValuesList(caseInstanceQuery.getCaseInstanceIds()));
}
if (caseInstanceQuery.getInvolvedGroups() != null) {
caseInstanceQuery.setSafeInvolvedGroups(createSafeInValuesList(caseInstanceQuery.getInvolvedGroups()));
}
if (caseInstanceQuery.getOrQueryObjects() != null && !caseInstanceQuery.getOrQueryObjects().isEmpty()) {
for (CaseInstanceQueryImpl orCaseInstanceQuery : caseInstanceQuery.getOrQueryObjects()) {
setSafeInValueLists(orCaseInstanceQuery);
}
}
}
}
|
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\persistence\entity\data\impl\MybatisCaseInstanceDataManagerImpl.java
| 1
|
请完成以下Java代码
|
public <T> T decodeString(final String text, final Class<T> clazz)
{
try
{
return mapper.readValue(text, clazz);
}
catch (final Exception e)
{
throw new RuntimeException("Cannot parse text: " + text, e);
}
}
@Override
public <T> T decodeStream(final InputStream in, final Class<T> clazz)
{
if (in == null)
{
throw new IllegalArgumentException("'in' input stream is null");
}
String str = null;
try
{
str = IOStreamUtils.toString(in);
return mapper.readValue(str, clazz);
}
catch (final Exception e)
{
throw new RuntimeException("Cannot parse input stream for class " + clazz + ": " + str, e);
}
}
@Override
public <T> T decodeBytes(final byte[] data, final Class<T> clazz)
{
try
{
return mapper.readValue(data, clazz);
}
|
catch (final Exception e)
{
throw new RuntimeException("Cannot parse bytes: " + data, e);
}
}
@Override
public <T> byte[] encode(final T object)
{
try
{
return mapper.writeValueAsBytes(object);
}
catch (final Exception e)
{
throw new RuntimeException(e);
}
}
@Override
public String getContentType()
{
return "application/json";
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive\de.metas.document.archive.base\src\main\java\org\adempiere\util\beans\JsonBeanEncoder.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public class EqualByBusinessKey {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String email;
public EqualByBusinessKey() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public int hashCode() {
return java.util.Objects.hashCode(email);
}
|
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (obj instanceof EqualByBusinessKey) {
if (((EqualByBusinessKey) obj).getEmail().equals(getEmail())) {
return true;
}
}
return false;
}
}
|
repos\tutorials-master\persistence-modules\java-jpa-3\src\main\java\com\baeldung\jpa\equality\EqualByBusinessKey.java
| 2
|
请完成以下Java代码
|
public static Collection<ModelElementType> calculateAllExtendingTypes(Model model, Collection<ModelElementType> baseTypes) {
Set<ModelElementType> allExtendingTypes = new HashSet<ModelElementType>();
for (ModelElementType baseType : baseTypes) {
ModelElementTypeImpl modelElementTypeImpl = (ModelElementTypeImpl) model.getType(baseType.getInstanceType());
modelElementTypeImpl.resolveExtendingTypes(allExtendingTypes);
}
return allExtendingTypes;
}
/**
* Calculate a collection of all base types for the given type
*/
public static Collection<ModelElementType> calculateAllBaseTypes(ModelElementType type) {
List<ModelElementType> baseTypes = new ArrayList<ModelElementType>();
ModelElementTypeImpl typeImpl = (ModelElementTypeImpl) type;
typeImpl.resolveBaseTypes(baseTypes);
return baseTypes;
}
/**
* Set new identifier if the type has a String id attribute
*
* @param type the type of the model element
* @param modelElementInstance the model element instance to set the id
* @param newId new identifier
* @param withReferenceUpdate true to update id references in other elements, false otherwise
*/
public static void setNewIdentifier(ModelElementType type, ModelElementInstance modelElementInstance,
String newId, boolean withReferenceUpdate) {
Attribute<?> id = type.getAttribute(ID_ATTRIBUTE_NAME);
if (id != null && id instanceof StringAttribute && id.isIdAttribute()) {
((StringAttribute) id).setValue(modelElementInstance, newId, withReferenceUpdate);
|
}
}
/**
* Set unique identifier if the type has a String id attribute
*
* @param type the type of the model element
* @param modelElementInstance the model element instance to set the id
*/
public static void setGeneratedUniqueIdentifier(ModelElementType type, ModelElementInstance modelElementInstance) {
setGeneratedUniqueIdentifier(type, modelElementInstance, true);
}
/**
* Set unique identifier if the type has a String id attribute
*
* @param type the type of the model element
* @param modelElementInstance the model element instance to set the id
* @param withReferenceUpdate true to update id references in other elements, false otherwise
*/
public static void setGeneratedUniqueIdentifier(ModelElementType type, ModelElementInstance modelElementInstance, boolean withReferenceUpdate) {
setNewIdentifier(type, modelElementInstance, ModelUtil.getUniqueIdentifier(type), withReferenceUpdate);
}
public static String getUniqueIdentifier(ModelElementType type) {
return type.getTypeName() + "_" + UUID.randomUUID();
}
}
|
repos\camunda-bpm-platform-master\model-api\xml-model\src\main\java\org\camunda\bpm\model\xml\impl\util\ModelUtil.java
| 1
|
请完成以下Java代码
|
public boolean isAll()
{
return this == ALL;
}
public boolean isAllRecords()
{
if (!Check.isEmpty(childTableName))
{
return childRecordId == RECORD_ID_ALL;
}
else if (!Check.isEmpty(rootTableName))
{
return rootRecordId == RECORD_ID_ALL;
}
else
{
return false;
}
}
@Nullable
public TableRecordReference getRootRecordOrNull()
{
if (rootTableName != null && rootRecordId >= 0)
{
return TableRecordReference.of(rootTableName, rootRecordId);
}
else
{
return null;
}
}
@Nullable
public TableRecordReference getChildRecordOrNull()
{
if (childTableName != null && childRecordId >= 0)
{
return TableRecordReference.of(childTableName, childRecordId);
}
else
{
return null;
}
}
public TableRecordReference getRecordEffective()
{
if (childTableName != null && childRecordId >= 0)
{
return TableRecordReference.of(childTableName, childRecordId);
}
else if (rootTableName != null && rootRecordId >= 0)
{
|
return TableRecordReference.of(rootTableName, rootRecordId);
}
else
{
throw new AdempiereException("Cannot extract effective record from " + this);
}
}
public String getTableNameEffective()
{
return childTableName != null ? childTableName : rootTableName;
}
public static final class Builder
{
private String rootTableName;
private int rootRecordId = -1;
private String childTableName;
private int childRecordId = -1;
private Builder()
{
}
public CacheInvalidateRequest build()
{
final String debugFrom = DEBUG ? Trace.toOneLineStackTraceString() : null;
return new CacheInvalidateRequest(rootTableName, rootRecordId, childTableName, childRecordId, debugFrom);
}
public Builder rootRecord(@NonNull final String tableName, final int recordId)
{
Check.assume(recordId >= 0, "recordId >= 0");
rootTableName = tableName;
rootRecordId = recordId;
return this;
}
public Builder childRecord(@NonNull final String tableName, final int recordId)
{
Check.assume(recordId >= 0, "recordId >= 0");
childTableName = tableName;
childRecordId = recordId;
return this;
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\model\CacheInvalidateRequest.java
| 1
|
请完成以下Java代码
|
public void setName(String name) {
this.name = name;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
|
}
public List<String> getCourses() {
return courses;
}
public void setCourses(List<String> courses) {
this.courses = courses;
}
public String getAdditionalSkills() {
return additionalSkills;
}
public void setAdditionalSkills(String additionalSkills) {
this.additionalSkills = additionalSkills;
}
}
|
repos\tutorials-master\spring-web-modules\spring-thymeleaf\src\main\java\com\baeldung\thymeleaf\model\Teacher.java
| 1
|
请完成以下Java代码
|
private long getMaxDebugAllUntil(TenantId tenantId, long now) {
return now + TimeUnit.MINUTES.toMillis(DebugModeUtil.getMaxDebugAllDuration(tbTenantProfileCache.get(tenantId).getDefaultProfileConfiguration().getMaxDebugModeDurationMinutes(), defaultDebugDurationMinutes));
}
protected <E extends HasId<?> & HasTenantId & HasName> void uniquifyEntityName(E entity, E oldEntity, Consumer<String> setName, EntityType entityType, NameConflictStrategy strategy) {
Dao<?> dao = entityDaoRegistry.getDao(entityType);
List<EntityInfo> existingEntities = dao.findEntityInfosByNamePrefix(entity.getTenantId(), entity.getName());
Set<String> existingNames = existingEntities.stream()
.filter(e -> (oldEntity == null || !e.getId().equals(oldEntity.getId())))
.map(EntityInfo::getName)
.collect(Collectors.toSet());
if (existingNames.contains(entity.getName())) {
String uniqueName = generateUniqueName(entity.getName(), existingNames, strategy);
setName.accept(uniqueName);
}
}
|
private String generateUniqueName(String baseName, Set<String> existingNames, NameConflictStrategy strategy) {
String newName;
int index = 1;
String separator = strategy.separator();
boolean isRandom = strategy.uniquifyStrategy() == RANDOM;
do {
String suffix = isRandom ? StringUtils.randomAlphanumeric(6) : String.valueOf(index++);
newName = baseName + separator + suffix;
} while (existingNames.contains(newName));
return newName;
}
}
|
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\entity\AbstractEntityService.java
| 1
|
请完成以下Java代码
|
public ProxyClassMethodBindingsMap load(Class<?> interfaceClass) throws Exception
{
return new ProxyClassMethodBindingsMap(interfaceClass);
}
});
public static final ProxyMethodsCache getInstance()
{
return instance;
}
private ProxyMethodsCache()
{
super();
}
/**
* Gets the implementation method of a given interface method.
*
* @param interfaceMethod
* @param implClass implementation class where the implementation method will be searched
* @return implementation method or <code>null</code> if it was not found
*/
public final Method getMethodImplementation(final Method interfaceMethod, final Class<?> implClass)
{
final Class<?> interfaceClass = interfaceMethod.getDeclaringClass();
final ProxyClassMethodBindingsMap implBindingsMap = getProxyClassMethodBindingsMap(interfaceClass);
|
final ProxyClassMethodBindings bindings = implBindingsMap.getMethodImplementationBindings(implClass);
final Method implMethod = bindings.getMethodImplementation(interfaceMethod);
return implMethod;
}
/**
* Create (if it doesn't yet exist) and look up the method binding.
*
* @param interfaceClass
* @return
*/
private final ProxyClassMethodBindingsMap getProxyClassMethodBindingsMap(final Class<?> interfaceClass)
{
try
{
return interfaceClass2implBindingsMap.get(interfaceClass);
}
catch (ExecutionException e)
{
// shall not happen
throw new RuntimeException("Failed loading bindings for " + interfaceClass);
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\proxy\ProxyMethodsCache.java
| 1
|
请完成以下Java代码
|
public String toString() {
return this.string;
}
private String getDomainOrDefault(@Nullable String domain) {
if (domain == null || LEGACY_DOMAIN.equals(domain)) {
return DEFAULT_DOMAIN;
}
return domain;
}
private String getNameWithDefaultPath(String domain, String name) {
if (DEFAULT_DOMAIN.equals(domain) && !name.contains("/")) {
return OFFICIAL_REPOSITORY_NAME + "/" + name;
}
return name;
}
static @Nullable String parseDomain(String value) {
int firstSlash = value.indexOf('/');
String candidate = (firstSlash != -1) ? value.substring(0, firstSlash) : null;
|
if (candidate != null && Regex.DOMAIN.matcher(candidate).matches()) {
return candidate;
}
return null;
}
static ImageName of(String value) {
Assert.hasText(value, "'value' must not be empty");
String domain = parseDomain(value);
String path = (domain != null) ? value.substring(domain.length() + 1) : value;
Assert.isTrue(Regex.PATH.matcher(path).matches(),
() -> "'value' path must contain an image reference in the form '[domainHost:port/][path/]name' "
+ "(with 'path' and 'name' containing only [a-z0-9][.][_][-]) [" + value + "]");
return new ImageName(domain, path);
}
}
|
repos\spring-boot-4.0.1\core\spring-boot-docker-compose\src\main\java\org\springframework\boot\docker\compose\core\ImageName.java
| 1
|
请完成以下Java代码
|
public static ApplicationContext getApplicationContext() {
return applicationContext;
}
public static Object getBean(String name) throws BeansException {
return applicationContext.getBean(name);
}
public static Object getBean(String name, Class requiredType) throws BeansException {
return applicationContext.getBean(name, requiredType);
}
public static <T> T getBean(Class<T> clazz) throws BeansException {
return applicationContext.getBean(clazz);
}
|
public static boolean containsBean(String name) {
return applicationContext.containsBean(name);
}
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
return applicationContext.isSingleton(name);
}
public static Class getType(String name) throws NoSuchBeanDefinitionException {
return applicationContext.getType(name);
}
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
return applicationContext.getAliases(name);
}
}
|
repos\springBoot-master\springboot-shiro2\src\main\java\cn\abel\rest\utils\SpringContextKit.java
| 1
|
请完成以下Java代码
|
public void setC_CreditLimit_Type_ID (int C_CreditLimit_Type_ID)
{
if (C_CreditLimit_Type_ID < 1)
set_Value (COLUMNNAME_C_CreditLimit_Type_ID, null);
else
set_Value (COLUMNNAME_C_CreditLimit_Type_ID, Integer.valueOf(C_CreditLimit_Type_ID));
}
/** Get Credit Limit Type.
@return Credit Limit Type */
@Override
public int getC_CreditLimit_Type_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_CreditLimit_Type_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_C_Currency_ID, org.compiere.model.I_C_Currency.class);
}
@Override
public void setC_Currency(org.compiere.model.I_C_Currency C_Currency)
{
set_ValueFromPO(COLUMNNAME_C_Currency_ID, org.compiere.model.I_C_Currency.class, C_Currency);
}
/** Set Währung.
@param C_Currency_ID
Die Währung für diesen Eintrag
*/
@Override
public void setC_Currency_ID (int C_Currency_ID)
{
throw new IllegalArgumentException ("C_Currency_ID is virtual column"); }
/** Get Währung.
@return Die Währung für diesen Eintrag
*/
@Override
public int getC_Currency_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Datum von.
@param DateFrom
Startdatum eines Abschnittes
*/
@Override
public void setDateFrom (java.sql.Timestamp DateFrom)
{
set_Value (COLUMNNAME_DateFrom, DateFrom);
}
/** Get Datum von.
@return Startdatum eines Abschnittes
*/
@Override
|
public java.sql.Timestamp getDateFrom ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_DateFrom);
}
/** Set Freigegeben.
@param Processed
Checkbox sagt aus, ob der Beleg verarbeitet wurde.
*/
@Override
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Freigegeben.
@return Checkbox sagt aus, ob der Beleg verarbeitet wurde.
*/
@Override
public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_BPartner_CreditLimit.java
| 1
|
请完成以下Java代码
|
public String getParentId() {
return parentId;
}
public String getTenantId() {
return tenantId;
}
public String getTenantIdLike() {
return tenantIdLike;
}
public boolean isWithoutTenantId() {
return withoutTenantId;
}
public String getName() {
return name;
}
public String getNameLike() {
|
return nameLike;
}
public void setName(String name) {
this.name = name;
}
public void setNameLike(String nameLike) {
this.nameLike = nameLike;
}
public String getNameLikeIgnoreCase() {
return nameLikeIgnoreCase;
}
public void setNameLikeIgnoreCase(String nameLikeIgnoreCase) {
this.nameLikeIgnoreCase = nameLikeIgnoreCase;
}
}
|
repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\ExecutionQueryImpl.java
| 1
|
请完成以下Java代码
|
public static int toRepoId(@Nullable final UomId uomId)
{
return uomId != null ? uomId.getRepoId() : -1;
}
public static Optional<UomId> optionalOfRepoId(final int repoId)
{
return Optional.ofNullable(ofRepoIdOrNull(repoId));
}
int repoId;
private UomId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "C_UOM_ID");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public static boolean equals(@Nullable final UomId id1, @Nullable final UomId id2)
{
return Objects.equals(id1, id2);
}
@NonNull
@SafeVarargs
public static <T> UomId getCommonUomIdOfAll(
@NonNull final Function<T, UomId> getUomId,
@NonNull final String name,
@Nullable final T... objects)
{
if (objects == null || objects.length == 0)
{
throw new AdempiereException("No " + name + " provided");
}
else if (objects.length == 1 && objects[0] != null)
{
return getUomId.apply(objects[0]);
}
else
{
UomId commonUomId = null;
for (final T object : objects)
{
|
if (object == null)
{
continue;
}
final UomId uomId = getUomId.apply(object);
if (commonUomId == null)
{
commonUomId = uomId;
}
else if (!UomId.equals(commonUomId, uomId))
{
throw new AdempiereException("All given " + name + "(s) shall have the same UOM: " + Arrays.asList(objects));
}
}
if (commonUomId == null)
{
throw new AdempiereException("At least one non null " + name + " instance was expected: " + Arrays.asList(objects));
}
return commonUomId;
}
}
public boolean isEach() {return EACH.equals(this);}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\uom\UomId.java
| 1
|
请完成以下Java代码
|
public void setR_Status_ID (int R_Status_ID)
{
if (R_Status_ID < 1)
set_ValueNoCheck (COLUMNNAME_R_Status_ID, null);
else
set_ValueNoCheck (COLUMNNAME_R_Status_ID, Integer.valueOf(R_Status_ID));
}
/** Get Status.
@return Request Status
*/
public int getR_Status_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_R_Status_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_AD_User getSalesRep() throws RuntimeException
{
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name)
.getPO(getSalesRep_ID(), get_TrxName()); }
/** Set Sales Representative.
@param SalesRep_ID
Sales Representative or Company Agent
*/
public void setSalesRep_ID (int SalesRep_ID)
{
if (SalesRep_ID < 1)
set_ValueNoCheck (COLUMNNAME_SalesRep_ID, null);
else
set_ValueNoCheck (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID));
}
/** Get Sales Representative.
@return Sales Representative or Company Agent
*/
public int getSalesRep_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Start Date.
@param StartDate
First effective day (inclusive)
*/
public void setStartDate (Timestamp StartDate)
{
set_Value (COLUMNNAME_StartDate, StartDate);
}
/** Get Start Date.
@return First effective day (inclusive)
*/
public Timestamp getStartDate ()
{
return (Timestamp)get_Value(COLUMNNAME_StartDate);
}
/** Set Summary.
@param Summary
Textual summary of this request
*/
public void setSummary (String Summary)
{
set_ValueNoCheck (COLUMNNAME_Summary, Summary);
}
/** Get Summary.
@return Textual summary of this request
*/
public String getSummary ()
{
return (String)get_Value(COLUMNNAME_Summary);
}
|
/** TaskStatus AD_Reference_ID=366 */
public static final int TASKSTATUS_AD_Reference_ID=366;
/** 0% Not Started = 0 */
public static final String TASKSTATUS_0NotStarted = "0";
/** 100% Complete = D */
public static final String TASKSTATUS_100Complete = "D";
/** 20% Started = 2 */
public static final String TASKSTATUS_20Started = "2";
/** 80% Nearly Done = 8 */
public static final String TASKSTATUS_80NearlyDone = "8";
/** 40% Busy = 4 */
public static final String TASKSTATUS_40Busy = "4";
/** 60% Good Progress = 6 */
public static final String TASKSTATUS_60GoodProgress = "6";
/** 90% Finishing = 9 */
public static final String TASKSTATUS_90Finishing = "9";
/** 95% Almost Done = A */
public static final String TASKSTATUS_95AlmostDone = "A";
/** 99% Cleaning up = C */
public static final String TASKSTATUS_99CleaningUp = "C";
/** Set Task Status.
@param TaskStatus
Status of the Task
*/
public void setTaskStatus (String TaskStatus)
{
set_Value (COLUMNNAME_TaskStatus, TaskStatus);
}
/** Get Task Status.
@return Status of the Task
*/
public String getTaskStatus ()
{
return (String)get_Value(COLUMNNAME_TaskStatus);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_R_RequestAction.java
| 1
|
请完成以下Java代码
|
public class DelegateTaskCmd implements Command<Object>, Serializable {
private static final long serialVersionUID = 1L;
protected String taskId;
protected String userId;
public DelegateTaskCmd(String taskId, String userId) {
this.taskId = taskId;
this.userId = userId;
}
public Object execute(CommandContext commandContext) {
ensureNotNull("taskId", taskId);
TaskManager taskManager = commandContext.getTaskManager();
TaskEntity task = taskManager.findTaskById(taskId);
ensureNotNull("Cannot find task with id " + taskId, "task", task);
|
checkDelegateTask(task, commandContext);
task.delegate(userId);
task.triggerUpdateEvent();
task.logUserOperation(UserOperationLogEntry.OPERATION_TYPE_DELEGATE);
return null;
}
protected void checkDelegateTask(TaskEntity task, CommandContext commandContext) {
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkTaskAssign(task);
}
}
}
|
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\DelegateTaskCmd.java
| 1
|
请完成以下Java代码
|
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Foo other = (Foo) obj;
|
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (title == null) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
return true;
}
@Override
public String toString() {
return "Foo [id=" + id + ", title=" + title + "]";
}
}
|
repos\tutorials-master\spring-boot-modules\spring-boot-springdoc-2\src\main\java\com\baeldung\restdocopenapi\Foo.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public class TrieConfig
{
/**
* 允许重叠
*/
private boolean allowOverlaps = true;
/**
* 只保留最长匹配
*/
public boolean remainLongest = false;
/**
* 是否允许重叠
*
* @return
*/
|
public boolean isAllowOverlaps()
{
return allowOverlaps;
}
/**
* 设置是否允许重叠
*
* @param allowOverlaps
*/
public void setAllowOverlaps(boolean allowOverlaps)
{
this.allowOverlaps = allowOverlaps;
}
}
|
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\algorithm\ahocorasick\trie\TrieConfig.java
| 2
|
请完成以下Java代码
|
public class ByteArrayResourceReader extends AbstractResourceReader {
protected static final int DEFAULT_BUFFER_SIZE = 32768;
/**
* Returns the required {@link Integer#TYPE buffer size} used to capture data from the target {@link Resource}
* in chunks.
*
* Subclasses are encouraged to override this method as necessary to tune the buffer size. By default, the
* buffer size is {@literal 32K} or {@literal 32768} bytes.
*
* @return the required {@link Integer#TYPE buffer size} to read from the {@link Resource} in chunks.
*/
protected int getBufferSize() {
return DEFAULT_BUFFER_SIZE;
}
/**
* @inheritDoc
|
*/
@Override
protected @NonNull byte[] doRead(@NonNull InputStream resourceInputStream) throws IOException {
try (ByteArrayOutputStream out = new ByteArrayOutputStream(resourceInputStream.available())) {
byte[] buffer = new byte[getBufferSize()];
for (int bytesRead = resourceInputStream.read(buffer); bytesRead != -1; bytesRead = resourceInputStream.read(buffer)) {
// using a buffer will trigger a flush() automatically in the OutputStream
out.write(buffer, 0, bytesRead);
}
out.flush();
return out.toByteArray();
}
}
}
|
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\core\io\support\ByteArrayResourceReader.java
| 1
|
请完成以下Java代码
|
public boolean isAutoCommit()
{
return true;
}
public void setDecimalFormat(final DecimalFormat format)
{
this.m_format = format;
m_text.setDocument(new MDocNumber(m_displayType, m_format, m_text, m_title));
}
public DecimalFormat getDecimalFormat()
{
return m_format;
}
// metas: end
// metas
@Override
public void addMouseListener(MouseListener l)
{
m_text.addMouseListener(l);
}
/**
* This implementation always returns true.
*/
// task 05005
@Override
public boolean isRealChange(final PropertyChangeEvent e)
{
return true;
}
@Override
public final ICopyPasteSupportEditor getCopyPasteSupport()
{
return m_text == null ? NullCopyPasteSupportEditor.instance : m_text.getCopyPasteSupport();
}
@Override
protected final boolean processKeyBinding(final KeyStroke ks, final KeyEvent e, final int condition, final boolean pressed)
{
// Forward all key events on this component to the text field.
// We have to do this for the case when we are embedding this editor in a JTable and the JTable is forwarding the key strokes to editing component.
// Effect of NOT doing this: when in JTable, user presses a key (e.g. a digit) to start editing but the first key he pressed gets lost here.
|
if (m_text != null && condition == WHEN_FOCUSED)
{
// Usually the text component does not have focus yet but it was requested, so, considering that:
// * we are requesting the focus just to make sure
// * we select all text (once) => as an effect, on first key pressed the editor content (which is selected) will be deleted and replaced with the new typing
// * make sure that in the focus event which will come, the text is not selected again, else, if user is typing fast, the editor content will be only what he typed last.
if(!m_text.hasFocus())
{
skipNextSelectAllOnFocusGained = true;
m_text.requestFocus();
if (m_text.getDocument().getLength() > 0)
{
m_text.selectAll();
}
}
if (m_text.processKeyBinding(ks, e, condition, pressed))
{
return true;
}
}
//
// Fallback to super
return super.processKeyBinding(ks, e, condition, pressed);
}
} // VNumber
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VNumber.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public String getBPartnerName(@Nullable final BPartnerId bpartnerId)
{
return bpartnerBL.getBPartnerName(bpartnerId);
}
public Map<BPartnerId, String> getBPartnerNames(@NonNull final Set<BPartnerId> bpartnerIds)
{
return bpartnerBL.getBPartnerNames(bpartnerIds);
}
public ShipmentAllocationBestBeforePolicy getBestBeforePolicy(@NonNull final BPartnerId bpartnerId)
{
return bpartnerBL.getBestBeforePolicy(bpartnerId);
}
public Set<DocumentLocation> getDocumentLocations(@NonNull final Set<BPartnerLocationId> bpartnerLocationIds)
{
return documentLocationBL.getDocumentLocations(bpartnerLocationIds);
|
}
public I_C_BPartner_Location getBPartnerLocationByIdEvenInactive(final @NonNull BPartnerLocationId id)
{
return bpartnerBL.getBPartnerLocationByIdEvenInactive(id);
}
public List<I_C_BPartner_Location> getBPartnerLocationsByIds(final Set<BPartnerLocationId> ids)
{
return bpartnerBL.getBPartnerLocationsByIds(ids);
}
public RenderedAddressProvider newRenderedAddressProvider()
{
return documentLocationBL.newRenderedAddressProvider();
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\external\bpartner\PickingJobBPartnerService.java
| 2
|
请完成以下Java代码
|
public void setAccountNonLocked(boolean accountNonLocked) {
this.instance.accountNonLocked = accountNonLocked;
}
public void setAuthorities(Collection<? extends GrantedAuthority> authorities) {
this.mutableAuthorities = new ArrayList<>();
this.mutableAuthorities.addAll(authorities);
}
public void setCredentialsNonExpired(boolean credentialsNonExpired) {
this.instance.credentialsNonExpired = credentialsNonExpired;
}
public void setDn(String dn) {
this.instance.dn = dn;
}
public void setDn(Name dn) {
this.instance.dn = dn.toString();
}
public void setEnabled(boolean enabled) {
this.instance.enabled = enabled;
}
public void setPassword(String password) {
this.instance.password = password;
}
|
public void setUsername(String username) {
this.instance.username = username;
}
public void setTimeBeforeExpiration(int timeBeforeExpiration) {
this.instance.timeBeforeExpiration = timeBeforeExpiration;
}
public void setGraceLoginsRemaining(int graceLoginsRemaining) {
this.instance.graceLoginsRemaining = graceLoginsRemaining;
}
}
}
|
repos\spring-security-main\ldap\src\main\java\org\springframework\security\ldap\userdetails\LdapUserDetailsImpl.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public class CorsBeanDefinitionParser {
private static final String ATT_SOURCE = "configuration-source-ref";
private static final String ATT_REF = "ref";
public BeanMetadataElement parse(Element element, ParserContext parserContext) {
if (element == null) {
return null;
}
String filterRef = element.getAttribute(ATT_REF);
if (StringUtils.hasText(filterRef)) {
return new RuntimeBeanReference(filterRef);
}
BeanMetadataElement configurationSource = getSource(element, parserContext);
if (configurationSource == null) {
|
throw new BeanCreationException("Could not create CorsFilter");
}
BeanDefinitionBuilder filterBldr = BeanDefinitionBuilder.rootBeanDefinition(CorsFilter.class);
filterBldr.addConstructorArgValue(configurationSource);
return filterBldr.getBeanDefinition();
}
public BeanMetadataElement getSource(Element element, ParserContext parserContext) {
String configurationSourceRef = element.getAttribute(ATT_SOURCE);
if (StringUtils.hasText(configurationSourceRef)) {
return new RuntimeBeanReference(configurationSourceRef);
}
return new RootBeanDefinition(CorsConfigurationSourceFactoryBean.class);
}
}
|
repos\spring-security-main\config\src\main\java\org\springframework\security\config\http\CorsBeanDefinitionParser.java
| 2
|
请完成以下Java代码
|
private PurchaseCandidateRequestedEvent createForecastRequestedEvent(@NonNull final CandidatesGroup group,
@NonNull final EventDescriptor eventDescriptor)
{
final Candidate singleCandidate = group.getSingleCandidate();
final PurchaseDetail purchaseDetail = PurchaseDetail.castOrNull(singleCandidate.getBusinessCaseDetail());
final ProductPlanningId productPlanningId = purchaseDetail == null ? null : ProductPlanningId.ofRepoId(purchaseDetail.getProductPlanningRepoId());
final Dimension dimension = singleCandidate.getDimension();
return PurchaseCandidateRequestedEvent.builder()
.eventDescriptor(eventDescriptor.withClientAndOrg(singleCandidate.getClientAndOrgId()))
.supplyCandidateRepoId(singleCandidate.getId().getRepoId())
.purchaseMaterialDescriptor(singleCandidate.getMaterialDescriptor())
.forecastId(singleCandidate.getDemandDetail().getForecastId())
.forecastLineId(singleCandidate.getDemandDetail().getForecastLineId())
.campaignId(dimension.getCampaignId())
.activityId(dimension.getActivityId() == null ? -1 : dimension.getActivityId().getRepoId())
.projectId(dimension.getProjectId() == null ? -1 : dimension.getProjectId().getRepoId())
.userElementId1(dimension.getUserElement1Id())
.userElementId2(dimension.getUserElement2Id())
.userElementString1(dimension.getUserElementString1())
.userElementString2(dimension.getUserElementString2())
.userElementString3(dimension.getUserElementString3())
.userElementString4(dimension.getUserElementString4())
.userElementString5(dimension.getUserElementString5())
.userElementString6(dimension.getUserElementString6())
.userElementString7(dimension.getUserElementString7())
.productPlanningId(productPlanningId)
.supplyCandidateRepoId(singleCandidate.getId().getRepoId())
.build();
}
@Nullable
private HUPIItemProductId getPackingMaterialId(final int demandOrderLineId)
|
{
final OrderLineId orderLineId = OrderLineId.ofRepoIdOrNull(IdConstants.toRepoId(demandOrderLineId));
return Optional.ofNullable(orderLineId)
.map(orderLineRepository::getById)
.map(OrderLine::getHuPIItemProductId)
.orElse(null);
}
@Nullable
private static PPOrderRef getPpOrderRef(final Candidate candidate)
{
final ProductionDetail productionDetail = candidate.getBusinessCaseDetail(ProductionDetail.class).orElse(null);
if (productionDetail != null)
{
return productionDetail.getPpOrderRef();
}
final DistributionDetail distributionDetail = candidate.getBusinessCaseDetail(DistributionDetail.class).orElse(null);
if (distributionDetail != null)
{
return distributionDetail.getForwardPPOrderRef();
}
return null;
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java\de\metas\material\dispo\commons\RequestMaterialOrderService.java
| 1
|
请完成以下Java代码
|
public String getJobType() {
return jobType;
}
public void setJobType(String jobType) {
this.jobType = jobType;
}
@Override
public String getJobConfiguration() {
return jobConfiguration;
}
public void setJobConfiguration(String jobConfiguration) {
this.jobConfiguration = jobConfiguration;
}
@Override
public String getProcessDefinitionKey() {
return processDefinitionKey;
}
public void setProcessDefinitionKey(String processDefinitionKey) {
this.processDefinitionKey = processDefinitionKey;
}
public int getSuspensionState() {
return suspensionState;
}
public void setSuspensionState(int state) {
this.suspensionState = state;
}
public Long getOverridingJobPriority() {
return jobPriority;
}
public void setJobPriority(Long jobPriority) {
this.jobPriority = jobPriority;
|
}
public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public String getDeploymentId() {
return deploymentId;
}
public void setDeploymentId(String deploymentId) {
this.deploymentId = deploymentId;
}
@Override
public Set<String> getReferencedEntityIds() {
Set<String> referencedEntityIds = new HashSet<>();
return referencedEntityIds;
}
@Override
public Map<String, Class> getReferencedEntitiesIdAndClass() {
Map<String, Class> referenceIdAndClass = new HashMap<>();
return referenceIdAndClass;
}
}
|
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\JobDefinitionEntity.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public class ExamRepository {
private EntityManagerFactory emf = null;
public ExamRepository() {
emf = Persistence.createEntityManagerFactory("jpa-h2-text");
}
public Exam find(Long id) {
EntityManager entityManager = emf.createEntityManager();
Exam exam = entityManager.find(Exam.class, id);
entityManager.close();
return exam;
}
public Exam save(Exam exam) {
|
EntityManager entityManager = emf.createEntityManager();
entityManager.getTransaction()
.begin();
exam = entityManager.merge(exam);
entityManager.getTransaction()
.commit();
entityManager.close();
return exam;
}
public void clean() {
emf.close();
}
}
|
repos\tutorials-master\persistence-modules\java-jpa-2\src\main\java\com\baeldung\jpa\text\ExamRepository.java
| 2
|
请完成以下Java代码
|
public final class JavaMethodDeclaration implements Annotatable {
private final AnnotationContainer annotations = new AnnotationContainer();
private final String name;
private final String returnType;
private final int modifiers;
private final List<Parameter> parameters;
private final CodeBlock code;
private JavaMethodDeclaration(Builder builder, CodeBlock code) {
this.name = builder.name;
this.returnType = builder.returnType;
this.modifiers = builder.modifiers;
this.parameters = List.copyOf(builder.parameters);
this.code = code;
}
/**
* Creates a new builder for the method with the given name.
* @param name the name
* @return the builder
*/
public static Builder method(String name) {
return new Builder(name);
}
String getName() {
return this.name;
}
String getReturnType() {
return this.returnType;
}
List<Parameter> getParameters() {
return this.parameters;
}
int getModifiers() {
return this.modifiers;
}
CodeBlock getCode() {
return this.code;
}
@Override
public AnnotationContainer annotations() {
return this.annotations;
}
/**
* Builder for creating a {@link JavaMethodDeclaration}.
*/
public static final class Builder {
private final String name;
private List<Parameter> parameters = new ArrayList<>();
private String returnType = "void";
|
private int modifiers;
private Builder(String name) {
this.name = name;
}
/**
* Sets the modifiers.
* @param modifiers the modifiers
* @return this for method chaining
*/
public Builder modifiers(int modifiers) {
this.modifiers = modifiers;
return this;
}
/**
* Sets the return type.
* @param returnType the return type
* @return this for method chaining
*/
public Builder returning(String returnType) {
this.returnType = returnType;
return this;
}
/**
* Sets the parameters.
* @param parameters the parameters
* @return this for method chaining
*/
public Builder parameters(Parameter... parameters) {
this.parameters = Arrays.asList(parameters);
return this;
}
/**
* Sets the body.
* @param code the code for the body
* @return the method containing the body
*/
public JavaMethodDeclaration body(CodeBlock code) {
return new JavaMethodDeclaration(this, code);
}
}
}
|
repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\language\java\JavaMethodDeclaration.java
| 1
|
请完成以下Java代码
|
public class TcpClientSocket {
private Socket socket;
private PrintStream out;
private BufferedReader in;
public void connect(String host, int port) {
try {
socket = new Socket(host, port);
socket.setSoTimeout(30000);
System.out.println("connected to " + host + " on port " + port);
out = new PrintStream(socket.getOutputStream(), true);
System.out.println("Sending message ... ");
out.println("Hello world");
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out.println(in.readLine());
System.out.println("Closing connection !!! ");
in.close();
out.close();
|
socket.close();
} catch (UnknownHostException e) {
System.err.println(e);
} catch (IOException e) {
System.err.println(e);
}
}
public static void main(String[] args) throws IOException {
TcpClientSocket client = new TcpClientSocket();
client.connect("127.0.0.1", 5000);
}
}
|
repos\tutorials-master\core-java-modules\core-java-networking\src\main\java\com\baeldung\timeout\TcpClientSocket.java
| 1
|
请完成以下Java代码
|
public List<I_C_Queue_WorkPackage_Notified> retrieveWorkPackagesNotified(final I_C_Async_Batch asyncBatch, final boolean notified)
{
final Properties ctx = InterfaceWrapperHelper.getCtx(asyncBatch);
final String trxName = InterfaceWrapperHelper.getTrxName(asyncBatch);
final List<Object> params = new ArrayList<Object>();
final StringBuffer whereClause = new StringBuffer();
whereClause.append(I_C_Queue_WorkPackage_Notified.COLUMNNAME_C_Async_Batch_ID + " = ? ");
params.add(asyncBatch.getC_Async_Batch_ID());
whereClause.append(" AND " + I_C_Queue_WorkPackage_Notified.COLUMNNAME_IsNotified + " = ? ");
params.add(notified);
return new Query(ctx, I_C_Queue_WorkPackage_Notified.Table_Name, whereClause.toString(), trxName)
.setOnlyActiveRecords(true)
.setParameters(params)
.setOrderBy(I_C_Queue_WorkPackage_Notified.COLUMNNAME_BachWorkpackageSeqNo)
.list(I_C_Queue_WorkPackage_Notified.class);
}
@Override
public I_C_Queue_WorkPackage_Notified fetchWorkPackagesNotified(final I_C_Queue_WorkPackage workPackage)
|
{
final Properties ctx = InterfaceWrapperHelper.getCtx(workPackage);
final String trxName = InterfaceWrapperHelper.getTrxName(workPackage);
final List<Object> params = new ArrayList<Object>();
final StringBuffer whereClause = new StringBuffer();
whereClause.append(I_C_Queue_WorkPackage_Notified.COLUMNNAME_C_Queue_WorkPackage_ID + " = ? ");
params.add(workPackage.getC_Queue_WorkPackage_ID());
return new Query(ctx, I_C_Queue_WorkPackage_Notified.Table_Name, whereClause.toString(), trxName)
.setOnlyActiveRecords(true)
.setParameters(params)
.firstOnly(I_C_Queue_WorkPackage_Notified.class);
}
@Override
public void setPInstance_IDAndSave(@NonNull final I_C_Async_Batch asyncBatch, @NonNull final PInstanceId pInstanceId)
{
asyncBatch.setAD_PInstance_ID(pInstanceId.getRepoId());
InterfaceWrapperHelper.save(asyncBatch);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\api\impl\AsyncBatchDAO.java
| 1
|
请完成以下Java代码
|
public int getC_ScannableCode_Format_Part_ID()
{
return get_ValueAsInt(COLUMNNAME_C_ScannableCode_Format_Part_ID);
}
@Override
public void setDataFormat (final @Nullable java.lang.String DataFormat)
{
set_Value (COLUMNNAME_DataFormat, DataFormat);
}
@Override
public java.lang.String getDataFormat()
{
return get_ValueAsString(COLUMNNAME_DataFormat);
}
/**
* DataType AD_Reference_ID=541944
* Reference name: C_ScannableCode_Format_Part_DataType
*/
public static final int DATATYPE_AD_Reference_ID=541944;
/** ProductCode = PRODUCT_CODE */
public static final String DATATYPE_ProductCode = "PRODUCT_CODE";
/** WeightInKg = WEIGHT_KG */
public static final String DATATYPE_WeightInKg = "WEIGHT_KG";
/** LotNo = LOT */
public static final String DATATYPE_LotNo = "LOT";
/** BestBeforeDate = BEST_BEFORE_DATE */
public static final String DATATYPE_BestBeforeDate = "BEST_BEFORE_DATE";
/** Ignored = IGNORE */
public static final String DATATYPE_Ignored = "IGNORE";
/** Constant = CONSTANT */
public static final String DATATYPE_Constant = "CONSTANT";
/** ProductionDate = PRODUCTION_DATE */
public static final String DATATYPE_ProductionDate = "PRODUCTION_DATE";
@Override
public void setDataType (final java.lang.String DataType)
{
set_Value (COLUMNNAME_DataType, DataType);
}
@Override
public java.lang.String getDataType()
{
return get_ValueAsString(COLUMNNAME_DataType);
}
@Override
public void setDecimalPointPosition (final int DecimalPointPosition)
{
set_Value (COLUMNNAME_DecimalPointPosition, DecimalPointPosition);
}
@Override
public int getDecimalPointPosition()
{
|
return get_ValueAsInt(COLUMNNAME_DecimalPointPosition);
}
@Override
public void setDescription (final @Nullable java.lang.String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
@Override
public java.lang.String getDescription()
{
return get_ValueAsString(COLUMNNAME_Description);
}
@Override
public void setEndNo (final int EndNo)
{
set_Value (COLUMNNAME_EndNo, EndNo);
}
@Override
public int getEndNo()
{
return get_ValueAsInt(COLUMNNAME_EndNo);
}
@Override
public void setStartNo (final int StartNo)
{
set_Value (COLUMNNAME_StartNo, StartNo);
}
@Override
public int getStartNo()
{
return get_ValueAsInt(COLUMNNAME_StartNo);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_ScannableCode_Format_Part.java
| 1
|
请完成以下Java代码
|
public Collection<? extends GrantedAuthority> getAuthorities() {
return authorities;
}
@Override
public String getPassword() {
return password;
}
@Override
public String getUsername() {
return username;
}
@Override
public boolean isAccountNonExpired() {
return true;
}
|
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return Objects.equals(this.status, Consts.ENABLE);
}
}
|
repos\spring-boot-demo-master\demo-rbac-security\src\main\java\com\xkcoding\rbac\security\vo\UserPrincipal.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
protected List<EngineDeployer> getCustomDeployers() {
return null;
}
@Override
protected String getMybatisCfgPath() {
return IdmEngineConfiguration.DEFAULT_MYBATIS_MAPPING_FILE;
}
@Override
public void configure(AbstractEngineConfiguration engineConfiguration) {
if (idmEngineConfiguration == null) {
idmEngineConfiguration = new StandaloneIdmEngineConfiguration();
}
initialiseCommonProperties(engineConfiguration, idmEngineConfiguration);
initEngine();
initServiceConfigurations(engineConfiguration, idmEngineConfiguration);
}
@Override
protected IdmEngine buildEngine() {
|
return idmEngineConfiguration.buildEngine();
}
@Override
protected List<Class<? extends Entity>> getEntityInsertionOrder() {
return EntityDependencyOrder.INSERT_ORDER;
}
@Override
protected List<Class<? extends Entity>> getEntityDeletionOrder() {
return EntityDependencyOrder.DELETE_ORDER;
}
public IdmEngineConfiguration getIdmEngineConfiguration() {
return idmEngineConfiguration;
}
public IdmEngineConfigurator setIdmEngineConfiguration(IdmEngineConfiguration idmEngineConfiguration) {
this.idmEngineConfiguration = idmEngineConfiguration;
return this;
}
}
|
repos\flowable-engine-main\modules\flowable-idm-engine-configurator\src\main\java\org\flowable\idm\engine\configurator\IdmEngineConfigurator.java
| 2
|
请完成以下Java代码
|
public void setQty (java.math.BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
/** Get Menge.
@return Menge
*/
@Override
public java.math.BigDecimal getQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Qty);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Reihenfolge.
@param SeqNo
Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst
*/
@Override
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Reihenfolge.
@return Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst
*/
@Override
public int getSeqNo ()
{
|
Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set VariantGroup.
@param VariantGroup VariantGroup */
@Override
public void setVariantGroup (java.lang.String VariantGroup)
{
set_Value (COLUMNNAME_VariantGroup, VariantGroup);
}
/** Get VariantGroup.
@return VariantGroup */
@Override
public java.lang.String getVariantGroup ()
{
return (java.lang.String)get_Value(COLUMNNAME_VariantGroup);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Order_Report.java
| 1
|
请完成以下Java代码
|
public boolean isNew() {
return ((DeploymentEntity) activiti5Deployment).isNew();
}
@Override
public Map<String, EngineResource> getResources() {
return null;
}
@Override
public String getDerivedFrom() {
return null;
}
@Override
public String getDerivedFromRoot() {
return null;
|
}
@Override
public String getParentDeploymentId() {
return null;
}
@Override
public String getEngineVersion() {
return Flowable5Util.V5_ENGINE_TAG;
}
public org.activiti.engine.repository.Deployment getRawObject() {
return activiti5Deployment;
}
}
|
repos\flowable-engine-main\modules\flowable5-compatibility\src\main\java\org\flowable\compatibility\wrapper\Flowable5DeploymentWrapper.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public class PermissionBaseEntity implements Serializable {
private static final long serialVersionUID = -1164227376672815589L;
private Long id;// 主键ID.
private Integer version = 0;// 版本号默认为0
private String status;// 状态 PublicStatusEnum
private String creater;// 创建人.
private Date createTime = new Date();// 创建时间.
private String editor;// 修改人.
private Date editTime;// 修改时间.
private String remark;// 描述
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getCreater() {
return creater;
}
public void setCreater(String creater) {
this.creater = creater;
}
public Date getCreateTime() {
return createTime;
}
|
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getEditor() {
return editor;
}
public void setEditor(String editor) {
this.editor = editor;
}
public Date getEditTime() {
return editTime;
}
public void setEditTime(Date editTime) {
this.editTime = editTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
|
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\permission\entity\PermissionBaseEntity.java
| 2
|
请完成以下Java代码
|
public static void bind(final IAttributeStorage storage, final DocumentPath documentPath)
{
final AttributeStorage2ExecutionEventsForwarder forwarder = new AttributeStorage2ExecutionEventsForwarder(documentPath);
storage.addListener(forwarder);
}
private final DocumentPath documentPath;
private AttributeStorage2ExecutionEventsForwarder(@NonNull final DocumentPath documentPath)
{
this.documentPath = documentPath;
}
private void forwardEvent(final IAttributeStorage storage, final IAttributeValue attributeValue)
{
final IDocumentChangesCollector changesCollector = Execution.getCurrentDocumentChangesCollector();
final AttributeCode attributeCode = attributeValue.getAttributeCode();
final Object jsonValue = HUEditorRowAttributesHelper.extractJSONValue(storage, attributeValue, JSONOptions.newInstance());
final DocumentFieldWidgetType widgetType = HUEditorRowAttributesHelper.extractWidgetType(attributeValue);
changesCollector.collectEvent(MutableDocumentFieldChangedEvent.of(documentPath, attributeCode.getCode(), widgetType)
.setValue(jsonValue));
|
}
@Override
public void onAttributeValueCreated(final IAttributeValueContext attributeValueContext, final IAttributeStorage storage, final IAttributeValue attributeValue)
{
forwardEvent(storage, attributeValue);
}
@Override
public void onAttributeValueChanged(final IAttributeValueContext attributeValueContext, final IAttributeStorage storage, final IAttributeValue attributeValue, final Object valueOld)
{
forwardEvent(storage, attributeValue);
}
@Override
public void onAttributeValueDeleted(final IAttributeValueContext attributeValueContext, final IAttributeStorage storage, final IAttributeValue attributeValue)
{
throw new UnsupportedOperationException();
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\HUEditorRowAttributes.java
| 1
|
请完成以下Java代码
|
public static void sortAscending(final int[] arr) {
for (int i = 0; i < arr.length - 1; i++) {
int minElementIndex = i;
for (int j = i + 1; j < arr.length; j++) {
if (arr[minElementIndex] > arr[j]) {
minElementIndex = j;
}
}
if (minElementIndex != i) {
int temp = arr[i];
arr[i] = arr[minElementIndex];
arr[minElementIndex] = temp;
}
}
}
|
public static void sortDescending(final int[] arr) {
for (int i = 0; i < arr.length - 1; i++) {
int maxElementIndex = i;
for (int j = i + 1; j < arr.length; j++) {
if (arr[maxElementIndex] < arr[j]) {
maxElementIndex = j;
}
}
if (maxElementIndex != i) {
int temp = arr[i];
arr[i] = arr[maxElementIndex];
arr[maxElementIndex] = temp;
}
}
}
}
|
repos\tutorials-master\algorithms-modules\algorithms-sorting-2\src\main\java\com\baeldung\algorithms\selectionsort\SelectionSort.java
| 1
|
请完成以下Java代码
|
public String getPostingType ()
{
return (String)get_Value(COLUMNNAME_PostingType);
}
/** Set Processed.
@param Processed
The document has been processed
*/
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Processed.
@return The document has been processed
*/
public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
|
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
}
/** Get Process Now.
@return Process Now */
public boolean isProcessing ()
{
Object oo = get_Value(COLUMNNAME_Processing);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Depreciation_Forecast.java
| 1
|
请完成以下Java代码
|
public Class<?> getInterfaceClass() {
return this.interfaceClass;
}
public String getGroup() {
return this.group;
}
public String getVersion() {
return this.version;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ClassIdBean)) {
return false;
}
ClassIdBean classIdBean = (ClassIdBean) obj;
if (this.interfaceClass == null ? classIdBean.interfaceClass != null
: !this.interfaceClass.equals(classIdBean.interfaceClass)) {
return false;
}
if (this.group == null ? classIdBean.group != null : !this.group.equals(classIdBean.group)) {
return false;
}
return this.version == null ? classIdBean.version == null
|
: this.version.equals(classIdBean.version);
}
@Override
public int hashCode() {
int hashCode = 17;
hashCode = 31 * hashCode + (this.interfaceClass == null ? 0 : this.interfaceClass.hashCode());
hashCode = 31 * hashCode + (this.group == null ? 0 : this.group.hashCode());
hashCode = 31 * hashCode + (this.version == null ? 0 : this.version.hashCode());
return hashCode;
}
@Override
public String toString() {
return "ClassIdBean [interfaceClass=" + this.interfaceClass + ", group=" + this.group
+ ", version=" + this.version + "]";
}
}
|
repos\dubbo-spring-boot-starter-master\src\main\java\com\alibaba\dubbo\spring\boot\bean\ClassIdBean.java
| 1
|
请完成以下Java代码
|
public boolean hasBoundaryErrorEvents() {
if (this.boundaryEvents != null && !this.boundaryEvents.isEmpty()) {
return this.boundaryEvents.stream().anyMatch(boundaryEvent -> boundaryEvent.hasErrorEventDefinition());
}
return false;
}
public ServiceTask clone() {
ServiceTask clone = new ServiceTask();
clone.setValues(this);
return clone;
}
public void setValues(ServiceTask otherElement) {
super.setValues(otherElement);
setImplementation(otherElement.getImplementation());
setImplementationType(otherElement.getImplementationType());
setResultVariableName(otherElement.getResultVariableName());
setType(otherElement.getType());
setOperationRef(otherElement.getOperationRef());
setExtensionId(otherElement.getExtensionId());
setSkipExpression(otherElement.getSkipExpression());
|
fieldExtensions = new ArrayList<FieldExtension>();
if (otherElement.getFieldExtensions() != null && !otherElement.getFieldExtensions().isEmpty()) {
for (FieldExtension extension : otherElement.getFieldExtensions()) {
fieldExtensions.add(extension.clone());
}
}
customProperties = new ArrayList<CustomProperty>();
if (otherElement.getCustomProperties() != null && !otherElement.getCustomProperties().isEmpty()) {
for (CustomProperty property : otherElement.getCustomProperties()) {
customProperties.add(property.clone());
}
}
}
}
|
repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\ServiceTask.java
| 1
|
请完成以下Java代码
|
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getCounty() {
|
return county;
}
public void setCounty(String county) {
this.county = county;
}
public String getTimezone() {
return timezone;
}
public void setTimezone(String timezone) {
this.timezone = timezone;
}
}
|
repos\tutorials-master\quarkus-modules\quarkus-vs-springboot\quarkus-project\src\main\java\com\baeldung\quarkus_project\ZipCode.java
| 1
|
请完成以下Java代码
|
public int getPMM_Balance_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_PMM_Balance_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Gelieferte Menge.
@param QtyDelivered
Gelieferte Menge
*/
@Override
public void setQtyDelivered (java.math.BigDecimal QtyDelivered)
{
set_Value (COLUMNNAME_QtyDelivered, QtyDelivered);
}
/** Get Gelieferte Menge.
@return Gelieferte Menge
*/
@Override
public java.math.BigDecimal getQtyDelivered ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyDelivered);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Bestellte Menge.
@param QtyOrdered
Bestellte Menge
*/
@Override
public void setQtyOrdered (java.math.BigDecimal QtyOrdered)
{
set_Value (COLUMNNAME_QtyOrdered, QtyOrdered);
}
/** Get Bestellte Menge.
@return Bestellte Menge
*/
@Override
public java.math.BigDecimal getQtyOrdered ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyOrdered);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Bestellte Menge (TU).
@param QtyOrdered_TU
Bestellte Menge (TU)
*/
@Override
public void setQtyOrdered_TU (java.math.BigDecimal QtyOrdered_TU)
{
set_ValueNoCheck (COLUMNNAME_QtyOrdered_TU, QtyOrdered_TU);
}
/** Get Bestellte Menge (TU).
@return Bestellte Menge (TU)
*/
@Override
public java.math.BigDecimal getQtyOrdered_TU ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyOrdered_TU);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Zusagbar.
@param QtyPromised Zusagbar */
@Override
public void setQtyPromised (java.math.BigDecimal QtyPromised)
{
set_Value (COLUMNNAME_QtyPromised, QtyPromised);
}
/** Get Zusagbar.
@return Zusagbar */
@Override
public java.math.BigDecimal getQtyPromised ()
|
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyPromised);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Zusagbar (TU).
@param QtyPromised_TU Zusagbar (TU) */
@Override
public void setQtyPromised_TU (java.math.BigDecimal QtyPromised_TU)
{
set_ValueNoCheck (COLUMNNAME_QtyPromised_TU, QtyPromised_TU);
}
/** Get Zusagbar (TU).
@return Zusagbar (TU) */
@Override
public java.math.BigDecimal getQtyPromised_TU ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyPromised_TU);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Wochenerster.
@param WeekDate Wochenerster */
@Override
public void setWeekDate (java.sql.Timestamp WeekDate)
{
set_ValueNoCheck (COLUMNNAME_WeekDate, WeekDate);
}
/** Get Wochenerster.
@return Wochenerster */
@Override
public java.sql.Timestamp getWeekDate ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_WeekDate);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java-gen\de\metas\procurement\base\model\X_PMM_Balance.java
| 1
|
请完成以下Java代码
|
public Config setNumThreads(int numThreads)
{
this.numThreads = numThreads;
return this;
}
public int getNumThreads()
{
return numThreads;
}
public Config setUseHierarchicalSoftmax(boolean hs)
{
this.hs = hs;
return this;
}
public boolean useHierarchicalSoftmax()
{
return hs;
}
public Config setUseContinuousBagOfWords(boolean cbow)
{
this.cbow = cbow;
return this;
}
public boolean useContinuousBagOfWords()
{
return cbow;
}
public Config setSample(float sample)
{
this.sample = sample;
return this;
}
public float getSample()
{
return sample;
}
public Config setAlpha(float alpha)
{
this.alpha = alpha;
return this;
}
public float getAlpha()
|
{
return alpha;
}
public Config setInputFile(String inputFile)
{
this.inputFile = inputFile;
return this;
}
public String getInputFile()
{
return inputFile;
}
public TrainingCallback getCallback()
{
return callback;
}
public void setCallback(TrainingCallback callback)
{
this.callback = callback;
}
}
|
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\mining\word2vec\Config.java
| 1
|
请完成以下Java代码
|
private static Optional<InventoryType> extractInventoryType(
@NonNull final List<InventoryLine> lines)
{
return lines.stream()
.map(InventoryLine::getInventoryType)
.reduce(Reducers.singleValue(values -> new AdempiereException("Mixing Physical inventories with Internal Use inventories is not allowed: " + lines)));
}
public boolean isInternalUseInventory()
{
return inventoryType.isInternalUse();
}
public InventoryLine getLineById(@NonNull final InventoryLineId inventoryLineId)
{
return lines.stream()
.filter(line -> inventoryLineId.equals(line.getId()))
.findFirst()
.orElseThrow(() -> new AdempiereException("No line found for " + inventoryLineId + " in " + this));
}
public ImmutableList<InventoryLineHU> getLineHUs()
{
return streamLineHUs().collect(ImmutableList.toImmutableList());
}
private Stream<InventoryLineHU> streamLineHUs()
{
return lines.stream().flatMap(line -> line.getInventoryLineHUs().stream());
}
public ImmutableSet<HuId> getHuIds()
{
return InventoryLineHU.extractHuIds(streamLineHUs());
}
public Inventory assigningTo(@NonNull final UserId newResponsibleId)
{
return assigningTo(newResponsibleId, false);
}
public Inventory reassigningTo(@NonNull final UserId newResponsibleId)
{
return assigningTo(newResponsibleId, true);
}
private Inventory assigningTo(@NonNull final UserId newResponsibleId, boolean allowReassignment)
{
// no responsible change
if (UserId.equals(responsibleId, newResponsibleId))
{
return this;
}
if (!newResponsibleId.isRegularUser())
{
throw new AdempiereException("Only regular users can be assigned to an inventory");
}
if (!allowReassignment && responsibleId != null)
{
throw new AdempiereException("Inventory is already assigned");
}
return toBuilder().responsibleId(newResponsibleId).build();
}
public Inventory unassign()
{
return responsibleId == null ? this : toBuilder().responsibleId(null).build();
}
public void assertHasAccess(@NonNull final UserId calledId)
{
if (!UserId.equals(responsibleId, calledId))
|
{
throw new AdempiereException("No access");
}
}
public Stream<InventoryLine> streamLines(@Nullable final InventoryLineId onlyLineId)
{
return onlyLineId != null
? Stream.of(getLineById(onlyLineId))
: lines.stream();
}
public Set<LocatorId> getLocatorIdsEligibleForCounting(@Nullable final InventoryLineId onlyLineId)
{
return streamLines(onlyLineId)
.filter(InventoryLine::isEligibleForCounting)
.map(InventoryLine::getLocatorId)
.collect(ImmutableSet.toImmutableSet());
}
public Inventory updatingLineById(@NonNull final InventoryLineId lineId, @NonNull UnaryOperator<InventoryLine> updater)
{
final ImmutableList<InventoryLine> newLines = CollectionUtils.map(
this.lines,
line -> InventoryLineId.equals(line.getId(), lineId) ? updater.apply(line) : line
);
return this.lines == newLines
? this
: toBuilder().lines(newLines).build();
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inventory\Inventory.java
| 1
|
请完成以下Java代码
|
protected void toString(final ToStringHelper stringHelper)
{
stringHelper
.add("id", id)
.add("asi", asi);
}
@Override
protected List<IAttributeValue> loadAttributeValues()
{
final IAttributeSetInstanceBL asiBL = Services.get(IAttributeSetInstanceBL.class);
final ImmutableList.Builder<IAttributeValue> result = ImmutableList.builder();
final List<I_M_AttributeInstance> attributeInstances = asiBL.getAttributeInstances(asi);
for (final I_M_AttributeInstance attributeInstance : attributeInstances)
{
final IAttributeValue attributeValue = new AIAttributeValue(this, attributeInstance);
result.add(attributeValue);
}
return result.build();
}
@Override
protected List<IAttributeValue> generateAndGetInitialAttributes(final IAttributeValueContext attributesCtx, final Map<AttributeId, Object> defaultAttributesValue)
{
throw new UnsupportedOperationException("Generating initial attributes not supported for " + this);
}
@Override
public void updateHUTrxAttribute(final MutableHUTransactionAttribute huTrxAttribute, final IAttributeValue fromAttributeValue)
{
huTrxAttribute.setReferencedObject(asi);
}
/**
* Method not supported.
*
* @throws UnsupportedOperationException
*/
@Override
protected void addChildAttributeStorage(final IAttributeStorage childAttributeStorage)
{
throw new UnsupportedOperationException("Child attribute storages are not supported for " + this);
}
|
/**
* Method not supported.
*
* @throws UnsupportedOperationException
*/
@Override
protected IAttributeStorage removeChildAttributeStorage(final IAttributeStorage childAttributeStorage)
{
throw new UnsupportedOperationException("Child attribute storages are not supported for " + this);
}
@Override
public void saveChangesIfNeeded()
{
throw new UnsupportedOperationException();
}
@Override
public void setSaveOnChange(boolean saveOnChange)
{
throw new UnsupportedOperationException();
}
@Override
public UOMType getQtyUOMTypeOrNull()
{
// ASI attribute storages does not support Qty Storage
return null;
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\storage\ASIAttributeStorage.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public class ProductServiceImpl implements ProductService {
@Autowired
private ProductDao productDao;
@Override
@Transactional // <1> 开启新事物
public void reduceStock(Long productId, Integer amount) throws Exception {
log.info("[reduceStock] 当前 XID: {}", RootContext.getXID());
// <2> 检查库存
checkStock(productId, amount);
log.info("[reduceStock] 开始扣减 {} 库存", productId);
// <3> 扣减库存
int updateCount = productDao.reduceStock(productId, amount);
// 扣除成功
|
if (updateCount == 0) {
log.warn("[reduceStock] 扣除 {} 库存失败", productId);
throw new Exception("库存不足");
}
// 扣除失败
log.info("[reduceStock] 扣除 {} 库存成功", productId);
}
private void checkStock(Long productId, Integer requiredAmount) throws Exception {
log.info("[checkStock] 检查 {} 库存", productId);
Integer stock = productDao.getStock(productId);
if (stock < requiredAmount) {
log.warn("[checkStock] {} 库存不足,当前库存: {}", productId, stock);
throw new Exception("库存不足");
}
}
}
|
repos\springboot-demo-master\seata\seata-product\src\main\java\com\et\seata\product\service\ProductServiceImpl.java
| 2
|
请在Spring Boot框架中完成以下Java代码
|
public static class FinishedGoodToRepair
{
@NonNull Quantity qty;
@NonNull QtyCalculationsBOM sparePartsBOM;
@NonNull @Builder.Default AttributeSetInstanceId asiId = AttributeSetInstanceId.NONE;
@NonNull WarrantyCase warrantyCase;
@NonNull HuId repairVhuId;
@NonNull InOutAndLineId customerReturnLineId;
public Stream<ProductId> streamComponentIds()
{
return sparePartsBOM.getLines().stream().map(QtyCalculationsBOMLine::getProductId);
}
@Nullable
public Quantity computeQtyOfComponentsRequired(
@NonNull final ProductId componentId,
@NonNull final QuantityUOMConverter uomConverter)
{
final QtyCalculationsBOMLine bomLine = sparePartsBOM.getLineByComponentId(componentId).orElse(null);
if (bomLine == null)
{
return null;
}
final Quantity qtyInBomUOM = uomConverter.convertQuantityTo(qty, bomLine.getBomProductId(), bomLine.getBomProductUOMId());
|
return bomLine.computeQtyRequired(qtyInBomUOM);
}
public ProductId getProductId()
{
return sparePartsBOM.getBomProductId();
}
}
@Value
@Builder
public static class SparePart
{
@NonNull ProductId sparePartId;
@NonNull Quantity qty;
@NonNull InOutAndLineId customerReturnLineId;
@NonNull HuId sparePartsVhuId;
public Quantity getQty(@NonNull final UomId targetUomId, @NonNull final QuantityUOMConverter uomConverter)
{
return uomConverter.convertQuantityTo(getQty(), getSparePartId(), targetUomId);
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.base\src\main\java\de\metas\servicerepair\customerreturns\SparePartsReturnCalculation.java
| 2
|
请在Spring Boot框架中完成以下Java代码
|
public class HelloWorldController {
private static Logger log = LoggerFactory.getLogger(HelloWorldController.class);
@Autowired
private RestTemplate restTemplate;
@RequestMapping("ping")
public Object ping() {
log.info("进入ping");
return "pong study";
}
@RequestMapping("log")
public Object log() {
log.info("this is info log");
log.error("this is error log");
log.debug("this is debug log");
log.warn("this is warn log");
log.trace("this is trace log");
return "123";
}
@RequestMapping("http")
public Object httpQuery() {
|
String studyUrl = "http://localhost:8088/ping";
URI studyUri = URI.create(studyUrl);
String study = restTemplate.getForObject(studyUri, String.class);
log.info("study:{}", study);
String floorUrl = "http://localhost:8088/log";
URI floorUri = URI.create(floorUrl);
String floor = restTemplate.getForObject(floorUri, String.class);
log.info("floor:{}", floor);
String roomUrl = "http://localhost:8088/ping";
URI roomUri = URI.create(roomUrl);
String room = restTemplate.getForObject(roomUri, String.class);
log.info("room:{}", room);
return study + "-------" + floor + "-------" + room + "-------";
}
}
|
repos\springboot-demo-master\zipkin\src\main\java\com\et\zipkin\controller\HelloWorldController.java
| 2
|
请完成以下Java代码
|
public MapFormat setLeftBrace(final String delimiter)
{
leftDelimiter = delimiter;
return this;
}
/** Returns string used as right brace */
public String getRightBrace()
{
return rightDelimiter;
}
/**
* Sets string used as right brace
*
* @param delimiter Right brace.
* @return
*/
public MapFormat setRightBrace(final String delimiter)
{
rightDelimiter = delimiter;
return this;
}
/**
* Sets argument map This map should contain key-value pairs with key values used in formatted string expression. If value for key was not found, formatter leave key unchanged (except if you've
* set setThrowExceptionIfKeyWasNotFound(true), then it fires IllegalArgumentException.
*
* @param map the argument map
* @return
*/
public MapFormat setArguments(final Map<String, ?> map)
{
if (map == null)
{
_argumentsMap = Collections.emptyMap();
}
else
{
_argumentsMap = new HashMap<>(map);
}
return this;
}
/** Pre-compiled pattern */
private static final class Pattern
{
private static final int BUFSIZE = 255;
/** Offsets to {} expressions */
private final int[] offsets;
/** Keys enclosed by {} brackets */
private final String[] arguments;
/** Max used offset */
private int maxOffset;
private final String patternPrepared;
public Pattern(final String patternStr, final String leftDelimiter, final String rightDelimiter, final boolean exactMatch)
{
super();
int idx = 0;
int offnum = -1;
final StringBuffer outpat = new StringBuffer();
offsets = new int[BUFSIZE];
arguments = new String[BUFSIZE];
maxOffset = -1;
while (true)
{
int rightDelimiterIdx = -1;
final int leftDelimiterIdx = patternStr.indexOf(leftDelimiter, idx);
|
if (leftDelimiterIdx >= 0)
{
rightDelimiterIdx = patternStr.indexOf(rightDelimiter, leftDelimiterIdx + leftDelimiter.length());
}
else
{
break;
}
if (++offnum >= BUFSIZE)
{
throw new IllegalArgumentException("TooManyArguments");
}
if (rightDelimiterIdx < 0)
{
if (exactMatch)
{
throw new IllegalArgumentException("UnmatchedBraces");
}
else
{
break;
}
}
outpat.append(patternStr.substring(idx, leftDelimiterIdx));
offsets[offnum] = outpat.length();
arguments[offnum] = patternStr.substring(leftDelimiterIdx + leftDelimiter.length(), rightDelimiterIdx);
idx = rightDelimiterIdx + rightDelimiter.length();
maxOffset++;
}
outpat.append(patternStr.substring(idx));
patternPrepared = outpat.toString();
}
public String substring(final int beginIndex, final int endIndex)
{
return patternPrepared.substring(beginIndex, endIndex);
}
public int length()
{
return patternPrepared.length();
}
public int getMaxOffset()
{
return maxOffset;
}
public int getOffsetIndex(final int i)
{
return offsets[i];
}
public String getArgument(final int i)
{
return arguments[i];
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.printing.client\src\main\java\de\metas\printing\client\util\MapFormat.java
| 1
|
请完成以下Java代码
|
private int setAsyncBatchCountEnqueued(@NonNull final I_C_Queue_WorkPackage workPackage, final int offset)
{
final AsyncBatchId asyncBatchId = AsyncBatchId.ofRepoIdOrNull(workPackage.getC_Async_Batch_ID());
if (asyncBatchId == null)
{
return 0;
}
lock.lock();
try
{
final I_C_Async_Batch asyncBatch = asyncBatchDAO.retrieveAsyncBatchRecordOutOfTrx(asyncBatchId);
final Timestamp enqueued = SystemTime.asTimestamp();
if (asyncBatch.getFirstEnqueued() == null)
{
asyncBatch.setFirstEnqueued(enqueued);
}
|
asyncBatch.setLastEnqueued(enqueued);
final int countEnqueued = asyncBatch.getCountEnqueued() + offset;
asyncBatch.setCountEnqueued(countEnqueued);
// we just enqueued something, so we are clearly not done yet
asyncBatch.setIsProcessing(true);
asyncBatch.setProcessed(false);
save(asyncBatch);
return countEnqueued;
}
finally
{
lock.unlock();
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\api\impl\AsyncBatchBL.java
| 1
|
请完成以下Java代码
|
public void setParameterName(String parameterName) {
Assert.hasLength(parameterName, "parameterName cannot be null or empty");
this.parameterName = parameterName;
}
/**
* Sets the header name that the {@link CsrfToken} is expected to appear on and the
* header that the response will contain the {@link CsrfToken}.
* @param headerName the new header name to use
*/
public void setHeaderName(String headerName) {
Assert.hasLength(headerName, "headerName cannot be null or empty");
this.headerName = headerName;
}
/**
* Sets the {@link WebSession} attribute name that the {@link CsrfToken} is stored in
|
* @param sessionAttributeName the new attribute name to use
*/
public void setSessionAttributeName(String sessionAttributeName) {
Assert.hasLength(sessionAttributeName, "sessionAttributeName cannot be null or empty");
this.sessionAttributeName = sessionAttributeName;
}
private CsrfToken createCsrfToken() {
return new DefaultCsrfToken(this.headerName, this.parameterName, createNewToken());
}
private String createNewToken() {
return UUID.randomUUID().toString();
}
}
|
repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\csrf\WebSessionServerCsrfTokenRepository.java
| 1
|
请完成以下Java代码
|
public void updateQtyToIssue(
@NonNull final PPOrderIssueScheduleId issueScheduleId,
@NonNull final Quantity qtyToIssue)
{
final PPOrderIssueSchedule issueSchedule = issueScheduleRepository.getById(issueScheduleId);
if (issueSchedule.getQtyToIssue().equals(qtyToIssue))
{
return;
}
final PPOrderIssueSchedule issueScheduleChanged = issueSchedule.withQtyToIssue(qtyToIssue);
issueScheduleRepository.saveChanges(issueScheduleChanged);
}
public void delete(@NonNull final PPOrderIssueSchedule issueSchedule)
|
{
if (issueSchedule.isIssued())
{
throw new AdempiereException("Deleting issued schedules is not allowed");
}
issueScheduleRepository.deleteNotProcessedById(issueSchedule.getId());
}
public boolean matchesByOrderId(@NonNull final PPOrderId ppOrderId)
{
return issueScheduleRepository.matchesByOrderId(ppOrderId);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\pporder\api\issue_schedule\PPOrderIssueScheduleService.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public String getPaperFormat() {
return paperFormat;
}
/**
* Sets the value of the paperFormat property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPaperFormat(String value) {
this.paperFormat = value;
}
/**
* Gets the value of the printer property.
*
* @return
* possible object is
* {@link Printer }
*
*/
public Printer getPrinter() {
return printer;
}
/**
* Sets the value of the printer property.
*
* @param value
* allowed object is
* {@link Printer }
*
*/
public void setPrinter(Printer value) {
this.printer = value;
}
/**
|
* Gets the value of the startPosition property.
*
* @return
* possible object is
* {@link StartPosition }
*
*/
public StartPosition getStartPosition() {
return startPosition;
}
/**
* Sets the value of the startPosition property.
*
* @param value
* allowed object is
* {@link StartPosition }
*
*/
public void setStartPosition(StartPosition value) {
this.startPosition = value;
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dpd\src\main\java-xjc\com\dpd\common\service\types\shipmentservice\_3\PrintOptions.java
| 2
|
请完成以下Java代码
|
private Flux<String> getLeakedPasswordsForPrefix(String prefix) {
return this.webClient.get().uri(prefix).retrieve().bodyToMono(String.class).flatMapMany((body) -> {
if (StringUtils.hasText(body)) {
return Flux.fromStream(body.lines());
}
return Flux.empty();
})
.doOnError((ex) -> this.logger.error("Request for leaked passwords failed", ex))
.onErrorResume(WebClientResponseException.class, (ex) -> Flux.empty());
}
/**
* Sets the {@link WebClient} to use when making requests to Have I Been Pwned REST
* API. By default, a {@link WebClient} with a base URL of {@link #API_URL} is used.
* @param webClient the {@link WebClient} to use
*/
public void setWebClient(WebClient webClient) {
Assert.notNull(webClient, "webClient cannot be null");
this.webClient = webClient;
}
|
private Mono<byte[]> getHash(@Nullable String rawPassword) {
return Mono.justOrEmpty(rawPassword)
.map((password) -> this.sha1Digest.digest(password.getBytes(StandardCharsets.UTF_8)))
.subscribeOn(Schedulers.boundedElastic())
.publishOn(Schedulers.parallel());
}
private static MessageDigest getSha1Digest() {
try {
return MessageDigest.getInstance("SHA-1");
}
catch (NoSuchAlgorithmException ex) {
throw new RuntimeException(ex.getMessage());
}
}
}
|
repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\password\HaveIBeenPwnedRestApiReactivePasswordChecker.java
| 1
|
请完成以下Java代码
|
public void setM_ChangeRequest_ID (int M_ChangeRequest_ID)
{
if (M_ChangeRequest_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_ChangeRequest_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_ChangeRequest_ID, Integer.valueOf(M_ChangeRequest_ID));
}
/** Get Change Request.
@return BOM (Engineering) Change Request
*/
public int getM_ChangeRequest_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_ChangeRequest_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_M_ChangeNotice getM_FixChangeNotice() throws RuntimeException
{
return (I_M_ChangeNotice)MTable.get(getCtx(), I_M_ChangeNotice.Table_Name)
.getPO(getM_FixChangeNotice_ID(), get_TrxName()); }
/** Set Fixed in.
@param M_FixChangeNotice_ID
Fixed in Change Notice
*/
public void setM_FixChangeNotice_ID (int M_FixChangeNotice_ID)
{
if (M_FixChangeNotice_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_FixChangeNotice_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_FixChangeNotice_ID, Integer.valueOf(M_FixChangeNotice_ID));
}
/** Get Fixed in.
@return Fixed in Change Notice
*/
public int getM_FixChangeNotice_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_FixChangeNotice_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
public org.eevolution.model.I_PP_Product_BOM getPP_Product_BOM() throws RuntimeException
{
return (org.eevolution.model.I_PP_Product_BOM)MTable.get(getCtx(), org.eevolution.model.I_PP_Product_BOM.Table_Name)
.getPO(getPP_Product_BOM_ID(), get_TrxName()); }
/** Set BOM & Formula.
@param PP_Product_BOM_ID
BOM & Formula
*/
public void setPP_Product_BOM_ID (int PP_Product_BOM_ID)
{
if (PP_Product_BOM_ID < 1)
|
set_ValueNoCheck (COLUMNNAME_PP_Product_BOM_ID, null);
else
set_ValueNoCheck (COLUMNNAME_PP_Product_BOM_ID, Integer.valueOf(PP_Product_BOM_ID));
}
/** Get BOM & Formula.
@return BOM & Formula
*/
public int getPP_Product_BOM_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_PP_Product_BOM_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Processed.
@param Processed
The document has been processed
*/
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Processed.
@return The document has been processed
*/
public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_ChangeRequest.java
| 1
|
请完成以下Java代码
|
private static final class ComposedNamePairPredicate implements INamePairPredicate
{
private final ImmutableSet<INamePairPredicate> predicates;
private ComposedNamePairPredicate(final Set<INamePairPredicate> predicates)
{
// NOTE: we assume the predicates set is: not empty, has more than one element, does not contain nulls
this.predicates = ImmutableSet.copyOf(predicates);
}
@Override
public String toString()
{
return MoreObjects.toStringHelper("composite")
.addValue(predicates)
.toString();
}
@Override
public ImmutableSet<String> getParameters(@Nullable final String contextTableName)
{
return predicates.stream()
.flatMap(predicate -> predicate.getParameters(contextTableName).stream())
.collect(ImmutableSet.toImmutableSet());
}
@Override
public boolean accept(final IValidationContext evalCtx, final NamePair item)
{
for (final INamePairPredicate predicate : predicates)
{
if (predicate.accept(evalCtx, item))
{
return true;
}
}
return false;
}
}
public static class Composer
{
private Set<INamePairPredicate> collectedPredicates = null;
private Composer()
{
super();
}
public INamePairPredicate build()
{
if (collectedPredicates == null || collectedPredicates.isEmpty())
{
return ACCEPT_ALL;
}
else if (collectedPredicates.size() == 1)
{
return collectedPredicates.iterator().next();
}
else
|
{
return new ComposedNamePairPredicate(collectedPredicates);
}
}
public Composer add(@Nullable final INamePairPredicate predicate)
{
if (predicate == null || predicate == ACCEPT_ALL)
{
return this;
}
if (collectedPredicates == null)
{
collectedPredicates = new LinkedHashSet<>();
}
if (collectedPredicates.contains(predicate))
{
return this;
}
collectedPredicates.add(predicate);
return this;
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\validationRule\NamePairPredicates.java
| 1
|
请完成以下Java代码
|
protected String doIt()
{
// Generate material receipts
final List<I_M_ReceiptSchedule> receiptSchedules = getM_ReceiptSchedules();
final Set<HuId> selectedHuIds = retrieveHUsToReceive();
final CreateReceiptsParametersBuilder parametersBuilder = CreateReceiptsParameters.builder()
.commitEachReceiptIndividually(false)
.movementDateRule(ReceiptMovementDateRule.CURRENT_DATE)
.ctx(getCtx())
.destinationLocatorIdOrNull(null) // use receipt schedules' destination-warehouse settings
.printReceiptLabels(true)
.receiptSchedules(receiptSchedules)
.selectedHuIds(selectedHuIds);
customizeParametersBuilder(parametersBuilder);
final CreateReceiptsParameters parameters = parametersBuilder.build();
huReceiptScheduleBL.processReceiptSchedules(parameters);
// NOTE: at this point, the user was already notified about generated material receipts
// Reset the view's affected HUs
getView().invalidateAll();
viewsRepo.notifyRecordsChangedAsync(TableRecordReferenceSet.of(TableRecordReference.ofSet(receiptSchedules)));
return MSG_OK;
}
protected abstract void customizeParametersBuilder(final CreateReceiptsParametersBuilder parametersBuilder);
@Override
protected HUEditorView getView()
{
return getView(HUEditorView.class);
}
protected List<I_M_ReceiptSchedule> getM_ReceiptSchedules()
{
return getView()
.getReferencingDocumentPaths().stream()
.map(referencingDocumentPath -> getReceiptSchedule(referencingDocumentPath))
.collect(GuavaCollectors.toImmutableList());
}
private I_M_ReceiptSchedule getReceiptSchedule(@NonNull final DocumentPath referencingDocumentPath)
{
return documentsCollection
.getTableRecordReference(referencingDocumentPath)
|
.getModel(this, I_M_ReceiptSchedule.class);
}
protected Set<HuId> retrieveHUsToReceive()
{
// https://github.com/metasfresh/metasfresh/issues/1863
// if the queryFilter is empty, then *do not* return everything to avoid an OOME
final IQueryFilter<I_M_HU> processInfoFilter = getProcessInfo().getQueryFilterOrElse(ConstantQueryFilter.of(false));
final IQuery<I_M_HU> query = Services.get(IQueryBL.class)
.createQueryBuilder(I_M_HU.class, this)
.filter(processInfoFilter)
.addOnlyActiveRecordsFilter()
.create();
final Set<HuId> huIds = query
.listIds()
.stream()
.map(HuId::ofRepoId)
.collect(ImmutableSet.toImmutableSet());
if (huIds.isEmpty())
{
throw new AdempiereException("@NoSelection@ @M_HU_ID@")
.appendParametersToMessage()
.setParameter("query", query);
}
return huIds;
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\process\WEBUI_M_HU_CreateReceipt_Base.java
| 1
|
请完成以下Java代码
|
public List<PackageLabels> getPackageLabelsList(@NonNull final DeliveryOrder deliveryOrder) throws ShipperGatewayException
{
final String orderIdAsString = String.valueOf(deliveryOrder.getId());
return deliveryOrder.getDeliveryOrderParcels()
.stream()
.map(line -> createPackageLabel(line.getLabelPdfBase64(), line.getAwb(), orderIdAsString))
.collect(Collectors.toList());
}
@Override
public @NonNull JsonDeliveryAdvisorResponse adviseShipment(final @NonNull JsonDeliveryAdvisorRequest request)
{
return shipAdvisorService.advise(request);
}
@NonNull
private static PackageLabels createPackageLabel(final byte[] labelData, @NonNull final String awb, @NonNull final String deliveryOrderIdAsString)
{
return PackageLabels.builder()
.orderId(OrderId.of(NShiftConstants.SHIPPER_GATEWAY_ID, deliveryOrderIdAsString))
|
.defaultLabelType(NShiftPackageLabelType.DEFAULT)
.label(PackageLabel.builder()
.type(NShiftPackageLabelType.DEFAULT)
.labelData(labelData)
.contentType(PackageLabel.CONTENTTYPE_PDF)
.fileName(awb)
.build())
.build();
}
public JsonShipperConfig getJsonShipperConfig()
{
return jsonConverter.toJsonShipperConfig(shipperConfig);
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.nshift\src\main\java\de\metas\shipper\gateway\nshift\client\NShiftShipperGatewayClient.java
| 1
|
请完成以下Java代码
|
public int getC_UOM_Weight_ID()
{
return get_ValueAsInt(COLUMNNAME_C_UOM_Weight_ID);
}
@Override
public void setDescription(final @Nullable java.lang.String Description)
{
set_Value(COLUMNNAME_Description, Description);
}
@Override
public java.lang.String getDescription()
{
return get_ValueAsString(COLUMNNAME_Description);
}
@Override
public void setHeight(final @Nullable BigDecimal Height)
{
set_Value(COLUMNNAME_Height, Height);
}
@Override
public BigDecimal getHeight()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Height);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setLength(final @Nullable BigDecimal Length)
{
set_Value(COLUMNNAME_Length, Length);
}
@Override
public BigDecimal getLength()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Length);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setMaxVolume(final BigDecimal MaxVolume)
{
set_Value(COLUMNNAME_MaxVolume, MaxVolume);
}
@Override
public BigDecimal getMaxVolume()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_MaxVolume);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setMaxWeight(final BigDecimal MaxWeight)
{
set_Value(COLUMNNAME_MaxWeight, MaxWeight);
}
@Override
public BigDecimal getMaxWeight()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_MaxWeight);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setM_PackagingContainer_ID(final int M_PackagingContainer_ID)
{
if (M_PackagingContainer_ID < 1)
set_ValueNoCheck(COLUMNNAME_M_PackagingContainer_ID, null);
else
set_ValueNoCheck(COLUMNNAME_M_PackagingContainer_ID, M_PackagingContainer_ID);
}
@Override
public int getM_PackagingContainer_ID()
{
return get_ValueAsInt(COLUMNNAME_M_PackagingContainer_ID);
}
@Override
public void setM_Product_ID(final int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value(COLUMNNAME_M_Product_ID, null);
else
set_Value(COLUMNNAME_M_Product_ID, M_Product_ID);
}
@Override
|
public int getM_Product_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Product_ID);
}
@Override
public void setName(final java.lang.String Name)
{
set_Value(COLUMNNAME_Name, Name);
}
@Override
public java.lang.String getName()
{
return get_ValueAsString(COLUMNNAME_Name);
}
@Override
public void setValue(final @Nullable java.lang.String Value)
{
set_Value(COLUMNNAME_Value, Value);
}
@Override
public java.lang.String getValue()
{
return get_ValueAsString(COLUMNNAME_Value);
}
@Override
public void setWidth(final @Nullable BigDecimal Width)
{
set_Value(COLUMNNAME_Width, Width);
}
@Override
public BigDecimal getWidth()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Width);
return bd != null ? bd : BigDecimal.ZERO;
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_PackagingContainer.java
| 1
|
请在Spring Boot框架中完成以下Java代码
|
public class Topic {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String title;
public Topic() {
}
public Topic(String title) {
this.title = title;
}
public Long getId() {
|
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
|
repos\tutorials-master\persistence-modules\spring-data-jdbc\src\main\java\com\baeldung\springmultipledatasources\topics\Topic.java
| 2
|
请完成以下Java代码
|
private CommissionPoints deductTaxAmount(
@NonNull final CommissionPoints commissionPoints,
@NonNull final I_C_Invoice_Candidate icRecord)
{
if (commissionPoints.isZero())
{
return commissionPoints; // don't bother going to the DAO layer
}
final int effectiveTaxRepoId = firstGreaterThanZero(icRecord.getC_Tax_Override_ID(), icRecord.getC_Tax_ID());
if (effectiveTaxRepoId <= 0)
{
logger.debug("Invoice candidate has effective C_Tax_ID={}; -> return undedacted commissionPoints={}", effectiveTaxRepoId, commissionPoints);
return commissionPoints;
}
final Tax taxRecord = taxDAO.getTaxById(effectiveTaxRepoId);
final CurrencyPrecision precision = invoiceCandBL.extractPricePrecision(icRecord);
final BigDecimal taxAdjustedAmount = taxRecord.calculateBaseAmt(
commissionPoints.toBigDecimal(),
icRecord.isTaxIncluded(),
|
precision.toInt());
return CommissionPoints.of(taxAdjustedAmount);
}
@NonNull
private Optional<BPartnerId> getSalesRepId(@NonNull final I_C_Invoice_Candidate icRecord)
{
final BPartnerId invoiceCandidateSalesRepId = BPartnerId.ofRepoIdOrNull(icRecord.getC_BPartner_SalesRep_ID());
if (invoiceCandidateSalesRepId != null)
{
return Optional.of(invoiceCandidateSalesRepId);
}
final I_C_BPartner customerBPartner = bPartnerDAO.getById(icRecord.getBill_BPartner_ID());
if (customerBPartner.isSalesRep())
{
return Optional.of(BPartnerId.ofRepoId(customerBPartner.getC_BPartner_ID()));
}
return Optional.empty();
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\commission\commissioninstance\businesslogic\sales\commissiontrigger\salesinvoicecandidate\SalesInvoiceCandidateFactory.java
| 1
|
请完成以下Java代码
|
public Builder setType(final MenuNodeType type, @Nullable final DocumentId elementId)
{
this.type = type;
this.elementId = elementId;
return this;
}
public Builder setTypeNewRecord(@NonNull final AdWindowId adWindowId)
{
return setType(MenuNodeType.NewRecord, DocumentId.of(adWindowId));
}
public void setTypeGroup()
{
setType(MenuNodeType.Group, null);
}
|
public void addChildToFirstsList(@NonNull final MenuNode child)
{
childrenFirst.add(child);
}
public void addChild(@NonNull final MenuNode child)
{
childrenRest.add(child);
}
public Builder setMainTableName(final String mainTableName)
{
this.mainTableName = mainTableName;
return this;
}
}
}
|
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\menu\MenuNode.java
| 1
|
请完成以下Java代码
|
protected ObjectValue createDeserializedValue(Object deserializedObject, String serializedStringValue,
ValueFields valueFields, boolean asTransientValue) {
String objectTypeName = readObjectNameFromFields(valueFields);
ObjectValueImpl objectValue = new ObjectValueImpl(deserializedObject, serializedStringValue, serializationDataFormat, objectTypeName, true);
objectValue.setTransient(asTransientValue);
return objectValue;
}
protected ObjectValue createSerializedValue(String serializedStringValue, ValueFields valueFields,
boolean asTransientValue) {
String objectTypeName = readObjectNameFromFields(valueFields);
ObjectValueImpl objectValue = new ObjectValueImpl(null, serializedStringValue, serializationDataFormat, objectTypeName, false);
objectValue.setTransient(asTransientValue);
return objectValue;
}
protected String readObjectNameFromFields(ValueFields valueFields) {
return valueFields.getTextValue2();
}
public boolean isMutableValue(ObjectValue typedValue) {
return typedValue.isDeserialized();
}
// methods to be implemented by subclasses ////////////
/**
* Returns the type name for the deserialized object.
*
* @param deserializedObject. Guaranteed not to be null
* @return the type name fot the object.
*/
protected abstract String getTypeNameForDeserialized(Object deserializedObject);
/**
* Implementations must return a byte[] representation of the provided object.
* The object is guaranteed not to be null.
*
* @param deserializedObject the object to serialize
* @return the byte array value of the object
* @throws exception in case the object cannot be serialized
*/
protected abstract byte[] serializeToByteArray(Object deserializedObject) throws Exception;
|
protected Object deserializeFromByteArray(byte[] object, ValueFields valueFields) throws Exception {
String objectTypeName = readObjectNameFromFields(valueFields);
return deserializeFromByteArray(object, objectTypeName);
}
/**
* Deserialize the object from a byte array.
*
* @param object the object to deserialize
* @param objectTypeName the type name of the object to deserialize
* @return the deserialized object
* @throws exception in case the object cannot be deserialized
*/
protected abstract Object deserializeFromByteArray(byte[] object, String objectTypeName) throws Exception;
/**
* Return true if the serialization is text based. Return false otherwise
*
*/
protected abstract boolean isSerializationTextBased();
}
|
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\variable\serializer\AbstractObjectValueSerializer.java
| 1
|
请完成以下Spring Boot application配置
|
server:
port: 9080
servlet:
context-path: /xxl-job-admin
#数据源配置
spring:
datasource:
url: jdbc:mysql://jeecg-boot-mysql:3306/xxl_job?Unicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: ${MYSQL-USER:root}
password: ${MYSQL-PWD:root}
driver-class-name: com.mysql.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
minimum-idle: 10
maximum-pool-size: 30
auto-commit: true
idle-timeout: 30000
pool-name: HikariCP
max-lifetime: 900000
connection-timeout: 10000
connection-test-query: SELECT 1
#邮箱配置
mail:
host: smtphz.qiye.163.com
port: 994
username: zhuwei@aboatedu.com
from: zhuwei@aboatedu.com
password: zwass1314
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
socketFactory:
class: javax.net.ssl.SSLSocketFactory
#MVC配置
mvc:
servlet:
load-on-startup: 0
static-path-pattern: /static/**
resources:
static-locations: classpath:/static/
#freemarker配置
freemarker:
templateLoaderPath=classpath: /templates/
suffix: .ftl
|
charset: UTF-8
request-context-attribute: request
settings:
number_format: 0.##########
#通用配置,开放端点
management:
server:
servlet:
context-path: /actuator
health:
mail:
enabled: false
#mybatis配置
mybatis:
mapper-locations: classpath:/mybatis-mapper/*Mapper.xml
#XXL-job配置
xxl:
job:
login:
username: admin
password: 123456
accessToken:
i18n: zh_CN
#触发池
triggerpool:
fast:
max: 200
slow:
max: 100
logretentiondays: 30
|
repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-xxljob\src\main\resources\application.yml
| 2
|
请在Spring Boot框架中完成以下Java代码
|
public class DmnEngineConfigurator extends AbstractEngineConfigurator<DmnEngine> {
protected DmnEngineConfiguration dmnEngineConfiguration;
@Override
public int getPriority() {
return EngineConfigurationConstants.PRIORITY_ENGINE_DMN;
}
@Override
protected List<EngineDeployer> getCustomDeployers() {
List<EngineDeployer> deployers = new ArrayList<>();
deployers.add(new DmnDeployer());
return deployers;
}
@Override
protected String getMybatisCfgPath() {
return DmnEngineConfiguration.DEFAULT_MYBATIS_MAPPING_FILE;
}
@Override
public void configure(AbstractEngineConfiguration engineConfiguration) {
if (dmnEngineConfiguration == null) {
dmnEngineConfiguration = new StandaloneInMemDmnEngineConfiguration();
}
initialiseCommonProperties(engineConfiguration, dmnEngineConfiguration);
initEngine();
initServiceConfigurations(engineConfiguration, dmnEngineConfiguration);
}
@Override
protected List<Class<? extends Entity>> getEntityInsertionOrder() {
return EntityDependencyOrder.INSERT_ORDER;
|
}
@Override
protected List<Class<? extends Entity>> getEntityDeletionOrder() {
return EntityDependencyOrder.DELETE_ORDER;
}
@Override
protected DmnEngine buildEngine() {
if (dmnEngineConfiguration == null) {
throw new FlowableException("DmnEngineConfiguration is required");
}
return dmnEngineConfiguration.buildDmnEngine();
}
public DmnEngineConfiguration getDmnEngineConfiguration() {
return dmnEngineConfiguration;
}
public DmnEngineConfigurator setDmnEngineConfiguration(DmnEngineConfiguration dmnEngineConfiguration) {
this.dmnEngineConfiguration = dmnEngineConfiguration;
return this;
}
}
|
repos\flowable-engine-main\modules\flowable-dmn-engine-configurator\src\main\java\org\flowable\dmn\engine\configurator\DmnEngineConfigurator.java
| 2
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.