instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | private void updateUserFromContactPerson(final I_MKTG_ContactPerson contactPersonRecord)
{
final I_MKTG_ContactPerson oldContactPersonRecord = InterfaceWrapperHelper.createOld(contactPersonRecord, I_MKTG_ContactPerson.class);
final String oldContactPersonMail = oldContactPersonRecord.getEMail();
final Language o... | public void collectChangedContact(final ContactPerson contact)
{
if (contacts == null)
{
throw new AdempiereException("collector already committed");
}
contacts.put(contact.getContactPersonId(), contact);
}
public void commit()
{
if (contacts == null)
{
return;
}
final Immutab... | repos\metasfresh-new_dawn_uat\backend\de.metas.marketing\base\src\main\java\de\metas\marketing\base\interceptor\MKTG_ContactPerson.java | 1 |
请完成以下Java代码 | public int getOrg_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Org_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_PA_Goal getPA_Goal() throws RuntimeException
{
return (I_PA_Goal)MTable.get(getCtx(), I_PA_Goal.Table_Name)
.getPO(getPA_Goal_ID(), get_TrxName()); }
/** Set... | if (ii == null)
return 0;
return ii.intValue();
}
/** Set Goal Restriction.
@param PA_GoalRestriction_ID
Performance Goal Restriction
*/
public void setPA_GoalRestriction_ID (int PA_GoalRestriction_ID)
{
if (PA_GoalRestriction_ID < 1)
set_ValueNoCheck (COLUMNNAME_PA_GoalRestriction_ID, null);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_GoalRestriction.java | 1 |
请完成以下Java代码 | public class SetPropertyCmd implements Command<Object> {
protected String name;
protected String value;
public SetPropertyCmd(String name, String value) {
this.name = name;
this.value = value;
}
public Object execute(CommandContext commandContext) {
commandContext.getAuthorizationManager().chec... | property.setValue(value);
operation = UserOperationLogEntry.OPERATION_TYPE_UPDATE;
} else {
// create
property = new PropertyEntity(name, value);
propertyManager.insert(property);
operation = UserOperationLogEntry.OPERATION_TYPE_CREATE;
}
commandContext.getOperationLogManager(... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\SetPropertyCmd.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setChannel(int value) {
this.channel = value;
}
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of t... | }
/**
* Sets the value of the rule property.
*
*/
public void setRule(int value) {
this.rule = value;
}
/**
* Gets the value of the language property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getL... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dpd\src\main\java-xjc\com\dpd\common\service\types\shipmentservice\_3\ProactiveNotification.java | 2 |
请完成以下Java代码 | public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(final String createdBy) {
this.createdBy = createdBy;
}
public String getModifiedBy() {
return modifiedBy;
}
public void setModifiedBy(final String modifiedBy) {
this.modifiedBy = modif... | @PreRemove
public void onPreRemove() {
logger.info("@PreRemove");
audit(OPERATION.DELETE);
}
private void audit(final OPERATION operation) {
setOperation(operation);
setTimestamp((new Date()).getTime());
}
public enum OPERATION {
INSERT, UPDATE, DELETE;
... | repos\tutorials-master\persistence-modules\spring-data-jpa-enterprise\src\main\java\com\baeldung\boot\domain\Bar.java | 1 |
请完成以下Java代码 | final class RSocketGraphQlTransport implements GraphQlTransport {
private static final ParameterizedTypeReference<Map<String, Object>> MAP_TYPE =
new ParameterizedTypeReference<Map<String, Object>>() { };
private static final ResolvableType LIST_TYPE = ResolvableType.forClass(List.class);
private final String... | return this.rsocketRequester.route(this.route).data(request.toMap())
.retrieveFlux(MAP_TYPE)
.onErrorResume(RejectedException.class, (ex) -> Flux.error(decodeErrors(request, ex)))
.map(ResponseMapGraphQlResponse::new);
}
@SuppressWarnings("unchecked")
private Exception decodeErrors(GraphQlRequest reques... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\client\RSocketGraphQlTransport.java | 1 |
请完成以下Java代码 | public static void main(String[] args) {
Dataset<Row> dataFrame = convertAfterMappingRows(CUSTOMERS);
print(dataFrame);
Dataset<Row> customerDF = convertToDataFrameWithNoChange();
print(customerDF);
}
public static Dataset<Row> convertToDataFrameWithNoChange() {
return Sp... | return SparkDriver.getSparkSession()
.createDataFrame(rows, SchemaFactory.minimumCustomerDataSchema());
}
private static Customer aCustomerWith(String id, String name, String gender, int amount) {
return new Customer(id, name, gender, amount);
}
private static void print(Dataset<Ro... | repos\tutorials-master\apache-spark\src\main\java\com\baeldung\dataframes\CustomerToDataFrameConverterApp.java | 1 |
请完成以下Java代码 | public ExternalSystem getById(@NonNull final ExternalSystemId id)
{
return getMap().getById(id);
}
private static ExternalSystem fromRecord(@NonNull final I_ExternalSystem externalSystemRecord)
{
return ExternalSystem.builder()
.id(ExternalSystemId.ofRepoId(externalSystemRecord.getExternalSystem_ID()))
... | record.setValue(request.getType().getValue());
InterfaceWrapperHelper.save(record);
return fromRecord(record);
}
@Nullable
public ExternalSystem getByLegacyCodeOrValueOrNull(@NonNull final String value)
{
final ExternalSystemMap map = getMap();
return CoalesceUtil.coalesceSuppliers(
() -> map.getByType... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\externalsystem\ExternalSystemRepository.java | 1 |
请完成以下Java代码 | public class MilestoneInstanceEntityImpl extends AbstractCmmnEngineEntity implements MilestoneInstanceEntity {
protected String name;
protected Date timeStamp;
protected String caseInstanceId;
protected String caseDefinitionId;
protected String elementId;
protected String tenantId;
... | return caseDefinitionId;
}
@Override
public void setCaseDefinitionId(String caseDefinitionId) {
this.caseDefinitionId = caseDefinitionId;
}
@Override
public String getElementId() {
return elementId;
}
@Override
public void setElementId(String elementId) {
this... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\persistence\entity\MilestoneInstanceEntityImpl.java | 1 |
请完成以下Java代码 | public void setSerialNo_Sequence(final org.compiere.model.I_AD_Sequence SerialNo_Sequence)
{
set_ValueFromPO(COLUMNNAME_SerialNo_Sequence_ID, org.compiere.model.I_AD_Sequence.class, SerialNo_Sequence);
}
@Override
public void setSerialNo_Sequence_ID (final int SerialNo_Sequence_ID)
{
if (SerialNo_Sequence_ID ... | @Override
public void setValidTo (final @Nullable java.sql.Timestamp ValidTo)
{
set_Value (COLUMNNAME_ValidTo, ValidTo);
}
@Override
public java.sql.Timestamp getValidTo()
{
return get_ValueAsTimestamp(COLUMNNAME_ValidTo);
}
@Override
public void setValue (final java.lang.String Value)
{
set_Value (C... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Order_BOM.java | 1 |
请完成以下Java代码 | public class DBRes_th extends ListResourceBundle
{
/** Data */
static final Object[][] contents = new String[][]{
{ "CConnectionDialog", "Connection" },
{ "Name", "\u0e0a\u0e37\u0e48\u0e2d" },
{ "AppsHost", "\u0e41\u0e2d\u0e47\u0e1e\u0e1e\u0e25\u0e34\u0e40\u0e04\u0e0a\u0e31\u0e48\u0... | { "TerminalServer", "Terminal Server" },
{ "VPN", "VPN" },
{ "WAN", "WAN" },
{ "ConnectionError", "\u0e01\u0e32\u0e23\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14" },
{ "ServerNotActive", "\u0e40\u0e0a\u0e34\u0e23\u0e4c\u0e1f\u0e40\u0e27\u0e2d\u0e23\... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\db\connectiondialog\i18n\DBRes_th.java | 1 |
请完成以下Java代码 | public class PalindromeResource {
private final MeterRegistry registry;
private final LinkedList<String> list = new LinkedList<>();
public PalindromeResource(MeterRegistry registry) {
this.registry = registry;
registry.gaugeCollectionSize("palindrome.list.size", Tags.empty(), list);
}... | right--;
}
return true;
}
@DELETE
@Path("empty-list")
public void emptyList() {
list.clear();
}
@GET
@Path("/clearmetrics")
public Response clearAllPollerMetrics() {
registry.clear();
list.clear();
registry.gaugeCollectionSize("palindrome... | repos\tutorials-master\quarkus-modules\quarkus\src\main\java\com\baeldung\quarkus\micrometer\PalindromeResource.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static class WebSocketConfiguration {
@Bean
@ConditionalOnMissingBean
GraphQlWebSocketHandler graphQlWebSocketHandler(WebGraphQlHandler webGraphQlHandler,
GraphQlProperties properties, ServerCodecConfigurer configurer) {
return new GraphQlWebSocketHandler(webGraphQlHandler, configurer,
properties.get... | mapping.setOrder(-2); // Ahead of HTTP endpoint ("routerFunctionMapping" bean)
return mapping;
}
}
static class GraphiQlResourceHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
hints.resources().registerPattern("graphi... | repos\spring-boot-4.0.1\module\spring-boot-graphql\src\main\java\org\springframework\boot\graphql\autoconfigure\reactive\GraphQlWebFluxAutoConfiguration.java | 2 |
请完成以下Java代码 | public boolean isTaxBoilerPlateMatch()
{
return get_ValueAsBoolean(COLUMNNAME_IsTaxBoilerPlateMatch);
}
@Override
public void setIsTaxIdMatch (final boolean IsTaxIdMatch)
{
set_Value (COLUMNNAME_IsTaxIdMatch, IsTaxIdMatch);
}
@Override
public boolean isTaxIdMatch()
{
return get_ValueAsBoolean(COLUMNN... | set_Value (COLUMNNAME_Run_Tax_ID, null);
else
set_Value (COLUMNNAME_Run_Tax_ID, Run_Tax_ID);
}
@Override
public int getRun_Tax_ID()
{
return get_ValueAsInt(COLUMNNAME_Run_Tax_ID);
}
@Override
public void setRun_Tax_Lookup_Log (final @Nullable java.lang.String Run_Tax_Lookup_Log)
{
set_Value (COLUMN... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Invoice_Verification_RunLine.java | 1 |
请完成以下Java代码 | public static DocumentFilterDescriptor createPickingSlotBarcodeFilters()
{
return DocumentFilterDescriptor.builder()
.setFilterId(PickingSlotBarcodeFilter_FilterId)
.setFrequentUsed(true)
.setParametersLayoutType(PanelLayoutType.SingleOverlayField)
.addParameter(DocumentFilterParamDescriptor.builder(... | // Try parsing the Global QR Code, if possible
final GlobalQRCode globalQRCode = GlobalQRCode.parse(barcodeString).orNullIfError();
//
// Case: valid Global QR Code
if (globalQRCode != null)
{
return PickingSlotQRCode.ofGlobalQRCode(globalQRCode);
}
//
// Case: Legacy barcode support
else
{
f... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\pickingslot\PickingSlotViewFilters.java | 1 |
请完成以下Java代码 | class TaskRepresentation {
private String id;
private String name;
private String processInstanceId;
public TaskRepresentation() {
super();
}
public TaskRepresentation(String id, String name, String processInstanceId) {
this.id = id;
this.name = name;
this.proc... | }
public void setName(String name) {
this.name = name;
}
public String getProcessInstanceId() {
return processInstanceId;
}
public void setProcessInstanceId(String processInstanceId) {
this.processInstanceId = processInstanceId;
}
} | repos\tutorials-master\spring-activiti\src\main\java\com\baeldung\activitiwithspring\TaskRepresentation.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class TemplateLocation {
private final String path;
public TemplateLocation(String path) {
Assert.notNull(path, "'path' must not be null");
this.path = path;
}
/**
* Determine if this template location exists using the specified
* {@link ResourcePatternResolver}.
* @param resolver the resolver u... | + searchPath.substring(ResourceLoader.CLASSPATH_URL_PREFIX.length());
}
if (searchPath.startsWith(ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX)) {
Resource[] resources = resolver.getResources(searchPath);
for (Resource resource : resources) {
if (resource.exists()) {
return true;
}
}
}
... | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\template\TemplateLocation.java | 2 |
请完成以下Java代码 | public static ObjectNode getLocalizationElementProperties(String language, String id, String processDefinitionId, boolean useFallback) {
ObjectNode definitionInfoNode = getProcessDefinitionInfoNode(processDefinitionId);
ObjectNode localizationProperties = null;
if (definitionInfoNode != null) {
... | }
return getBpmnOverrideContext().get(processDefinitionId);
}
protected static Map<String, ObjectNode> getBpmnOverrideContext() {
Map<String, ObjectNode> bpmnOverrideMap = bpmnOverrideContextThreadLocal.get();
if (bpmnOverrideMap == null) {
bpmnOverrideMap = new HashMap<>()... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\context\BpmnOverrideContext.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_AD_Process getAD_Process_CustomQuery()
{
return get_ValueAsPO(COLUMNNAME_AD_Process_CustomQuery_ID, org.compiere.model.I_AD_Process.class);
}
@Override
public void setAD_Process_CustomQuery(final org.compiere.model.I_AD_Process AD_Process_CustomQuery)
{
set_ValueFromPO(COLUMNNAME_A... | {
set_Value (COLUMNNAME_IsAdditionalCustomQuery, IsAdditionalCustomQuery);
}
@Override
public boolean isAdditionalCustomQuery()
{
return get_ValueAsBoolean(COLUMNNAME_IsAdditionalCustomQuery);
}
@Override
public void setLeichMehl_PluFile_ConfigGroup_ID (final int LeichMehl_PluFile_ConfigGroup_ID)
{
if ... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_LeichMehl_PluFile_ConfigGroup.java | 1 |
请完成以下Java代码 | public void setAD_Table_ID (final int AD_Table_ID)
{
if (AD_Table_ID < 1)
set_Value (COLUMNNAME_AD_Table_ID, null);
else
set_Value (COLUMNNAME_AD_Table_ID, AD_Table_ID);
}
@Override
public int getAD_Table_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_Table_ID);
}
@Override
public void setAD_User_I... | @Override
public void setRecord_ID (final int Record_ID)
{
if (Record_ID < 0)
set_ValueNoCheck (COLUMNNAME_Record_ID, null);
else
set_ValueNoCheck (COLUMNNAME_Record_ID, Record_ID);
}
@Override
public int getRecord_ID()
{
return get_ValueAsInt(COLUMNNAME_Record_ID);
}
@Override
public void set... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_PInstance.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public abstract class TbAbstractVersionControlSettingsService<T extends Serializable> {
private final String settingsKey;
private final AdminSettingsService adminSettingsService;
private final TbTransactionalCache<TenantId, T> cache;
private final Class<T> clazz;
public TbAbstractVersionControlSet... | adminSettings = new AdminSettings();
adminSettings.setKey(settingsKey);
adminSettings.setTenantId(tenantId);
}
adminSettings.setJsonValue(JacksonUtil.valueToTree(settings));
AdminSettings savedAdminSettings = adminSettingsService.saveAdminSettings(tenantId, adminSettings)... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\sync\vc\TbAbstractVersionControlSettingsService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public SecurityFilterChain restApiSecurity(HttpSecurity http, AuthenticationProvider authenticationProvider) throws Exception {
HttpSecurity httpSecurity = http.authenticationProvider(authenticationProvider)
.sessionManagement(sessionManagement -> sessionManagement.sessionCreationPolicy(SessionC... | } else {
httpSecurity
.authorizeHttpRequests(authorizeRequests -> authorizeRequests.anyRequest().authenticated());
}
httpSecurity.httpBasic(Customizer.withDefaults());
return http.build();
}
protected boolean isVerifyRestApiPrivilege() {
String auth... | repos\flowable-engine-main\modules\flowable-app-rest\src\main\java\org\flowable\rest\conf\SecurityConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | static final class DecodingConfigurer {
private static final Base64Checker BASE_64_CHECKER = new Base64Checker();
private final String encoded;
private boolean inflate;
private boolean requireBase64;
private DecodingConfigurer(String encoded) {
this.encoded = encoded;
}
DecodingConfigurer inflate... | }
}
// in cases of an incomplete final chunk, ensure the unused bits are zero
switch (goodChars % 4) {
case 0:
return true;
case 2:
return (lastGoodCharVal & 0b1111) == 0;
case 3:
return (lastGoodCharVal & 0b11) == 0;
default:
return false;
}
}
void ch... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\internal\Saml2Utils.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class RestFormProperty {
protected String id;
protected String name;
protected String type;
protected String value;
protected boolean readable;
protected boolean writable;
protected boolean required;
protected String datePattern;
protected List<RestEnumFormProperty> enumValue... | public void setReadable(boolean readable) {
this.readable = readable;
}
public boolean isWritable() {
return writable;
}
public void setWritable(boolean writable) {
this.writable = writable;
}
public boolean isRequired() {
return required;
}
public voi... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\form\RestFormProperty.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void customize(CodecConfigurer configurer) {
PropertyMapper map = PropertyMapper.get();
CodecConfigurer.DefaultCodecs defaultCodecs = configurer.defaultCodecs();
defaultCodecs.enableLoggingRequestDetails(this.logRequestDetails);
map.from(this.maxInMemorySize).asInt(DataSize::toBytes).to(defaultCo... | super(ConfigurationPhase.PARSE_CONFIGURATION);
}
@ConditionalOnMissingClass("tools.jackson.databind.json.JsonMapper")
static class NoJackson {
}
@ConditionalOnProperty(name = "spring.http.codecs.preferred-json-mapper", havingValue = "jackson2")
static class Jackson2Preferred {
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-http-codec\src\main\java\org\springframework\boot\http\codec\autoconfigure\CodecsAutoConfiguration.java | 2 |
请完成以下Java代码 | public String getRePassword() {
return rePassword;
}
public void setRePassword(String rePassword) {
this.rePassword = rePassword;
}
public String getHistoryPassword() {
return historyPassword;
}
public void setHistoryPassword(String historyPassword) {
this.hist... | public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
@Override
public String toString() {
return "User{" +
"id=" + id +
", cnname=" + cnname +
", username=" + username +
", password=" + password +
", e... | repos\springBoot-master\springboot-springSecurity4\src\main\java\com\yy\example\bean\User.java | 1 |
请完成以下Java代码 | 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() {
retu... | }
public String getResourceName() {
return resourceName;
}
public String getResourceNameLike() {
return resourceNameLike;
}
public String getCategoryNotEquals() {
return categoryNotEquals;
}
public String getTenantId() {
return tenantId;
}
public ... | repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\EventDefinitionQueryImpl.java | 1 |
请完成以下Java代码 | public BigDecimal getQtyReserved()
{
return qtyReserved;
}
public String getASIDescription()
{
return asiDescription;
}
public int getASIId()
{
return asiId;
}
public String getPartnerName()
{ | return partnerName;
}
public String getDocBaseType()
{
return docBaseType;
}
public String getDocumentNo()
{
return documentNo;
}
public String getWarehouseName()
{
return warehouseName;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\apps\search\dao\impl\OrderLineHistoryVO.java | 1 |
请完成以下Java代码 | public class Employee {
private int empNo;
private String ename;
private String job;
private int mgr;
private Date hiredate;
private int sal;
private int comm;
private int deptno;
public int getEmpNo() {
return empNo;
}
public void setEmpNo(int empNo) {
thi... | }
public void setSal(int sal) {
this.sal = sal;
}
public int getComm() {
return comm;
}
public void setComm(int comm) {
this.comm = comm;
}
public int getDeptno() {
return deptno;
}
public void setDeptno(int deptno) {
this.deptno = deptno;... | repos\tutorials-master\libraries-data-db-2\src\main\java\com\baeldung\libraries\flexypool\Employee.java | 1 |
请完成以下Java代码 | protected void postProcess(final boolean success)
{
// Invalidate the view because for sure we have changes
final PPOrderLinesView ppOrderLinesView = getView();
ppOrderLinesView.invalidateAll();
getViewsRepo().notifyRecordsChangedAsync(I_PP_Order.Table_Name, ppOrderLinesView.getPpOrderId().getRepoId());
}
... | private IPPOrderReceiptHUProducer newReceiptCandidatesProducer()
{
final PPOrderLineRow row = getSingleSelectedRow();
final PPOrderLineType type = row.getType();
if (type == PPOrderLineType.MainProduct)
{
final PPOrderId ppOrderId = row.getOrderId();
return huPPOrderBL.receivingMainProduct(ppOrderId);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pporder\process\WEBUI_PP_Order_Receipt.java | 1 |
请完成以下Spring Boot application配置 | ## 开启 H2 数据库
spring.h2.console.enabled=true
## 配置 H2 数据库连接信息
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
## 是否显示 SQL 语句
sp | ring.jpa.show-sql=true
hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.hbm2ddl.auto=create | repos\springboot-learning-example-master\chapter-4-spring-boot-validating-form-input\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public java.lang.String getSourceMethodName()
{
return get_ValueAsString(COLUMNNAME_SourceMethodName);
}
@Override
public void setStackTrace (final @Nullable java.lang.String StackTrace)
{
set_Value (COLUMNNAME_StackTrace, StackTrace);
}
@Override
public java.lang.String getStackTrace()
{
return get_... | public void setUserAgent (final @Nullable java.lang.String UserAgent)
{
set_Value (COLUMNNAME_UserAgent, UserAgent);
}
@Override
public java.lang.String getUserAgent()
{
return get_ValueAsString(COLUMNNAME_UserAgent);
}
@Override
public void setUserName (final java.lang.String UserName)
{
set_ValueNoCh... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Issue.java | 1 |
请完成以下Java代码 | public void forceUpdate() {
this.forcedUpdate = true;
}
public Object getPersistentState() {
Map<String, Object> persistentState = new HashMap<String, Object>();
persistentState.put("satisfied", isSatisfied());
if (forcedUpdate) {
persistentState.put("forcedUpdate", Boolean.TRUE);
}
... | public Set<String> getReferencedEntityIds() {
Set<String> referencedEntityIds = new HashSet<String>();
return referencedEntityIds;
}
@Override
public Map<String, Class> getReferencedEntitiesIdAndClass() {
Map<String, Class> referenceIdAndClass = new HashMap<String, Class>();
if (caseExecutionId ... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\entity\runtime\CaseSentryPartEntity.java | 1 |
请完成以下Java代码 | public PageData<WidgetTypeId> findIdsByTenantId(UUID tenantId, PageLink pageLink) {
return DaoUtil.pageToPageData(widgetTypeRepository.findIdsByTenantId(tenantId, DaoUtil.toPageable(pageLink))
.map(WidgetTypeId::new));
}
@Override
public WidgetTypeId getExternalIdByInternal(WidgetTy... | @Override
public PageData<WidgetTypeDetails> findAllByTenantId(TenantId tenantId, PageLink pageLink) {
return findByTenantId(tenantId.getId(), pageLink);
}
@Override
public List<WidgetTypeFields> findNextBatch(UUID id, int batchSize) {
return widgetTypeRepository.findNextBatch(id, Limit... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\widget\JpaWidgetTypeDao.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List<Car> getAllCars() {
log.debug("REST request to get all Cars");
return carRepository.findAll();
}
/**
* {@code GET /cars/:id} : get the "id" car.
*
* @param id the id of the car to retrieve.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and wi... | }
/**
* {@code DELETE /cars/:id} : delete the "id" car.
*
* @param id the id of the car to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/{id}")
public ResponseEntity<Void> deleteCar(@PathVariable("id") Long id) {
log... | repos\tutorials-master\jhipster-8-modules\jhipster-8-microservice\car-app\src\main\java\com\cars\app\web\rest\CarResource.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public KieSession getKieSessionByName(String ruleKey) {
StatefulKnowledgeSession kSession = null;
try {
long startTime = System.currentTimeMillis();
// TODO 可以缓存到本地,不用每次都去查数据库
Rule rule = ruleMapper.findByRuleKey(ruleKey);
KnowledgeBuilder kb = KnowledgeB... | KieFileSystem kfs = ks.newKieFileSystem();
for (Rule rule : rules) {
String drl = rule.getContent();
kfs.write("src/main/resources/" + drl.hashCode() + ".drl", drl);
}
KieBuilder kb = ks.newKieBuilder(kfs);
kb.buildAll();
if (kb.getResults().hasMessages(... | repos\spring-boot-student-master\spring-boot-student-drools\src\main\java\com\xiaolyuh\service\impl\RuleServiceImpl.java | 2 |
请完成以下Java代码 | public int getLockTimeAsyncJobWaitTime() {
return lockTimeAsyncJobWaitTime;
}
public ProcessEngineConfiguration setLockTimeAsyncJobWaitTime(int lockTimeAsyncJobWaitTime) {
this.lockTimeAsyncJobWaitTime = lockTimeAsyncJobWaitTime;
return this;
}
public int getDefaultFailedJobWai... | public ProcessEngineConfiguration setCopyVariablesToLocalForTasks(boolean copyVariablesToLocalForTasks) {
this.copyVariablesToLocalForTasks = copyVariablesToLocalForTasks;
return this;
}
public boolean isCopyVariablesToLocalForTasks() {
return copyVariablesToLocalForTasks;
}
pu... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\ProcessEngineConfiguration.java | 1 |
请完成以下Java代码 | public final ArrayKey getKey(final IHUItemStorage node)
{
return Util.mkKey(IHUItemStorage.class, node.getM_HU_Item().getM_HU_Item_ID());
}
@Override
public final void setCurrentNode(final IHUItemStorage node)
{
currentHUItemStorage = node;
}
@Override
public final Result beforeIterate(final IMu... | @Override
public List<Object> retrieveDownstreamNodes(final IHUItemStorage node)
{
throw new IllegalStateException("Shall not be called because we don't have a downstream node iterator");
}
}
@Override
public void setDepthMax(final int depthMax)
{
this.depthMax = depthMax;
}
@Override
public int get... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\AbstractHUIterator.java | 1 |
请完成以下Java代码 | public boolean isQuarantineHU(final I_M_HU huRecord)
{
// retrieve the attribute
final AttributeId quarantineAttributeId = attributeDAO.getAttributeIdByCode(HUAttributeConstants.ATTR_Quarantine);
final I_M_HU_Attribute huAttribute = huAttributesDAO.retrieveAttribute(huRecord, quarantineAttributeId);
if (huAt... | final AttributeId quarantineAttributeId = attributeDAO.getAttributeIdByCode(HUAttributeConstants.ATTR_Quarantine);
final I_M_HU_Attribute huAttribute = huAttributesDAO.retrieveAttribute(huRecord, quarantineAttributeId);
if (huAttribute == null)
{
// nothing to do. The HU doesn't have the attribute
return;... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\quarantine\HULotNumberQuarantineService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static Map<String, Map<String, Object>> toMap() {
FundInfoTypeEnum[] ary = FundInfoTypeEnum.values();
Map<String, Map<String, Object>> enumMap = new HashMap<String, Ma... | public static FundInfoTypeEnum getEnum(String name) {
FundInfoTypeEnum[] arry = FundInfoTypeEnum.values();
for (int i = 0; i < arry.length; i++) {
if (arry[i].name().equalsIgnoreCase(name)) {
return arry[i];
}
}
return null;
}
/**
* 取... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\user\enums\FundInfoTypeEnum.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class UserFacade {
private final CredentialsService credentialsService;
private final UserRepository userRepository;
private final UserUpdater userUpdater;
public Mono<ProfileView> getProfile(String profileUsername, User viewer) {
return userRepository.findByUsernameOrFail(profileUserna... | follower.follow(userToFollow);
return userRepository.save(follower).thenReturn(userToFollow);
})
.map(ProfileView::toFollowedProfileView);
}
public Mono<ProfileView> unfollow(String username, User follower) {
return userRepository.findByUsernameOrFail... | repos\realworld-spring-webflux-master\src\main\java\com\realworld\springmongo\user\UserFacade.java | 2 |
请完成以下Java代码 | public Message<?> preSend(Message<?> message, MessageChannel channel) {
System.out.println("----------------------------preSend------------------------------");
return message;
}
@Override
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
}
@Override... | @Override
public boolean preReceive(MessageChannel channel) {
return true;
}
@Override
public Message<?> postReceive(Message<?> message, MessageChannel channel) {
System.out.println("----------------------------postReceive------------------------------");
return message;
}
... | repos\springboot-demo-master\sftp\src\main\java\com\et\sftp\Interceptor\MyChannelInterceptor.java | 1 |
请完成以下Java代码 | public I_M_InOut getM_InOut()
{
return get_ValueAsPO(COLUMNNAME_M_InOut_ID, I_M_InOut.class);
}
@Override
public void setM_InOut(final I_M_InOut M_InOut)
{
set_ValueFromPO(COLUMNNAME_M_InOut_ID, I_M_InOut.class, M_InOut);
}
@Override
public void setM_InOut_ID (final int M_InOut_ID)
{
if (M_InOut_ID < 1... | @Override
public int getM_InOutLine_ID()
{
return get_ValueAsInt(COLUMNNAME_M_InOutLine_ID);
}
@Override
public void setQty (final BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
@Override
public BigDecimal getQty()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty);
return bd != n... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_InOut_Cost.java | 1 |
请完成以下Java代码 | public class MViewMetadata
{
private String sql;
private String targetTableName;
private Set<String> targetKeyColumns;
private Map<MultiKey, String> relations = new HashMap<MultiKey, String>();
private Map<String, Set<String>> sourceTables = new HashMap<String, Set<String>>();
public String getTargetTableName()... | {
return sourceTables.keySet();
}
public Set<String> getSourceColumns(String sourceTableName)
{
return sourceTables.get(sourceTableName);
}
public void addRelation(String sourceTableName, String targetTableName, String whereClause)
{
final MultiKey key = new MultiKey(sourceTableName, targetTableName);
r... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\engine\MViewMetadata.java | 1 |
请完成以下Java代码 | public CustomsInvoiceUserNotificationsProducer notifyGenerated(final Collection<CustomsInvoice> customInvoices)
{
if (customInvoices == null || customInvoices.isEmpty())
{
return this;
}
postNotifications(customInvoices.stream()
.map(this::createUserNotification)
.collect(ImmutableList.toImmutableL... | return UserNotificationRequest.builder()
.topic(EVENTBUS_TOPIC);
}
private final UserId getNotificationRecipientUserId(final CustomsInvoice customsInvoice)
{
//
// In case of reversal i think we shall notify the current user too
if (customsInvoice.getDocStatus().isReversedOrVoided())
{
return customs... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\customs\event\CustomsInvoiceUserNotificationsProducer.java | 1 |
请完成以下Java代码 | private void invoiceLine (MRequest request)
{
MRequestUpdate[] updates = request.getUpdates(null);
for (int i = 0; i < updates.length; i++)
{
BigDecimal qty = updates[i].getQtyInvoiced();
if (qty == null || qty.signum() == 0)
continue;
// if (updates[i].getC_InvoiceLine_ID() > 0)
// continue;
... | il.setQty(qty);
// Product
int M_Product_ID = updates[i].getM_ProductSpent_ID();
if (M_Product_ID == 0)
M_Product_ID = p_M_Product_ID;
il.setM_Product_ID(M_Product_ID);
//
il.setPrice();
il.save();
// updates[i].setC_InvoiceLine_ID(il.getC_InvoiceLine_ID());
// updates[i].save();
}
} /... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\process\RequestInvoice.java | 1 |
请完成以下Java代码 | public static CostAmountAndQtyDetailed zero(@NonNull final CurrencyId currencyId, @NonNull final UomId uomId)
{
final CostAmountAndQty zero = CostAmountAndQty.zero(currencyId, uomId);
return new CostAmountAndQtyDetailed(zero, zero, zero);
}
public CostAmountAndQtyDetailed add(@NonNull final CostAmountAndQtyDeta... | public CostAmountAndQty getAmtAndQty(final CostAmountType type)
{
final CostAmountAndQty costAmountAndQty;
switch (type)
{
case MAIN:
costAmountAndQty = main;
break;
case ADJUSTMENT:
costAmountAndQty = costAdjustment;
break;
case ALREADY_SHIPPED:
costAmountAndQty = alreadyShipped;
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\methods\CostAmountAndQtyDetailed.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_AD_Field getAD_Field() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_AD_Field_ID, org.compiere.model.I_AD_Field.class);
}
@Override
public void setAD_Field(org.compiere.model.I_AD_Field AD_Field)
{
set_ValueFromPO(COLUMNNAME_AD_Field_ID, org.compiere.model.I_AD_Field.cl... | }
/** Get Register.
@return Register auf einem Fenster
*/
@Override
public int getAD_Tab_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Tab_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public org.compiere.model.I_AD_Window getAD_Window() throws RuntimeException
{
r... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Element_Link.java | 1 |
请完成以下Java代码 | 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)
{
... | }
/** Set Search Key.
@param Value
Search key for the record in the format required - must be unique
*/
public void setValue (String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
/** Get Search Key.
@return Search key for the record in the format required - must be unique
*/
public String getVa... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_SalesRegion.java | 1 |
请完成以下Java代码 | public class C_Invoice extends MaterialTrackableDocumentByASIInterceptor<I_C_Invoice, I_C_InvoiceLine>
{
/**
* Returns {@code false} if the given invoice is a sales document or a reversal.
* <p>
* Note: Reversals are not eligible, because their original-invoice counterpart is also unlinked.
* <p>
* When cha... | return false;
}
@Override
protected List<I_C_InvoiceLine> retrieveDocumentLines(final I_C_Invoice document)
{
final List<I_C_InvoiceLine> documentLines = Services.get(IInvoiceDAO.class).retrieveLines(document);
return documentLines;
}
/**
* Gets order line's ASI (where the material tracking is set)
*/
... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\model\validator\C_Invoice.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Writer getWriter2() {
return new Writer("Writer 2");
}
public static void main(String[] args) {
ApplicationContext ctx = SpringApplication.run(Application.class, args);
System.out.println("Application context initialized!!!");
Writer writer1 = ctx.getBean("writer1", Wr... | private static ApplicationContext runUsingSpringApplicationBuilder(String[] args){
return new SpringApplicationBuilder(Application.class)
.lazyInitialization(true)
.build(args)
.run();
}
/*
This method shows how to set lazy initialization and start th... | repos\tutorials-master\spring-boot-modules\spring-boot-performance\src\main\java\com\baeldung\lazyinitialization\Application.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private RequestCache getRequestCache(H http) {
RequestCache result = http.getSharedObject(RequestCache.class);
if (result != null) {
return result;
}
result = getBeanOrNull(RequestCache.class);
if (result != null) {
return result;
}
HttpSessionRequestCache defaultCache = new HttpSessionRequestCache(... | matchers.add(notXRequestedWith);
matchers.add(notMatchingMediaType(http, MediaType.MULTIPART_FORM_DATA));
matchers.add(notMatchingMediaType(http, MediaType.TEXT_EVENT_STREAM));
matchers.add(notWebSocket);
return new AndRequestMatcher(matchers);
}
private RequestMatcher notMatchingMediaType(H http, MediaType ... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\RequestCacheConfigurer.java | 2 |
请完成以下Java代码 | public String allFallback() {
return "Fallback for All Requests";
}
@RequestMapping(value = "/foos/multiple", method = { RequestMethod.PUT, RequestMethod.POST })
@ResponseBody
public String putAndPostFoos() {
return "Advanced - PUT and POST within single method";
}
// --- Ambi... | // @GetMapping(value = "foos/duplicate" )
// public String duplicateEx() {
// return "Duplicate";
// }
@GetMapping(value = "foos/duplicate", produces = MediaType.APPLICATION_XML_VALUE)
public ResponseEntity<String> duplicateXml() {
return new ResponseEntity<>("<message>Duplicate</messag... | repos\tutorials-master\spring-web-modules\spring-rest-http\src\main\java\com\baeldung\requestmapping\FooMappingExamplesController.java | 1 |
请完成以下Java代码 | private static final class UrlHandlerMappingDescriptionProvider
implements HandlerMappingDescriptionProvider<AbstractUrlHandlerMapping> {
@Override
public Class<AbstractUrlHandlerMapping> getMappingClass() {
return AbstractUrlHandlerMapping.class;
}
@Override
public List<DispatcherHandlerMappingDescri... | new DispatcherHandlerMappingDescription(predicate.toString(), handlerFunction.toString(), details));
}
@Override
public void resources(Function<ServerRequest, Mono<Resource>> lookupFunction) {
}
@Override
public void attributes(Map<String, Object> attributes) {
}
@Override
public void unknown(Route... | repos\spring-boot-4.0.1\module\spring-boot-webflux\src\main\java\org\springframework\boot\webflux\actuate\web\mappings\DispatcherHandlersMappingDescriptionProvider.java | 1 |
请完成以下Java代码 | public static MainDataRecordIdentifier createForMaterial(
@NonNull final MaterialDescriptor material,
@NonNull final ZoneId timeZone)
{
return MainDataRecordIdentifier.builder()
.productDescriptor(material)
.date(TimeUtil.getDay(material.getDate(), timeZone))
.warehouseId(material.getWarehouseId())... | public IQueryBuilder<I_MD_Cockpit> createQueryBuilder()
{
final ProductDescriptor productDescriptor = getProductDescriptor();
final AttributesKey attributesKey = productDescriptor.getStorageAttributesKey();
attributesKey.assertNotAllOrOther();
return Services.get(IQueryBL.class)
.createQueryBuilder(I_MD_... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\cockpit\src\main\java\de\metas\material\cockpit\view\MainDataRecordIdentifier.java | 1 |
请完成以下Java代码 | public void setMD_Candidate_ID (int MD_Candidate_ID)
{
if (MD_Candidate_ID < 1)
set_ValueNoCheck (COLUMNNAME_MD_Candidate_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MD_Candidate_ID, Integer.valueOf(MD_Candidate_ID));
}
@Override
public int getMD_Candidate_ID()
{
return get_ValueAsInt(COLUMNNAME_M... | }
@Override
public void setPlannedQty (java.math.BigDecimal PlannedQty)
{
set_Value (COLUMNNAME_PlannedQty, PlannedQty);
}
@Override
public java.math.BigDecimal getPlannedQty()
{
BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_PlannedQty);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
publi... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java-gen\de\metas\material\dispo\model\X_MD_Candidate_Demand_Detail.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void applicationPackagePointcut() {
// Method is empty as this is just a Pointcut, the implementations are in the advices.
}
/**
* Retrieves the {@link Logger} associated to the given {@link JoinPoint}.
*
* @param joinPoint join point we want the logger for.
* @return {@link ... | /**
* Advice that logs when a method is entered and exited.
*
* @param joinPoint join point for advice.
* @return result.
* @throws Throwable throws {@link IllegalArgumentException}.
*/
@Around("applicationPackagePointcut() && springBeanPointcut()")
public Object logAround(Proceedi... | repos\tutorials-master\jhipster-8-modules\jhipster-8-microservice\car-app\src\main\java\com\cars\app\aop\logging\LoggingAspect.java | 2 |
请完成以下Java代码 | protected String doIt() throws Exception
{
final OLCandUpdateResult result = olCandUpdateBL.updateOLCands(getCtx(), createIterator(), params);
return "@Success@: " + result.getUpdated() + " @Processed@, " + result.getSkipped() + " @Skipped@";
}
private Iterator<I_C_OLCand> createIterator()
{
return createQu... | final IQueryBuilder<I_C_OLCand> queryBuilder = Services.get(IQueryBL.class).createQueryBuilder(I_C_OLCand.class, getCtx(), get_TrxName())
.filter(queryFilter)
.filter(ActiveRecordQueryFilter.getInstance(I_C_OLCand.class));
queryBuilder.orderBy()
.addColumn(I_C_OLCand.COLUMNNAME_C_OLCand_ID);
return qu... | repos\metasfresh-new_dawn_uat\backend\de.metas.salescandidate.base\src\main\java\de\metas\ordercandidate\process\C_OLCand_SetOverrideValues.java | 1 |
请完成以下Java代码 | private void zoom(int parentWindowNo, @NonNull AdWindowId adWindowId, MQuery zoomQuery)
{
// setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//
AWindow frame = new AWindow();
if (!frame.initWindow(adWindowId, zoomQuery))
{
// setCursor(Cursor.getDefaultCursor());
ValueNamePair pp = Metasfres... | AEnv.addToWindowManager(frame);
if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED))
{
AEnv.showMaximized(frame);
}
else
{
AEnv.showCenterScreen(frame);
}
}
// async window - not able to get feedback
frame = null;
//
// setCursor(Cursor.getDefaultCursor());
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\grid\ed\menu\ZoomContextEditorAction.java | 1 |
请完成以下Java代码 | public Map<String, Object> getOtherProperties()
{
return otherProperties;
}
@JsonAnySetter
/* package */void putOtherProperty(final String name, final Object jsonValue)
{
otherProperties.put(name, jsonValue);
}
private JSONDocumentLayout putDebugProperty(final String name, final Object jsonValue)
{
oth... | }
private static void setAdvSearchWindows(
@NonNull final List<JSONDocumentLayoutSection> sections,
@NonNull final WindowId windowId,
@Nullable final DetailId tabId,
@NonNull final JSONDocumentLayoutOptions jsonOpts)
{
sections.stream()
.flatMap(section -> section.getColumns().stream())
.flatMa... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\datatypes\json\JSONDocumentLayout.java | 1 |
请完成以下Java代码 | public void objectCreation() {
new Object();
}
@Benchmark
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@BenchmarkMode(Mode.AverageTime)
public Object pillarsOfCreation() {
return new Object();
}
@Benchmark
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@BenchmarkMode(Mode.AverageTi... | blackhole.consume(new Object());
}
@Benchmark
public double foldedLog() {
int x = 8;
return Math.log(x);
}
@Benchmark
public double log(Log input) {
return Math.log(input.x);
}
} | repos\tutorials-master\jmh\src\main\java\com\baeldung\BenchMark.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BPartnerInvoicingInfo
{
@NonNull
BPartnerId bpartnerId;
@NonNull
BPartnerLocationId billBPartnerLocationId;
@NonNull
@Default
Optional<BPartnerContactId> billContactId = Optional.empty();
@NonNull
@Default
Optional<PaymentRule> paymentRule = Optional.empty();
@NonNull
@Default
Optional<Pay... | @NonNull
PriceListId priceListId;
boolean taxIncluded;
@NonNull
CurrencyId currencyId;
public DocumentLocation getBillLocation()
{
return DocumentLocation.builder()
.bpartnerId(getBpartnerId())
.bpartnerLocationId(getBillBPartnerLocationId())
.contactId(getBillContactId().orElse(null))
.build(... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\BPartnerInvoicingInfo.java | 2 |
请完成以下Java代码 | public static List<JSONDocumentFilter> ofList(final DocumentFilterList filters, final JSONOptions jsonOpts)
{
if (filters == null || filters.isEmpty())
{
return ImmutableList.of();
}
return filters.stream()
.map(filter -> of(filter, jsonOpts))
.collect(GuavaCollectors.toImmutableList());
}
publi... | @JsonProperty("filterId")
String filterId;
@JsonProperty("caption")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
String caption;
@JsonProperty("parameters")
List<JSONDocumentFilterParam> parameters;
@JsonCreator
@Builder
private JSONDocumentFilter(
@JsonProperty("filterId") @NonNull final String filterId,... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\json\JSONDocumentFilter.java | 1 |
请完成以下Java代码 | public final ImmutableList<CacheInvalidateRequest> createRequestsFromModel(@NonNull final ICacheSourceModel model, @NonNull final ModelCacheInvalidationTiming timing)
{
final Set<ModelCacheInvalidateRequestFactory> factories = windowBasedModelCacheInvalidateRequestFactoryGroup.getFactoriesByTableName(descriptor.getV... | private boolean isEligibleForInvalidation(final ICacheSourceModel model, final ModelCacheInvalidationTiming timing)
{
if (!descriptor.getInvalidateOnTimings().contains(timing))
{
return false;
}
if (timing.isChange()
&& !descriptor.getInvalidateOnChangeOnlyForColumnNames().isEmpty()
&& !isValueChan... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\model\view_source\ViewSourceCacheInvalidateRequestFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Map<String, String> getDepNamesByUserIds(List<String> userIds) {
List<SysUserDepVo> list = userMapper.getDepNamesByUserIds(userIds);
Map<String, String> res = new HashMap(5);
list.forEach(item -> {
if (res.get(item.getUserId()) == null) {
res.pu... | public IPage<SysTenant> getTenantPageListByUserId(Page<SysTenant> page, String userId, List<String> userTenantStatus,SysUserTenantVo sysUserTenantVo) {
return page.setRecords(userTenantMapper.getTenantPageListByUserId(page,userId,userTenantStatus,sysUserTenantVo));
}
@CacheEvict(value={CacheConstant.SY... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\service\impl\SysUserTenantServiceImpl.java | 2 |
请完成以下Java代码 | private final Collection<E> getAndIncrementPage()
{
final int pageFirstRow = nextPageFirstRow;
final int pageSize = computePageSize(pageFirstRow);
if (pageSize <= 0)
{
return null;
}
final Page<E> currentPage = pageFetcher.getPage(pageFirstRow, pageSize);
if (currentPage == null)
{
return null;
... | }
public static <E> Page<E> ofRowsAndLastRowIndex(final List<E> rows, final int lastRowZeroBased)
{
return new Page<>(rows, lastRowZeroBased);
}
private final List<E> rows;
private final Integer lastRowZeroBased;
private Page(final List<E> rows, final Integer lastRowZeroBased)
{
Check.assumeNotEm... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\collections\PagedIterator.java | 1 |
请完成以下Java代码 | private void add(@NonNull final POSCashJournalLine line)
{
lines.add(line);
updateTotals();
}
private void updateTotals()
{
Money cashEndingBalance = this.cashBeginningBalance;
for (final POSCashJournalLine line : lines)
{
if (line.isCash())
{
cashEndingBalance = cashEndingBalance.add(line.getA... | .forEach(posPayment -> addPayment(posPayment, posOrderId, cashierId));
}
private void addPayment(final POSPayment posPayment, POSOrderId posOrderId, UserId cashierId)
{
add(
POSCashJournalLine.builder()
.type(POSCashJournalLineType.ofPaymentMethod(posPayment.getPaymentMethod()))
.amount(posPayment... | repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSCashJournal.java | 1 |
请完成以下Java代码 | public String toString()
{
final String explanationStr = !TranslatableStrings.isBlank(explanation)
? explanation.getDefaultValue()
: null;
return MoreObjects.toStringHelper(this)
.omitNullValues()
.addValue(value)
.add("explanation", explanationStr)
.toString();
}
public ITranslatableSt... | {
if (isPresent())
{
consumer.accept(value);
}
return this;
}
@SuppressWarnings("UnusedReturnValue")
public ExplainedOptional<T> ifAbsent(@NonNull final Consumer<ITranslatableString> consumer)
{
if (!isPresent())
{
consumer.accept(explanation);
}
return this;
}
/**
* @see #resolve(Functi... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\ExplainedOptional.java | 1 |
请完成以下Java代码 | public Date getStartedBefore() {
return startedBefore;
}
public void setStartedBefore(Date startedBefore) {
this.startedBefore = startedBefore;
}
public Date getStartedAfter() {
return startedAfter;
}
public void setStartedAfter(Date startedAfter) {
this.starte... | return startedBy;
}
public void setStartedBy(String startedBy) {
this.startedBy = startedBy;
}
public List<String> getInvolvedGroups() {
return involvedGroups;
}
public void setInvolvedGroups(List<String> involvedGroups) {
this.involvedGroups = involvedGroups;
}
} | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\ExecutionQueryImpl.java | 1 |
请完成以下Java代码 | public void performExecution(final ActivityExecution execution) throws Exception {
Callable<Void> callable = new Callable<Void>() {
@Override
public Void call() throws Exception {
// Note: we can't cache the result of the expression, because the
// execution can change: eg. delegateExpres... | };
executeWithErrorPropagation(execution, callable);
}
protected ActivityBehavior getActivityBehaviorInstance(ActivityExecution execution, Object delegateInstance) {
if (delegateInstance instanceof ActivityBehavior) {
return new CustomActivityBehavior((ActivityBehavior) delegateInstance);
} else... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\behavior\ServiceTaskDelegateExpressionActivityBehavior.java | 1 |
请完成以下Spring Boot application配置 | server:
port: 8080
servlet:
context-path: /demo
spring:
datasource:
hikari:
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/spring-boot-demo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOn... | ms
# 连接池中的最大空闲连接 默认 8
max-idle: 8
# 连接池中的最小空闲连接 默认 0
min-idle: 0
jwt:
config:
key: xkcoding
ttl: 600000
remember: 604800000
logging:
level:
com.xkcoding.rbac.security: debug
custom:
config:
ignores:
# 需要过滤的 post 请求
post:
- "/api/auth/login"
... | repos\spring-boot-demo-master\demo-rbac-security\src\main\resources\application.yml | 2 |
请完成以下Java代码 | public class IPWithGivenRangeCheck {
// using IPAddress library
public static boolean checkIPIsInGivenRange(String inputIP, String rangeStartIP, String rangeEndIP) throws AddressStringException {
IPAddress startIPAddress = new IPAddressString(rangeStartIP).getAddress();
IPAddress endIPAddress =... | private static long ipToLongInt(InetAddress ipAddress) {
long resultIP = 0;
byte[] ipAddressOctets = ipAddress.getAddress();
for (byte octet : ipAddressOctets) {
resultIP <<= 8;
resultIP |= octet & 0xFF;
}
return resultIP;
}
// using Java IPv6 li... | repos\tutorials-master\core-java-modules\core-java-networking-3\src\main\java\com\baeldung\ipingivenrange\IPWithGivenRangeCheck.java | 1 |
请完成以下Java代码 | public void setGeocodingStatus (final java.lang.String GeocodingStatus)
{
set_Value (COLUMNNAME_GeocodingStatus, GeocodingStatus);
}
@Override
public java.lang.String getGeocodingStatus()
{
return get_ValueAsString(COLUMNNAME_GeocodingStatus);
}
@Override
public void setHouseNumber (final @Nullable java.... | }
@Override
public java.lang.String getPostal()
{
return get_ValueAsString(COLUMNNAME_Postal);
}
@Override
public void setPostal_Add (final @Nullable java.lang.String Postal_Add)
{
set_ValueNoCheck (COLUMNNAME_Postal_Add, Postal_Add);
}
@Override
public java.lang.String getPostal_Add()
{
return ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Location.java | 1 |
请完成以下Java代码 | public static ClientSession connectToServer(SshClient client) throws IOException {
ClientSession session = client.connect(USER, HOST, PORT)
.verify(10000)
.getSession();
FileKeyPairProvider fileKeyPairProvider = new FileKeyPairProvider(Paths.get(PRIVATE_KEY));
Iterable<K... | SftpClientFactory factory = SftpClientFactory.instance();
return factory.createSftpClient(session);
}
public static List<SftpClient.DirEntry> listDirectory(SftpClient sftp, String remotePath) throws IOException {
Iterable<SftpClient.DirEntry> entriesIterable = sftp.readDir(remotePath);
... | repos\tutorials-master\libraries-security\src\main\java\com\baeldung\listfilesremoteserver\RemoteServerApacheSshd.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class GOClientConfigRepository
{
private final CCache<Integer, GOClientConfig> configByShipperId = CCache.newCache(I_GO_Shipper_Config.Table_Name, 1, CCache.EXPIREMINUTES_Never);
public GOClientConfig getByShipperId(final int shipperId)
{
return configByShipperId.getOrLoad(shipperId, () -> retrieveConfigFo... | .firstOnly(I_GO_Shipper_Config.class);
if (configPO == null)
{
throw new AdempiereException("No GO shipper config found for shipperId=" + shipperId);
}
return GOClientConfig.builder()
.url(StringUtils.trimWhitespace(configPO.getGO_URL()))
.authUsername(StringUtils.trimWhitespace(configPO.getGO_AuthU... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.go\src\main\java\de\metas\shipper\gateway\go\GOClientConfigRepository.java | 2 |
请完成以下Java代码 | public String toString()
{
StringBuilder sb = new StringBuilder ("X_PP_MRP_Alloc[")
.append(get_ID()).append("]");
return sb.toString();
}
@Override
public org.eevolution.model.I_PP_MRP getPP_MRP_Demand() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_PP_MRP_Demand_ID, org.e... | @param PP_MRP_Supply_ID MRP Supply */
@Override
public void setPP_MRP_Supply_ID (int PP_MRP_Supply_ID)
{
if (PP_MRP_Supply_ID < 1)
set_ValueNoCheck (COLUMNNAME_PP_MRP_Supply_ID, null);
else
set_ValueNoCheck (COLUMNNAME_PP_MRP_Supply_ID, Integer.valueOf(PP_MRP_Supply_ID));
}
/** Get MRP Supply.
@re... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_MRP_Alloc.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static SalesRepContact getSalesRepContact(@NonNull final I_C_BPartner bPartnerRecord)
{
final UserId salesRepId = UserId.ofRepoIdOrNull(bPartnerRecord.getSalesRep_ID());
if (salesRepId == null || !salesRepId.isRegularUser() )
{
return null;
}
final I_AD_User salesRepContact = InterfaceWrapperHel... | final BPartnerId bPartnerSalesRepId = BPartnerId.ofRepoIdOrNull(bPartnerRecord.getC_BPartner_SalesRep_ID());
if (bPartnerSalesRepId == null)
{
return null;
}
final I_C_BPartner salesRep = InterfaceWrapperHelper.load(bPartnerSalesRepId, I_C_BPartner.class);
return SalesRep.builder()
.id(bPartnerSales... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\bpartner\composite\repository\BPartnerCompositesLoader.java | 2 |
请完成以下Java代码 | private boolean isReadyForCleanup(
@NonNull final ApiRequestAudit apiRequestAudit,
@NonNull final ApiAuditConfigShortTimeIndex apiAuditConfigIndex)
{
final ApiAuditConfig apiAuditConfig = apiAuditConfigIndex.getConfig(apiRequestAudit.getApiAuditConfigId());
final long daysSinceLastUpdate = (Instant.now().ge... | Map<ApiAuditConfigId, ApiAuditConfig> configId2Config = new HashMap<>();
ApiAuditConfigRepository apiAuditConfigRepository;
public ApiAuditConfigShortTimeIndex(final ApiAuditConfigRepository apiAuditConfigRepository)
{
this.apiAuditConfigRepository = apiAuditConfigRepository;
}
@NonNull
public ApiAudi... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\audit\apirequest\ApiAuditCleanUpService.java | 1 |
请完成以下Java代码 | private MSV3OrderSyncResponse process(final MSV3OrderSyncRequest request)
{
try
{
final List<OLCand> olCands = olCandRepo.create(toOLCandCreateRequestsList(request));
return MSV3OrderSyncResponse.ok(request.getOrderId(), request.getBpartner())
.items(olCands.stream()
.map(olCand -> MSV3OrderSync... | olCandRequests.add(OLCandCreateRequest.builder()
.externalLineId(item.getId().getValueAsString())
//
.bpartner(toOLCandBPartnerInfo(request.getBpartner()))
.poReference(poReference)
//
.dateRequired(dateRequired)
//
.productId(productId)
.qty(item.getQty().getValueA... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.server-peer-metasfresh\src\main\java\de\metas\vertical\pharma\msv3\server\peer\metasfresh\listeners\OrderCreateRequestRabbitMQListener.java | 1 |
请完成以下Java代码 | public static void main(String[] args) {
List<Integer> fList = List.list(3, 4, 5, 6);
List<Boolean> evenList = fList.map(isEven);
Show.listShow(Show.booleanShow).println(evenList);
fList = fList.map(i -> i + 1);
Show.listShow(Show.intShow).println(fList);
Array<Integer... | int sum = intArray.foldLeft(Integers.add, 0);
System.out.println(sum);
Option<Integer> n1 = Option.some(1);
Option<Integer> n2 = Option.some(2);
F<Integer, Option<Integer>> f1 = i -> i % 2 == 0 ? Option.some(i + 100) : Option.none();
Option<Integer> result1 = n1.bind(f1);
... | repos\tutorials-master\libraries-6\src\main\java\com\baeldung\fj\FunctionalJavaMain.java | 1 |
请完成以下Java代码 | protected ExternalSystemType getExternalSystemType()
{
return ExternalSystemType.Other;
}
@Override
protected long getSelectedRecordCount(final IProcessPreconditionsContext context)
{
throw new UnsupportedOperationException("getSelectedRecordCount unsupported for InvokeOtherAction!");
}
@Override
public P... | }
final ExternalSystemParentConfigId parentConfigId = ExternalSystemParentConfigId.ofRepoId(context.getSingleSelectedRecordId());
if (!ExternalSystemType.Other.getValue().equals(externalSystemConfigDAO.getParentTypeById(parentConfigId)))
{
return ProcessPreconditionsResolution.reject();
}
final External... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\process\InvokeOtherAction.java | 1 |
请完成以下Java代码 | public String toString()
{
return includeSystemClient ? "(context client or system)" : "(context client)";
}
@Override
public String getSql()
{
return sql;
}
@Override
public List<Object> getSqlParams(final Properties ctx)
{
final Properties ctxToUse = ctx == null ? this.ctx : ctx;
final ClientId cli... | }
// System client
if (includeSystemClient && adClientId == IClientDAO.SYSTEM_CLIENT_ID)
{
return true;
}
return false;
}
private int getAD_Client_ID(final T model)
{
final Object adClientId = InterfaceWrapperHelper.getValueOrNull(model, COLUMNNAME_AD_Client_ID);
if (adClientId == null)
{
re... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\ContextClientQueryFilter.java | 1 |
请完成以下Java代码 | private static boolean equalsConstantTime(String expected, String actual) {
if (expected == actual) {
return true;
}
if (expected == null || actual == null) {
return false;
}
// Encode after ensure that the string is not null
byte[] expectedBytes = Utf8.encode(expected);
byte[] actualBytes = Utf8.en... | private static class DefaultRequireCsrfProtectionMatcher implements ServerWebExchangeMatcher {
private static final Set<HttpMethod> ALLOWED_METHODS = new HashSet<>(
Arrays.asList(HttpMethod.GET, HttpMethod.HEAD, HttpMethod.TRACE, HttpMethod.OPTIONS));
@Override
public Mono<MatchResult> matches(ServerWebExch... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\csrf\CsrfWebFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Optional<UndoDecommissionResponse> undoDecommissionProductIfEligible(
@NonNull final SecurPharmProduct product,
@Nullable final InventoryId inventoryId)
{
if (!isEligibleForUndoDecommission(product))
{
return Optional.empty();
}
final SecurPharmClient client = createClient();
final UndoDecom... | {
return product.isDecommissioned() // was already decommissioned
&& !product.isError() // no errors
;
}
public SecurPharmHUAttributesScanner newHUScanner()
{
final IHandlingUnitsBL handlingUnitsBL = Services.get(IHandlingUnitsBL.class);
final IHandlingUnitsDAO handlingUnitsRepo = Services.get(IHandli... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.securpharm\src\main\java\de\metas\vertical\pharma\securpharm\service\SecurPharmService.java | 2 |
请完成以下Java代码 | public int compare(final IQualityInvoiceLineGroup line1, final IQualityInvoiceLineGroup line2)
{
final int index1 = getIndex(line1);
final int index2 = getIndex(line2);
return index1 - index2;
}
private final int getIndex(final IQualityInvoiceLineGroup line)
{
Check.assumeNotNull(line, "line not null");
... | {
it.remove();
}
}
}
/**
* Sort given lines with this comparator.
*
* NOTE: we assume the list is read-write.
*
* @param lines
*/
public void sort(final List<IQualityInvoiceLineGroup> lines)
{
Collections.sort(lines, this);
}
/**
* Remove from given lines those which their type is not s... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\qualityBasedInvoicing\invoicing\QualityInvoiceLineGroupByTypeComparator.java | 1 |
请完成以下Java代码 | public void setPOReference (final @Nullable String POReference)
{
set_ValueNoCheck (COLUMNNAME_POReference, POReference);
}
@Override
public String getPOReference()
{
return get_ValueAsString(COLUMNNAME_POReference);
}
@Override
public void setPrintCount (final int PrintCount)
{
throw new IllegalArgum... | if (Record_ID < 0)
set_ValueNoCheck (COLUMNNAME_Record_ID, null);
else
set_ValueNoCheck (COLUMNNAME_Record_ID, Record_ID);
}
@Override
public int getRecord_ID()
{
return get_ValueAsInt(COLUMNNAME_Record_ID);
}
@Override
public void setStoreCount (final int StoreCount)
{
throw new IllegalArgumen... | repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive\de.metas.document.archive.base\src\main\java-gen\de\metas\document\archive\model\X_C_Doc_Outbound_Log.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SqlEntityDatabaseSchemaService extends SqlAbstractDatabaseSchemaService implements EntityDatabaseSchemaService {
public static final String SCHEMA_ENTITIES_SQL = "schema-entities.sql";
public static final String SCHEMA_ENTITIES_IDX_SQL = "schema-entities-idx.sql";
public static final String SC... | @Override
public void createOrUpdateDeviceInfoView(boolean activityStateInTelemetry) {
String sourceViewName = activityStateInTelemetry ? "device_info_active_ts_view" : "device_info_active_attribute_view";
executeQuery("DROP VIEW IF EXISTS device_info_view CASCADE;");
executeQuery("CREATE OR... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\install\SqlEntityDatabaseSchemaService.java | 2 |
请完成以下Java代码 | public final boolean isFailIfAlreadyLocked()
{
return failIfAlreadyLocked;
}
@Override
public ILockCommand setFailIfNothingLocked(final boolean failIfNothingLocked)
{
this.failIfNothingLocked = failIfNothingLocked;
return this;
}
@Override
public boolean isFailIfNothingLocked()
{
return failIfNothing... | return _recordsToLock.getSelection_AD_Table_ID();
}
@Override
public final PInstanceId getSelectionToLock_AD_PInstance_ID()
{
return _recordsToLock.getSelection_PInstanceId();
}
@Override
public final Iterator<TableRecordReference> getRecordsToLockIterator()
{
return _recordsToLock.getRecordsIterator();
... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\lock\api\impl\LockCommand.java | 1 |
请完成以下Java代码 | public String getOperationName() {
return "bookById";
}
public static Builder newRequest() {
return new Builder();
}
public static class Builder {
private Set<String> fieldsSet = new HashSet<>();
private final Map<String, String> variableReferences = new HashMap<>();
private final List<VariableDefinit... | this.id = id;
this.fieldsSet.add("id");
return this;
}
public Builder idReference(String variableRef) {
this.variableReferences.put("id", variableRef);
this.variableDefinitions.add(VariableDefinition.newVariableDefinition(variableRef, new graphql.language.TypeName("ID")).build());
this.fieldsSet.add... | repos\spring-graphql-main\spring-graphql-docs\src\main\java\org\springframework\graphql\docs\client\dgsgraphqlclient\BookByIdGraphQLQuery.java | 1 |
请完成以下Java代码 | public void actionPerformed(final ActionEvent e)
{
if (e.getActionCommand().equals(ConfirmPanel.A_OK))
{
if (save())
{
dispose();
m_OKpressed = true;
}
}
else if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL))
{
dispose();
}
//
// ActionCombo: display the description for the se... | }
} // actionPerformed
/**
* Save to Database
*
* @return true if saved to Tab
*/
private boolean save()
{
final IDocActionItem selectedDocAction = actionCombo.getSelectedItem();
if (selectedDocAction == null)
{
return false;
}
// Save Selection
log.info("DocAction={}", selectedDocAction);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VDocAction.java | 1 |
请完成以下Java代码 | private static final boolean equalsIgnoreCase(final Set<String> a1, final Set<String> a2)
{
if (a1 == a2)
{
return true;
}
if (a1 == null || a2 == null)
{
return false;
}
if (a1.size() != a2.size())
{
return false;
} | return Objects.equals(toUpperCase(a1), toUpperCase(a2));
}
private static Set<String> toUpperCase(final Set<String> set)
{
return set.stream().map(String::toUpperCase).collect(ImmutableSet.toImmutableSet());
}
private static class DBIndex
{
public String name;
public boolean isUnique = true;
public Set<... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\org\adempiere\process\AD_Index_Create.java | 1 |
请完成以下Java代码 | public Object getConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
connection = new JcaExecutorServiceConnectionImpl(this, mcf);
return connection;
}
public void associateConnection(Object connection) throws ResourceException {
if (connection == null) {
t... | for (ConnectionEventListener cel : listeners) {
cel.connectionClosed(event);
}
}
public PrintWriter getLogWriter() throws ResourceException {
return logwriter;
}
public void setLogWriter(PrintWriter out) throws ResourceException {
logwriter = out;
}
public LocalTransaction getLocalTrans... | repos\camunda-bpm-platform-master\javaee\jobexecutor-ra\src\main\java\org\camunda\bpm\container\impl\threading\ra\outbound\JcaExecutorServiceManagedConnection.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class OrderedDataLoader
{
private static final Logger logger = LogManager.getLogger(OrderedDataLoader.class);
@NonNull
I_C_Invoice_Candidate invoiceCandidateRecord;
@NonNull
UomId stockUomId;
/** Needed to get the product types of other order lines' products. */
@NonNull
IProductBL productBL;
public... | final IOrderDAO orderDAO = Services.get(IOrderDAO.class);
for (final I_C_OrderLine oLine : orderDAO.retrieveOrderLines(invoiceCandidateRecord.getC_Order()))
{
try (final MDCCloseable oLineMDC = TableRecordMDC.putTableRecordReference(oLine))
{
final BigDecimal toInvoice = oLine.getQtyOrdered().subtract(oL... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\internalbusinesslogic\OrderedDataLoader.java | 2 |
请完成以下Java代码 | public String toString()
{
return MoreObjects.toStringHelper(this)
.add("caption", caption)
.add("sections-count", sectionBuilders.size())
.toString();
}
public Builder setWindowId(final WindowId windowId)
{
this.windowId = windowId;
return this;
}
public Builder setCaption(final I... | public Builder notFoundMessages(@Nullable NotFoundMessages notFoundMessages)
{
this.notFoundMessages = notFoundMessages;
return this;
}
public Builder addSection(@NonNull final DocumentLayoutSectionDescriptor.Builder sectionBuilderToAdd)
{
sectionBuilders.add(sectionBuilderToAdd);
return this;
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\DocumentLayoutSingleRow.java | 1 |
请完成以下Java代码 | public class Book {
@Id
private String id;
private String name;
private String genre;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() { | return name;
}
public void setName(String name) {
this.name = name;
}
public String getGenre() {
return genre;
}
public void setGenre(String genre) {
this.genre = genre;
}
} | repos\tutorials-master\persistence-modules\spring-boot-persistence-mongodb-2\src\main\java\com\baeldung\boot\json\convertfile\data\Book.java | 1 |
请完成以下Java代码 | protected void assertEligible(final T document)
{
if (!document.isEdiEnabled())
{
throw new AdempiereException("@" + I_EDI_Document_Extension.COLUMNNAME_IsEdiEnabled + "@=@N@");
}
// Assume document is completed/closed
final String docStatus = document.getDocStatus();
if (!I_EDI_Document_Extension.DOCS... | if (!I_EDI_Document_Extension.EDI_EXPORTSTATUS_Pending.equals(document.getEDI_ExportStatus())
&& !I_EDI_Document_Extension.EDI_EXPORTSTATUS_Enqueued.equals(document.getEDI_ExportStatus()) // if enqueued, assume pending; we're just flagging it to avoid collisions in async
&& !I_EDI_Document_Extension.EDI_EXPORTS... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java\de\metas\edi\process\export\impl\AbstractEdiDocExtensionExport.java | 1 |
请完成以下Java代码 | static StringBuilder formatBody(HttpContent httpContent) {
StringBuilder responseData = new StringBuilder();
ByteBuf content = httpContent.content();
if (content.isReadable()) {
responseData.append(content.toString(CharsetUtil.UTF_8)
.toUpperCase());
respo... | if (!trailer.trailingHeaders()
.isEmpty()) {
responseData.append("\r\n");
for (CharSequence name : trailer.trailingHeaders()
.names()) {
for (CharSequence value : trailer.trailingHeaders()
.getAll(name)) {
respon... | repos\tutorials-master\server-modules\netty\src\main\java\com\baeldung\http\server\RequestUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ResponseEntity<byte[]> getBarcode( //
@RequestParam(name = CONTENT) final String content //
, @RequestParam(name = FORMAT) final String formatStr//
, @RequestParam(name = WIDTH, required = false) final int width//
, @RequestParam(name = HEIGHT, required = false) final int height//
, @RequestParam(... | for (int i = 0; i <= 3; i++)
{
ecl = ErrorCorrectionLevel.forBits(i);
if (ecl.toString().equals(eclStr))
{
break;
}
}
hints.put(EncodeHintType.ERROR_CORRECTION, ecl);
}
}
return hints;
}
private static byte[] toByteArray(final BitMatrix matrix, final String imageFormat)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\metasfresh-report-service\src\main\java\de\metas\report\rest\BarcodeRestController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class PostController {
private final PostService postService;
public PostController(PostService postService) {
this.postService = postService;
}
@PostMapping("create")
@PreAuthorize("hasRole('USER')")
public ResponseEntity<PostResponseDto> create(@RequestBody PostRequestDto dto,... | return new ResponseEntity<>("updated", HttpStatus.OK);
} catch (AccessDeniedException ade) {
return new ResponseEntity<>(ade.getMessage(), HttpStatus.FORBIDDEN);
}
}
@DeleteMapping("{id}")
@PreAuthorize("hasAnyRole('USER', 'ADMIN')")
public ResponseEntity<?> delete(@PathVari... | repos\tutorials-master\spring-security-modules\spring-security-authorization\spring-security-url-http-method-auth\src\main\java\com\baeldung\springsecurity\controller\PostController.java | 2 |
请完成以下Java代码 | public static class Result implements IEnqueueResult
{
@Getter
private int skippedPackagesCount;
private final List<QueueWorkPackageId> enqueuedWorkpackageIds = new ArrayList<>();
public int getEnqueuedPackagesCount()
{
return enqueuedWorkpackageIds.size();
}
public ImmutableList<QueueWorkPackageId... | enqueuedWorkpackageIds.add(workPackageId);
}
private void incSkipped()
{
skippedPackagesCount++;
}
@Override
public int getWorkpackageEnqueuedCount()
{
return enqueuedWorkpackageIds.size();
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\shipmentschedule\api\ShipmentScheduleEnqueuer.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.