instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public static String desEncrypt(String data) throws Exception {
return decryptLegacyNoPadding(data);
}
/* 加密(若前端不再使用,可忽略;保留旧实现避免影响历史) */
@Deprecated
public static String encrypt(String data) throws Exception {
try{
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
... | SecretKeySpec keyspec = new SecretKeySpec(KEY.getBytes(StandardCharsets.UTF_8), "AES");
IvParameterSpec ivspec = new IvParameterSpec(IV.getBytes(StandardCharsets.UTF_8));
cipher.init(Cipher.ENCRYPT_MODE, keyspec, ivspec);
byte[] encrypted = cipher.doFinal(plaintext);
retu... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\encryption\AesEncryptUtil.java | 1 |
请完成以下Java代码 | public ResponseEntity<List<AdminUserDTO>> getAllUsers(@org.springdoc.core.annotations.ParameterObject Pageable pageable) {
log.debug("REST request to get all User for an admin");
if (!onlyContainsAllowedProperties(pageable)) {
return ResponseEntity.badRequest().build();
}
fi... | * {@code DELETE /admin/users/:login} : delete the "login" User.
*
* @param login the login of the user to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/users/{login}")
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")... | repos\tutorials-master\jhipster-8-modules\jhipster-8-monolithic\src\main\java\com\baeldung\jhipster8\web\rest\UserResource.java | 1 |
请完成以下Java代码 | private CarrierProduct getCachedShipperProductByCode(@NonNull final ShipperId shipperId, @Nullable final String code)
{
if (code == null)
{
return null;
}
return carrierProductsByExternalId.getOrLoad(shipperId + code, () ->
queryBL.createQueryBuilder(I_Carrier_Product.class)
.addEqualsFilter(I_Car... | .firstOptional()
.map(CarrierProductRepository::fromProductRecord)
.orElse(null));
}
@NonNull
private CarrierProduct createShipperProduct(@NonNull final ShipperId shipperId, @NonNull final String code, @NonNull final String name)
{
final I_Carrier_Product po = InterfaceWrapperHelper.newInstance(I_Car... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.commons\src\main\java\de\metas\shipper\gateway\commons\model\CarrierProductRepository.java | 1 |
请完成以下Java代码 | public void setSubstitute_ID (int Substitute_ID)
{
if (Substitute_ID < 1)
set_Value (COLUMNNAME_Substitute_ID, null);
else
set_Value (COLUMNNAME_Substitute_ID, Integer.valueOf(Substitute_ID));
}
/** Get Ersatz.
@return Entity which can be used in place of this entity
*/
@Override
public int getSu... | /** Set Gültig bis.
@param ValidTo
Valid to including this date (last day)
*/
@Override
public void setValidTo (java.sql.Timestamp ValidTo)
{
set_Value (COLUMNNAME_ValidTo, ValidTo);
}
/** Get Gültig bis.
@return Valid to including this date (last day)
*/
@Override
public java.sql.Timestamp getVa... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_User_Substitute.java | 1 |
请完成以下Java代码 | public static void main(String[] args) {
List<ClientConnection> clientConnections = new ArrayList<>();
try (ServerSocket serverSocket = new ServerSocket(PORT)) {
logger.info("Server started on port {}", PORT);
while (!serverSocket.isClosed()) {
acceptNewConnecti... | if (client.getSocket()
.isClosed()) {
logger.info("Client disconnected: {}", client.getSocket()
.getInetAddress());
iterator.remove();
continue;
}
try {
BufferedReader reader = client.getReader()... | repos\tutorials-master\core-java-modules\core-java-sockets\src\main\java\com\baeldung\threading\request\ThreadPerRequestServer.java | 1 |
请完成以下Java代码 | public <T extends RepoIdAware> Stream<T> streamIds(@NonNull final String tableName, @NonNull final IntFunction<T> idMapper)
{
return streamByTableName(tableName)
.mapToInt(TableRecordReference::getRecord_ID)
.mapToObj(idMapper);
}
public <T extends RepoIdAware> ImmutableSet<T> getRecordIdsByTableName(@Non... | if (tableIds.isEmpty())
{
throw new AdempiereException("No AD_Table_ID");
}
else if (tableIds.size() == 1)
{
return tableIds.iterator().next();
}
else
{
throw new AdempiereException("More than one AD_Table_ID found: " + tableIds);
}
}
public void assertSingleTableName()
{
final ImmutableS... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\util\lang\impl\TableRecordReferenceSet.java | 1 |
请完成以下Java代码 | public long estimateSize() {
return Long.MAX_VALUE;
}
public int characteristics() {
return Spliterator.ORDERED | Spliterator.NONNULL |
Spliterator.CONCURRENT;
}
}
/**
* Returns a {@link Spliterator} over the elements in this queue.
... | }
private boolean casHead(Node<E> cmp, Node<E> val) {
return UNSAFE.compareAndSwapObject(this, headOffset, cmp, val);
}
// Unsafe mechanics
private static final sun.misc.Unsafe UNSAFE;
private static final long headOffset;
private static final long tailOffset;
static {
tr... | repos\spring-boot-student-master\spring-boot-student-concurrent\src\main\java\com\xiaolyuh\ConcurrentLinkedQueue.java | 1 |
请完成以下Java代码 | protected String getSQLSelect()
{
return m_sqlMain;
}
protected void setKeyColumnIndex(final int keyColumnIndex)
{
m_keyColumnIndex = keyColumnIndex;
}
/**
* @param row
* @return true if given row is a data row (e.g. not a totals row)
*/
public boolean isDataRow(final int row)
{
if (row < 0)
{
... | public boolean isLoading()
{
if (m_worker == null)
{
return false;
}
// Check for override.
if (ignoreLoading)
{
return false;
}
return m_worker.isAlive();
}
// metas: end
public void setIgnoreLoading(final boolean ignoreLoading)
{
this.ignoreLoading = ignoreLoading;
}
private static ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\search\Info.java | 1 |
请完成以下Java代码 | private LookupValue extractCatchUOM(@NonNull final I_M_ShipmentSchedule record)
{
final UomId catchUomId = UomId.ofRepoIdOrNull(record.getCatch_UOM_ID());
return catchUomId != null
? catchUOMsLookup.findById(catchUomId)
: null;
}
private LookupValue toLookupValue(@NonNull final AttributeSetInstanceId as... | {
return shipmentScheduleBL
.getCatchQtyOverride(record)
.map(qty -> qty.toBigDecimal())
.orElse(null);
}
private int extractSalesOrderLineNo(final I_M_ShipmentSchedule record)
{
final OrderAndLineId salesOrderAndLineId = extractSalesOrderAndLineId(record);
if (salesOrderAndLineId == null)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\shipment_candidates_editor\ShipmentCandidateRowsLoader.java | 1 |
请完成以下Java代码 | public class GenericEventListenerExport extends AbstractPlanItemDefinitionExport<GenericEventListener> {
@Override
protected Class<? extends GenericEventListener> getExportablePlanItemDefinitionClass() {
return GenericEventListener.class;
}
@Override
protected String getPlanItemDefinitionX... | CmmnXmlConstants.ATTRIBUTE_EVENT_LISTENER_AVAILABLE_CONDITION,
genericEventListener.getAvailableConditionExpression());
}
if (StringUtils.isNotEmpty(genericEventListener.getEventType()) && genericEventListener.getExtensionElements().get("eventType") == null) {
Extens... | repos\flowable-engine-main\modules\flowable-cmmn-converter\src\main\java\org\flowable\cmmn\converter\export\GenericEventListenerExport.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void add(ListenableFuture<Void> future) {
futures.add(future);
}
public TenantId getTenantId() {
return user.getTenantId();
}
protected static EntityExportSettings buildExportSettings(VersionCreateConfig config) {
return EntityExportSettings.builder()
.ex... | public abstract EntityExportSettings getSettings();
@SuppressWarnings("unchecked")
public <ID extends EntityId> ID getExternalId(ID internalId) {
var result = externalIdMap.get(internalId);
log.debug("[{}][{}] Local cache {} for id", internalId.getEntityType(), internalId.getId(), result != nul... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\sync\vc\data\EntitiesExportCtx.java | 2 |
请完成以下Java代码 | public class MetricsClientInterceptor implements ClientInterceptor {
private final MetricsClientMeters metricsClientMeters;
private final Supplier<Stopwatch> stopwatchSupplier;
/**
* Creates a new gRPC client interceptor that collects metrics into the given
* {@link io.micrometer.core.instrument... | return new SimpleForwardingClientCall<ReqT, RespT>(call) {
@Override
public void start(Listener<RespT> responseListener, Metadata headers) {
delegate().start(
new SimpleForwardingClientCallListener<RespT>(responseListener) {
@Ov... | repos\grpc-spring-master\grpc-client-spring-boot-starter\src\main\java\net\devh\boot\grpc\client\metrics\MetricsClientInterceptor.java | 1 |
请完成以下Java代码 | public void setM_AttributeSet_ID (int M_AttributeSet_ID)
{
if (M_AttributeSet_ID < 0)
set_Value (COLUMNNAME_M_AttributeSet_ID, null);
else
set_Value (COLUMNNAME_M_AttributeSet_ID, Integer.valueOf(M_AttributeSet_ID));
}
/** Get Merkmals-Satz.
@return Product Attribute Set
*/
@Override
public int g... | @Override
public void setM_Lot_ID (int M_Lot_ID)
{
if (M_Lot_ID < 1)
set_Value (COLUMNNAME_M_Lot_ID, null);
else
set_Value (COLUMNNAME_M_Lot_ID, Integer.valueOf(M_Lot_ID));
}
/** Get Los.
@return Product Lot Definition
*/
@Override
public int getM_Lot_ID ()
{
Integer ii = (Integer)get_Value(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_AttributeSetInstance.java | 1 |
请完成以下Java代码 | public class CaseInstanceMigrationStatusJobHandler extends AbstractCaseInstanceMigrationJobHandler {
public static final String TYPE = "case-migration-status";
@Override
public String getType() {
return TYPE;
}
@Override
public void execute(JobEntity job, String configuration, Variabl... | }
}
if (completedBatchParts == batchParts.size()) {
batchService.completeBatch(batch.getId(), CaseInstanceBatchMigrationResult.STATUS_COMPLETED);
job.setRepeat(null);
} else {
if (batchParts.size() == 0) {
updateBatchStatus(batch, batchService... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\job\CaseInstanceMigrationStatusJobHandler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getSignatureAlgorithm() {
return getRequired(this.header, "alg", String.class);
}
public String getIssuer() {
return getRequired(this.claims, "iss", String.class);
}
public long getExpiry() {
return getRequired(this.claims, "exp", Integer.class).longValue();
}
@SuppressWarnings("unchecked")... | private <T> T getRequired(Map<String, Object> map, String key, Class<T> type) {
Object value = map.get(key);
if (value == null) {
throw new CloudFoundryAuthorizationException(Reason.INVALID_TOKEN, "Unable to get value from key " + key);
}
if (!type.isInstance(value)) {
throw new CloudFoundryAuthorizationE... | repos\spring-boot-4.0.1\module\spring-boot-cloudfoundry\src\main\java\org\springframework\boot\cloudfoundry\autoconfigure\actuate\endpoint\Token.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public CommonResult update(@PathVariable Long id,
@RequestBody UmsMenu umsMenu) {
int count = menuService.update(id, umsMenu);
if (count > 0) {
return CommonResult.success(count);
} else {
return CommonResult.failed();
}
}
@... | List<UmsMenu> menuList = menuService.list(parentId, pageSize, pageNum);
return CommonResult.success(CommonPage.restPage(menuList));
}
@ApiOperation("树形结构返回所有菜单列表")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<UmsMenuNode>> treeList(... | repos\mall-master\mall-admin\src\main\java\com\macro\mall\controller\UmsMenuController.java | 2 |
请完成以下Java代码 | public Object getValue(final String propertyName, final int idx, final Class<?> returnType)
{
return getValue(propertyName, returnType);
}
@Override
public Object getValue(final String propertyName, final Class<?> returnType)
{
return pojoWrapper.getValue(propertyName, returnType);
}
@Override
public bool... | {
return pojoWrapper.invokeEquals(methodArgs);
}
@Override
public Object invokeParent(final Method method, final Object[] methodArgs) throws Exception
{
throw new IllegalStateException("Invoking parent method is not supported");
}
@Override
public boolean isKeyColumnName(final String columnName)
{
retur... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\wrapper\POJOModelInternalAccessor.java | 1 |
请完成以下Java代码 | public String nextForkGatewayId(Map<String, FlowElement> flowElementMap) {
return nextId("dynamicForkGateway", flowElementMap);
}
public String nextJoinGatewayId(Map<String, FlowElement> flowElementMap) {
return nextId("dynamicJoinGateway", flowElementMap);
}
public String next... | protected String nextId(String prefix, Map<String, FlowElement> flowElementMap) {
String nextId = null;
boolean nextIdNotFound = true;
while (nextIdNotFound) {
if (!flowElementMap.containsKey(prefix + counter)) {
nextId = prefix + counter;
nextIdNotFou... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\dynamic\DynamicEmbeddedSubProcessBuilder.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
... | Authority authority = (Authority) o;
return !(name != null ? !name.equals(authority.name) : authority.name != null);
}
@Override
public int hashCode() {
return name != null ? name.hashCode() : 0;
}
@Override
public String toString() {
return "Authority{" +
... | repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\domain\Authority.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isCachable() {
return true;
}
@Override
public Object getValue(ValueFields valueFields) {
BigInteger bigInteger = null;
String textValue = valueFields.getTextValue();
if (textValue != null && !textValue.isEmpty()) {
bigInteger = new BigInteger(text... | public void setValue(Object value, ValueFields valueFields) {
if (value != null) {
valueFields.setTextValue(value.toString());
} else {
valueFields.setTextValue(null);
}
}
@Override
public boolean isAbleToStore(Object value) {
if (value == null) {
... | repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\impl\types\BigIntegerType.java | 2 |
请完成以下Java代码 | public void setTimerJobRunnable(AcquireTimerJobsRunnable timerJobRunnable) {
this.timerJobRunnable = timerJobRunnable;
}
public int getDefaultQueueSizeFullWaitTimeInMillis() {
return defaultQueueSizeFullWaitTime;
}
public void setDefaultQueueSizeFullWaitTimeInMillis(int defaultQueueSiz... | public void setResetExpiredJobsInterval(int resetExpiredJobsInterval) {
this.resetExpiredJobsInterval = resetExpiredJobsInterval;
}
public int getResetExpiredJobsPageSize() {
return resetExpiredJobsPageSize;
}
public void setResetExpiredJobsPageSize(int resetExpiredJobsPageSize) {
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\asyncexecutor\DefaultAsyncJobExecutor.java | 1 |
请完成以下Java代码 | private boolean authenticated() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
return this.trustResolver.isAuthenticated(authentication);
}
/**
* Indicates if the request is elgible to be processed as the proxy receptor.
* @param request
* @return
*/
@SuppressW... | * {@link CasAuthenticationFilter#setAuthenticationFailureHandler(AuthenticationFailureHandler)}
* will be used for service tickets that fail.
*/
private class CasAuthenticationFailureHandler implements AuthenticationFailureHandler {
private final AuthenticationFailureHandler serviceTicketFailureHandler;
CasA... | repos\spring-security-main\cas\src\main\java\org\springframework\security\cas\web\CasAuthenticationFilter.java | 1 |
请完成以下Java代码 | private static String computeShipmentScheduleStatus(
@NonNull final DeliveryLineCandidate deliveryLineCandidate,
@NonNull final IShipmentSchedulesDuringUpdate shipmentCandidates)
{
final CompleteStatus completeStatus = deliveryLineCandidate.getCompleteStatus();
if (!IShipmentSchedulesDuringUpdate.CompleteSta... | @NonNull final OlAndSched olAndSched,
@NonNull final IShipmentScheduleAllocDAO shipmentScheduleAllocDAO)
{
final I_M_ShipmentSchedule sched = olAndSched.getSched();
final BigDecimal qtyDelivered = shipmentScheduleAllocDAO.retrieveQtyDelivered(sched);
final BigDecimal deliveredDiff = qtyDelivered.subtract(ol... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\api\impl\ShipmentScheduleQtysHelper.java | 1 |
请完成以下Java代码 | public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getUsing() {
return using;
}
public void setUsing(String using) {
this.using = using;
}
public String getUsingdate() {
return usingdat... | public String getEnd() {
return end;
}
public void setEnd(String end) {
this.end = end;
}
public String getQrcantonid() {
return qrcantonid;
}
public void setQrcantonid(String qrcantonid) {
this.qrcantonid = qrcantonid;
}
public String getDeclare() {
... | repos\SpringBootBucket-master\springboot-batch\src\main\java\com\xncoding\trans\modules\canton\Canton.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_C_AcctSchema getC_AcctSchema()
{
return get_ValueAsPO(COLUMNNAME_C_AcctSchema_ID, org.compiere.model.I_C_AcctSchema.class);
}
@Override
public void setC_AcctSchema(org.compiere.model.I_C_AcctSchema C_AcctSchema)
{
set_ValueFromPO(COLUMNNAME_C_AcctSchema_ID, org.compiere.model.I_C_A... | return 0;
return ii.intValue();
}
/**
* PostingType AD_Reference_ID=125
* Reference name: _Posting Type
*/
public static final int POSTINGTYPE_AD_Reference_ID=125;
/** Actual = A */
public static final String POSTINGTYPE_Actual = "A";
/** Budget = B */
public static final String POSTINGTYPE_Budget = "B... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-gen\de\metas\acct\model\X_Fact_Acct_EndingBalance.java | 1 |
请完成以下Java代码 | public static boolean isSetter(Method method) {
return isSetter(method, false);
}
public static String getGetterShorthandName(Method method) {
if (!isGetter(method)) {
return method.getName();
}
String name = method.getName();
if (name.startsWith("get")) {
... | return name;
}
public static String getSetterShorthandName(Method method) {
if (!isSetter(method)) {
return method.getName();
}
String name = method.getName();
if (name.startsWith("set")) {
name = name.substring(3);
name = name.substring(0, 1... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\util\ReflectUtil.java | 1 |
请完成以下Java代码 | public Salary getSalary() {
return salary;
}
public void setSalary(Salary salary) {
this.salary = salary;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public LocalDate getDateOfJoining() {
return dateOfJoini... | return employeeNumber;
}
public void setEmployeeNumber(PhoneNumber employeeNumber) {
this.employeeNumber = employeeNumber;
}
public Address getEmpAddress() {
return empAddress;
}
public void setEmpAddress(Address empAddress) {
this.empAddress = empAddress;
}
} | repos\tutorials-master\persistence-modules\hibernate-annotations\src\main\java\com\baeldung\hibernate\customtypes\OfficeEmployee.java | 1 |
请完成以下Java代码 | public Object getPersistentState() {
return new PersistentState(name, bytes);
}
@Override
public int getRevisionNext() {
return revision + 1;
}
// getters and setters //////////////////////////////////////////////////////
@Override
public String getId() {
return id... | this.revision = revision;
}
@Override
public String toString() {
return "ByteArrayEntity[id=" + id + ", name=" + name + ", size=" + (bytes != null ? bytes.length : 0) + "]";
}
// Wrapper for a byte array, needed to do byte array comparisons
// See https://activiti.atlassian.net/browse/... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\ByteArrayEntity.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class WebClientController {
@ResponseStatus(HttpStatus.OK)
@GetMapping("/resource")
public Map<String, String> getResource() {
Map<String, String> response = new HashMap<>();
response.put("field", "value");
return response;
}
@PostMapping("/resource")
public Mono... | @PostMapping("/resource-override")
public Mono<String> postStringResourceOverride(@RequestBody Mono<String> bodyString) {
return bodyString.map(body -> "override-processed-" + body);
}
@PostMapping("/resource-foo")
public Mono<String> postFooResource(@RequestBody Mono<Foo> bodyFoo) {
re... | repos\tutorials-master\spring-reactive-modules\spring-reactive\src\main\java\com\baeldung\reactive\webclient\WebClientController.java | 2 |
请完成以下Java代码 | public class RetourenavisAnfrageType {
@XmlElement(name = "Position", required = true)
protected List<RetourePositionType> position;
@XmlAttribute(name = "ID", required = true)
protected String id;
@XmlAttribute(name = "RetoureSupportID", required = true)
protected int retoureSupportID;
/*... | public String getID() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setID(String value) {
this.id = value;
}
/**
* Gets the value of the retoureSu... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.schema.v2\src\main\java-xjc\de\metas\vertical\pharma\vendor\gateway\msv3\schema\v2\RetourenavisAnfrageType.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JpaOrder extends AbstractEntity
{
@Column(name = "mf_bpartner_id")
@NotNull
private Integer mfBpartnerId;
@Column(name = "mf_bpartnerlocation_id")
@NotNull
private Integer mfBpartnerLocationId;
@NotNull
private String documentNo;
@NotNull
private Integer supportId;
@NotNull
private Boolean ni... | public void addOrderPackages(@NonNull final List<JpaOrderPackage> orderPackages)
{
orderPackages.forEach(orderPackage -> orderPackage.setOrder(this));
this.orderPackages.addAll(orderPackages);
}
public void visitItems(@NonNull final Consumer<JpaOrderPackageItem> consumer)
{
orderPackages.stream()
.flatMa... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.server\src\main\java\de\metas\vertical\pharma\msv3\server\order\jpa\JpaOrder.java | 2 |
请完成以下Java代码 | public void showCodeSnippetCommentsFormattingUsingCodeAndLiteralTag() {
// do nothing
}
/**
* This is an example to illustrate a basic jQuery code snippet embedded in documentation comments
* <pre>
* {@code <script>}
* $document.ready(function(){
* console.log("Hello World!... | // do nothing
}
/**
* This is an example to illustrate an HTML code snippet embedded in documentation comments
* <pre>
* <html>
* <body>
* <h1>Hello World!</h1>
* </body>
* </html>
* </pre>
*
*/
public void showHTMLCodeSnippetIssueUsingJavadoc() {
... | repos\tutorials-master\core-java-modules\core-java-documentation\src\main\java\com\baeldung\javadoc\CodeSnippetFormatting.java | 1 |
请完成以下Java代码 | public BigDecimal getCtrlSum() {
return ctrlSum;
}
/**
* Sets the value of the ctrlSum property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
*/
public void setCtrlSum(BigDecimal value) {
this.ctrlSum = value;
}
/**
... | /**
* Gets the value of the fwdgAgt property.
*
* @return
* possible object is
* {@link BranchAndFinancialInstitutionIdentification4 }
*
*/
public BranchAndFinancialInstitutionIdentification4 getFwdgAgt() {
return fwdgAgt;
}
/**
* Sets the value... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\GroupHeader32CH.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_AD_Sequence getAD_Sequence()
{
return get_ValueAsPO(COLUMNNAME_AD_Sequence_ID, org.compiere.model.I_AD_Sequence.class);
}
@Override
public void setAD_Sequence(final org.compiere.model.I_AD_Sequence AD_Sequence)
{
set_ValueFromPO(COLUMNNAME_AD_Sequence_ID, org.compiere.model.I_AD_Se... | @Override
public void setCalendarYear (final java.lang.String CalendarYear)
{
set_ValueNoCheck (COLUMNNAME_CalendarYear, CalendarYear);
}
@Override
public java.lang.String getCalendarYear()
{
return get_ValueAsString(COLUMNNAME_CalendarYear);
}
@Override
public void setCurrentNext (final int CurrentNext... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Sequence_No.java | 1 |
请完成以下Java代码 | public String getClassName() {
return this.className;
}
public void setClassName(String className) {
this.className = className;
}
/**
* Return the init parameters used to configure the JSP servlet.
* @return the init parameters
*/
public Map<String, String> getInitParameters() {
return this.initPara... | this.initParameters = initParameters;
}
/**
* Return whether the JSP servlet is registered.
* @return {@code true} to register the JSP servlet
*/
public boolean getRegistered() {
return this.registered;
}
public void setRegistered(boolean registered) {
this.registered = registered;
}
} | repos\spring-boot-4.0.1\module\spring-boot-web-server\src\main\java\org\springframework\boot\web\server\servlet\Jsp.java | 1 |
请完成以下Java代码 | public class RequestReOpen extends JavaProcess
{
/** Request */
private int p_R_Request_ID = 0;
/**
* Prepare
*/
protected void prepare ()
{
ProcessInfoParameter[] para = getParametersAsArray();
for (int i = 0; i < para.length; i++)
{
String name = para[i].getParameterName();
if (para[i].get... | */
protected String doIt () throws Exception
{
MRequest request = new MRequest (getCtx(), p_R_Request_ID, get_TrxName());
log.info(request.toString());
if (request.get_ID() == 0)
throw new AdempiereUserError("@NotFound@ @R_Request_ID@ " + p_R_Request_ID);
request.setR_Status_ID(); // set default status
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\process\RequestReOpen.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Result delete(@RequestParam(name = "id") String id) {
Result result = new Result();
OssFile file = ossFileService.getById(id);
if (file == null) {
result.error500("未找到对应实体");
}else {
boolean ok = ossFileService.delete(file);
result.success("删除成功!");
}
return result;
}
/**
* 通过id查询.
*/ | @ResponseBody
@GetMapping("/queryById")
public Result<OssFile> queryById(@RequestParam(name = "id") String id) {
Result<OssFile> result = new Result<>();
OssFile file = ossFileService.getById(id);
if (file == null) {
result.error500("未找到对应实体");
}
else {
result.setResult(file);
result.setSuccess(tru... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\oss\controller\OssFileController.java | 2 |
请完成以下Java代码 | private static <T> T fromObjectTo(
@NonNull final Object valueObj,
@NonNull final Class<T> type,
@NonNull final Function<String, T> fromJsonConverter,
@NonNull final Function<Object, T> fromObjectConverter)
{
if (type.isInstance(valueObj))
{
return type.cast(valueObj);
}
else if (valueObj instan... | {
final Timestamp timestamp = Timestamp.valueOf(json);
return fromObjectConverter.apply(timestamp);
}
else
{
return fromJsonConverter.apply(json);
}
}
else
{
return fromObjectConverter.apply(valueObj);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\util\converter\DateTimeConverters.java | 1 |
请完成以下Java代码 | protected void registerTabCallouts(final ITabCalloutFactory tabCalloutsRegistry)
{
// nothing on this level
}
/**
* Called onInit to setup module table callouts
*
* @param calloutsRegistry
*/
protected void registerCallouts(@NonNull final IProgramaticCalloutProvider calloutsRegistry)
{
// nothing on t... | protected Set<String> getTableNamesToSkipOnMigrationScriptsLogging() {return ImmutableSet.of();}
@Override
public void onUserLogin(final int AD_Org_ID, final int AD_Role_ID, final int AD_User_ID)
{
// nothing
}
/**
* Does nothing. Module interceptors are not allowed to intercept models or documents
*/
@Ov... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\modelvalidator\AbstractModuleInterceptor.java | 1 |
请完成以下Java代码 | public java.lang.String getPhone ()
{
return (java.lang.String)get_Value(COLUMNNAME_Phone);
}
/** Set Verarbeitet.
@param Processed
Checkbox sagt aus, ob der Beleg verarbeitet wurde.
*/
@Override
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Process... | }
/** Get Role name.
@return Role name */
@Override
public java.lang.String getRoleName ()
{
return (java.lang.String)get_Value(COLUMNNAME_RoleName);
}
/** Set UserValue.
@param UserValue UserValue */
@Override
public void setUserValue (java.lang.String UserValue)
{
set_Value (COLUMNNAME_UserVal... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_User.java | 1 |
请完成以下Java代码 | public Map<String, DataObject> getDataObjects(String taskId) {
return commandExecutor.execute(new GetTaskDataObjectsCmd(taskId, null));
}
@Override
public Map<String, DataObject> getDataObjects(String taskId, String locale, boolean withLocalizationFallback) {
return commandExecutor.execute(... | @Override
public DataObject getDataObject(String taskId, String dataObject) {
return commandExecutor.execute(new GetTaskDataObjectCmd(taskId, dataObject));
}
@Override
public DataObject getDataObject(
String taskId,
String dataObjectName,
String locale,
boolean w... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\TaskServiceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Boolean hSetAll(String key, Map<String, Object> map, long time) {
redisTemplate.opsForHash().putAll(key, map);
return expire(key, time);
}
@Override
public void hSetAll(String key, Map<String, ?> map) {
redisTemplate.opsForHash().putAll(key, map);
}
@Override
pub... | public Object lIndex(String key, long index) {
return redisTemplate.opsForList().index(key, index);
}
@Override
public Long lPush(String key, Object value) {
return redisTemplate.opsForList().rightPush(key, value);
}
@Override
public Long lPush(String key, Object value, long ti... | repos\mall-master\mall-common\src\main\java\com\macro\mall\common\service\impl\RedisServiceImpl.java | 2 |
请完成以下Java代码 | public boolean isNoRecords()
{
return noRecords || toSqlAndParams() == SQL_ALWAYS_FALSE;
}
public SqlAndParams toSqlAndParams()
{
if (noRecords)
{
return SQL_ALWAYS_FALSE;
}
else
{
SqlAndParams viewSelectionWhereClause;
if (rowsPresentInViewSelection == null || rowsPresentInViewSelection.isEmp... | public <T> IQueryFilter<T> toQueryFilter()
{
final SqlAndParams sqlAndParams = toSqlAndParams();
return TypedSqlQueryFilter.of(sqlAndParams.getSql(), sqlAndParams.getSqlParams());
}
public SqlViewRowsWhereClause withRowsNotPresentInViewSelection()
{
return !this.isRowsNotPresentInViewSelection
? toBuilde... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\descriptor\SqlViewRowsWhereClause.java | 1 |
请完成以下Java代码 | public Collection<Column> getColumns() {
return columnCollection.get(this);
}
public Collection<Row> getRows() {
return rowCollection.get(this);
}
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Relation.class, DMN_ELEMENT_... | }
});
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
columnCollection = sequenceBuilder.elementCollection(Column.class)
.build();
rowCollection = sequenceBuilder.elementCollection(Row.class)
.build();
typeBuilder.build();
}
} | repos\camunda-bpm-platform-master\model-api\dmn-model\src\main\java\org\camunda\bpm\model\dmn\impl\instance\RelationImpl.java | 1 |
请完成以下Java代码 | public class Order {
private final String orderId;
private final Map<String, Integer> products;
private OrderStatus orderStatus;
public Order(String orderId) {
this.orderId = orderId;
this.products = new HashMap<>();
orderStatus = OrderStatus.CREATED;
}
public String g... | this.orderStatus = OrderStatus.SHIPPED;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Order that = (Order) o;
return Objects.equals(orderId,... | repos\tutorials-master\patterns-modules\axon\src\main\java\com\baeldung\axon\coreapi\queries\Order.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Job cantonJob(JobBuilderFactory jobBuilderFactory, @Qualifier("cantonStep1") Step s1) {
return jobBuilderFactory.get("cantonJob")
.incrementer(new RunIdIncrementer())
.flow(s1)//为Job指定Step
.end()
.listener(new MyJobListener())//绑定监听器csvJobLi... | .reader(reader)//给step绑定reader
.processor(processor)//给step绑定processor
.writer(writer)//给step绑定writer
.faultTolerant()
.retry(Exception.class) // 重试
.noRetry(ParseException.class)
.retryLimit(1) //每条记录重试一次
... | repos\SpringBootBucket-master\springboot-batch\src\main\java\com\xncoding\trans\modules\canton\CantonConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Action<Chain> download() {
return chain -> chain.get("download", ctx -> {
ctx.getResponse().sendStream(new RandomBytesPublisher(1024,512));
});
}
@Bean
public Action<Chain> downloadChunks() {
return chain -> chain.get("downloadChunks", ctx -> {
ctx.ren... | recurse = true;
try {
while ( requested-- > 0 && !cancelled && bufCount-- > 0 ) {
byte[] data = new byte[bufSize];
rnd.nextBytes(data);
ByteBuf buf = Unpooled.wrappedBuffer(data);
... | repos\tutorials-master\web-modules\ratpack\src\main\java\com\baeldung\spring\EmbedRatpackStreamsApp.java | 2 |
请完成以下Java代码 | public final class ALoginRes_ca extends ListResourceBundle
{
// TODO Run native2ascii to convert to plain ASCII !!
/** Translation Content */
static final Object[][] contents = new String[][]
{
{ "Connection", "Connexi\u00f3" },
{ "Defaults", "Valors Predeterminats" },
{ "Login", ... | { "UserPwdError", "No coincideix l'Usuari i la Contrasenya" },
{ "RoleNotFound", "Rol no trobat/completat" },
{ "Authorized", "Autoritzat" },
{ "Ok", "Acceptar" },
{ "Cancel", "Cancel.lar" },
{ "VersionConflict", "Conflicte Versions:" },
{ "VersionInfo", "... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\apps\ALoginRes_ca.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private Dashboard getOrCreateMonitoringDashboard() {
Dashboard existing = findDashboardByTitle(DASHBOARD_TITLE).orElse(null);
if (existing != null) {
log.debug("Found Monitoring dashboard '{}' with id {}", existing.getTitle(), existing.getId());
return existing;
}
... | return String.format("%s/dashboard/%s?publicId=%s", base, dashboardId.getId().toString(), publicCustomerId);
}
private String getBaseUrl() {
// TbClient.baseURL contains the root url, without trailing slash
try {
var baseUrlField = tbClient.getClass().getSuperclass().getDeclaredFiel... | repos\thingsboard-master\monitoring\src\main\java\org\thingsboard\monitoring\service\MonitoringEntityService.java | 2 |
请完成以下Java代码 | public final class AuthenticationObservationConvention
implements ObservationConvention<AuthenticationObservationContext> {
static final String OBSERVATION_NAME = "spring.security.authentications";
/**
* {@inheritDoc}
*/
@Override
public String getName() {
return OBSERVATION_NAME;
}
@Override
public S... | }
return context.getAuthenticationManagerClass().getSimpleName();
}
private String getAuthenticationResult(AuthenticationObservationContext context) {
if (context.getAuthenticationResult() == null) {
return "n/a";
}
return context.getAuthenticationResult().getClass().getSimpleName();
}
private String g... | repos\spring-security-main\core\src\main\java\org\springframework\security\authentication\AuthenticationObservationConvention.java | 1 |
请完成以下Java代码 | public void setFinishedBefore(Date finishedBefore) {
this.finishedBefore = finishedBefore;
}
@CamundaQueryParam(value = "processInstanceIdIn", converter = StringArrayConverter.class)
public void setProcessInstanceIdIn(String[] processInstanceIdIn) {
this.processInstanceIdIn = processInstanceIdIn;
}
... | query.includeIncidents();
}
if (startedAfter != null) {
query.startedAfter(startedAfter);
}
if (startedBefore != null) {
query.startedBefore(startedBefore);
}
if (finishedAfter != null) {
query.finishedAfter(finishedAfter);
}
if (finishedBefore != null) {
quer... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\history\HistoricActivityStatisticsQueryDto.java | 1 |
请完成以下Java代码 | public void closeView(@NonNull final ViewId viewId, @NonNull final ViewCloseAction closeAction)
{
getViewsStorageFor(viewId).closeById(viewId, closeAction);
logger.trace("Closed/Removed view {} using close action {}", viewId, closeAction);
}
@Override
public void invalidateView(final ViewId viewId)
{
getVie... | if (views.isEmpty())
{
return;
}
final MutableInt notifiedCount = MutableInt.zero();
for (final IView view : views)
{
try
{
final boolean watchedByFrontend = isWatchedByFrontend(view.getViewId());
view.notifyRecordsChanged(recordRefs, watchedByFrontend);
notifiedCount.incrementAndGet();
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\ViewsRepository.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable Duration getTimeout() {
return this.timeout;
}
public void setTimeout(@Nullable Duration timeout) {
this.timeout = timeout;
}
public Servlet getServlet() {
return this.servlet;
}
public void setServlet(Servlet servlet) {
this.servlet = servlet;
}
/**
* Determine the session timeou... | public int getFilterOrder() {
return this.filterOrder;
}
public void setFilterOrder(int filterOrder) {
this.filterOrder = filterOrder;
}
public Set<DispatcherType> getFilterDispatcherTypes() {
return this.filterDispatcherTypes;
}
public void setFilterDispatcherTypes(Set<DispatcherType> filterDis... | repos\spring-boot-4.0.1\module\spring-boot-session\src\main\java\org\springframework\boot\session\autoconfigure\SessionProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void createEngineProperty(@RequestBody PropertyRequestBody propertyRequestBody) {
validateAccessToProperties();
Map<String, String> properties = managementService.getProperties();
String propertyName = propertyRequestBody.getName();
if (properties.containsKey(propertyName)) {
... | protected String name;
protected String value;
public PropertyRequestBody() {
}
public PropertyRequestBody(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\management\EnginePropertiesResource.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + (contractValue == null ? 0 : contractValue.hashCode());
result = prime * result + (messageNo == null ? 0 : messageNo.hashCode());
result = prime * result + (partner == null ? 0 : partner.hashCode());
result = prime * re... | {
return false;
}
}
else if (!partner.equals(other.partner))
{
return false;
}
if (record == null)
{
if (other.record != null)
{
return false;
}
}
else if (!record.equals(other.record))
{
return false;
}
return true;
}
@Override
public String toString()
{
return "T... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\ordersimport\compudata\T100.java | 2 |
请完成以下Java代码 | public void setEMailCount (final int EMailCount)
{
throw new IllegalArgumentException ("EMailCount is virtual column"); }
@Override
public int getEMailCount()
{
return get_ValueAsInt(COLUMNNAME_EMailCount);
}
@Override
public void setFileName (final @Nullable String FileName)
{
set_Value (COLUMNNAME_Fi... | }
@Override
public void setPrintCount (final int PrintCount)
{
throw new IllegalArgumentException ("PrintCount is virtual column"); }
@Override
public int getPrintCount()
{
return get_ValueAsInt(COLUMNNAME_PrintCount);
}
@Override
public void setRecord_ID (final int Record_ID)
{
if (Record_ID < 0)
... | 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 POSTerminalId implements RepoIdAware
{
int repoId;
private POSTerminalId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "C_POS_ID");
}
public static POSTerminalId ofRepoId(final int repoId)
{
return new POSTerminalId(repoId);
}
@JsonCreator
public static POSTerminalId... | }
public static int toRepoId(@Nullable final OrderId id)
{
return id != null ? id.getRepoId() : -1;
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public static boolean equals(@Nullable final POSTerminalId id1, @Nullable final POSTerminalId id2)
{
return Objects.equals(id1, id2);
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSTerminalId.java | 2 |
请完成以下Java代码 | public boolean isPostalValidated()
{
return get_ValueAsBoolean(COLUMNNAME_IsPostalValidated);
}
@Override
public void setLatitude (final @Nullable BigDecimal Latitude)
{
set_Value (COLUMNNAME_Latitude, Latitude);
}
@Override
public BigDecimal getLatitude()
{
final BigDecimal bd = get_ValueAsBigDecima... | set_ValueNoCheck (COLUMNNAME_Postal, Postal);
}
@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 j... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Location.java | 1 |
请完成以下Java代码 | private void processCURow(final HUEditorRow selectedCuRow)
{
final ArrayList<String> availableSerialNumbers = getSerialNumbers();
if (availableSerialNumbers.isEmpty())
{
return;
}
final HUEditorRow parentRow = getParentHURowOrNull(selectedCuRow);
final HUEditorRow topLevelRow = parentRow == null ? nul... | }
/** @return true if view was changed and needs invalidation */
private final boolean removeSelectedRowsIfHUDestoyed()
{
final DocumentIdsSelection selectedRowIds = getSelectedRowIds();
if (selectedRowIds.isEmpty())
{
return false;
}
else if (selectedRowIds.isAll())
{
return false;
}
final H... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\process\WEBUI_Add_Batch_SerialNo_To_CUs.java | 1 |
请完成以下Java代码 | 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 Summary Level.
@param IsSummary
This is a summary entity
*/
public void set... | @return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
public I_AD_User getSalesRep() throws RuntimeException
{
return (I_AD_User)MTable.get(getCtx(), I_AD_User.Table_Name)
.getPO(getSalesRep_ID(), get_TrxName()); }
/** ... | 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 CompensationEventSubscriptionWalker extends ReferenceWalker<EventSubscriptionEntity> {
public CompensationEventSubscriptionWalker(Collection<MigratingActivityInstance> collection) {
super(collectCompensationEventSubscriptions(collection));
}
protected static List<EventSubscriptionEntity> collec... | }
@Override
protected Collection<EventSubscriptionEntity> nextElements() {
EventSubscriptionEntity eventSubscriptionEntity = getCurrentElement();
ExecutionEntity compensatingExecution = CompensationUtil.getCompensatingExecution(eventSubscriptionEntity);
if (compensatingExecution != null) {
return... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\migration\instance\parser\CompensationEventSubscriptionWalker.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public int hashCode() {
int result = nullSafeHashCode(this.itemType);
result = 31 * result + nullSafeHashCode(this.name);
result = 31 * result + nullSafeHashCode(this.type);
result = 31 * result + nullSafeHashCode(this.description);
result = 31 * result + nullSafeHashCode(this.sourceType);
result = 31 * res... | public static ItemMetadata newProperty(String prefix, String name, String type, String sourceType,
String sourceMethod, String description, Object defaultValue, ItemDeprecation deprecation) {
return new ItemMetadata(ItemType.PROPERTY, prefix, name, type, sourceType, sourceMethod, description,
defaultValue, dep... | repos\spring-boot-4.0.1\configuration-metadata\spring-boot-configuration-processor\src\main\java\org\springframework\boot\configurationprocessor\metadata\ItemMetadata.java | 2 |
请完成以下Java代码 | public AssignableInvoiceCandidate withoutRefundInvoiceCandidates()
{
return toBuilder()
.clearAssignmentsToRefundCandidates()
.build();
}
public boolean isAssigned()
{
return !assignmentsToRefundCandidates.isEmpty();
}
public SplitResult splitQuantity(@NonNull final BigDecimal qtyToSplit)
{
Check... | final Money remainderMoney = money.subtract(newMoney);
final AssignableInvoiceCandidate remainderCandidate = toBuilder()
.quantity(remainderQuantity)
.money(remainderMoney)
.build();
final AssignableInvoiceCandidate newCandidate = toBuilder()
.id(id)
.quantity(newQuantity)
.money(newMoney)... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\refund\AssignableInvoiceCandidate.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Employee {
@Id
private int id;
private String name;
@ElementCollection
@CollectionTable(name = "employee_phone", joinColumns = @JoinColumn(name = "employee_id"))
private List<Phone> phones;
public Employee() {
}
public Employee(int id) {
this.id = id;
}
... | public void setName(String name) {
this.name = name;
}
public List<Phone> getPhones() {
return phones;
}
public void setPhones(List<Phone> phones) {
this.phones = phones;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true... | repos\tutorials-master\persistence-modules\spring-data-jpa-enterprise-2\src\main\java\com\baeldung\elementcollection\model\Employee.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public V get(Object key) {
if (!this.loaders.containsKey(key)) {
throw new IllegalArgumentException(
"This map only supports the following keys: " + this.loaders.keySet());
}
return this.loaded.computeIfAbsent((K) key, (k) -> this.loaders.get(k).get());
}
@Override
public V put(K key, V value)... | @Override
public Set<Entry<K, V>> entrySet() {
return this.loaded.entrySet();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LoadingMap<?, ?> that = (LoadingMap<?, ?>) o;
return this.loa... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configuration\SecurityReactorContextConfiguration.java | 2 |
请完成以下Java代码 | public String buildStorageInvoiceHistorySQL(final boolean showDetail, final int warehouseId, final int asiId)
{
final StringBuilder sql;
if (showDetail)
{
sql = new StringBuilder("SELECT s.QtyOnHand, s.QtyReserved, s.QtyOrdered, asi.description, s.M_AttributeSetInstance_ID, ");
}
else
{
sql = new Str... | sql.append(" AND s.M_AttributeSetInstance_ID=?");
}
sql.append(" AND (s.QtyOnHand<>0 OR s.QtyReserved<>0 OR s.QtyOrdered<>0)");
if (!showDetail)
{
sql.append(" GROUP BY asi.description, w.Name, l.Value");
}
sql.append(" ORDER BY l.Value");
return sql.toString();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\apps\search\dao\impl\InvoiceHistoryDAO.java | 1 |
请完成以下Java代码 | public Collection<? extends GrantedAuthority> getAuthorities() {
List<SimpleGrantedAuthority> authorities = new ArrayList<>();
for (Role role : roles) {
authorities.add(new SimpleGrantedAuthority(role.getName()));
}
return authorities;
}
@Override
public String ... | public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
// public Boolean getEnabled() {
// return enabled;
// }
public void setEnabled(Boolean enabled) {
this.enabled = enabl... | repos\springboot-demo-master\security\src\main\java\com\et\security\entity\User.java | 1 |
请完成以下Java代码 | public PageData<QueueStats> findByTenantId(TenantId tenantId, PageLink pageLink) {
log.trace("Executing findByTenantId, tenantId: [{}]", tenantId);
Validator.validatePageLink(pageLink);
return queueStatsDao.findAllByTenantId(tenantId, pageLink);
}
@Override
public void deleteByTenan... | @Override
public Optional<HasId<?>> findEntity(TenantId tenantId, EntityId entityId) {
return Optional.ofNullable(findQueueStatsById(tenantId, new QueueStatsId(entityId.getId())));
}
@Override
public FluentFuture<Optional<HasId<?>>> findEntityAsync(TenantId tenantId, EntityId entityId) {
... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\queue\BaseQueueStatsService.java | 1 |
请完成以下Java代码 | protected boolean isCreateMessageIds() {
return this.createMessageIds;
}
@Override
public final Message toMessage(Object object, MessageProperties messageProperties)
throws MessageConversionException {
return toMessage(object, messageProperties, null);
}
@Override
public final Message toMessage(Object o... | * @param messageProperties the message properties (headers)
* @param genericType the type to convert from - used to populate type headers.
* @return a message
* @since 2.1
*/
protected Message createMessage(Object object, MessageProperties messageProperties, @Nullable Type genericType) {
return createMessage... | repos\spring-amqp-main\spring-amqp\src\main\java\org\springframework\amqp\support\converter\AbstractMessageConverter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DistributionNetworkAndLineId
{
@NonNull DistributionNetworkId networkId;
@NonNull DistributionNetworkLineId lineId;
public static DistributionNetworkAndLineId of(final DistributionNetworkId ddNetworkDistributionId, final DistributionNetworkLineId ddNetworkDistributionLineId)
{
return new Distributio... | final DistributionNetworkLineId lineId = DistributionNetworkLineId.ofRepoIdOrNull(ddNetworkDistributionLineRepoId);
if (lineId == null)
{
return null;
}
return of(networkId, lineId);
}
public static Optional<DistributionNetworkAndLineId> optionalOfRepoIds(final int ddNetworkDistributionRepoId, final int ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\material\planning\ddorder\DistributionNetworkAndLineId.java | 2 |
请完成以下Spring Boot application配置 | dubbo:
application:
# 应用名称
name: dubbo-provider
protocol:
# 协议名称
name: dubbo
# 协议端口
port: 20880
registry:
# 注册中心地址
address: zookeeper://127.0.0.1:2181
ser | ver:
# 修改端口号,避免端口冲突
port: 8081
logging:
config: classpath:logback-spring.xml | repos\springboot-demo-master\dubbo\dubbo-samples-spring-boot-provider\src\main\resources\application.yaml | 2 |
请完成以下Java代码 | public class OAuth2GrantedAuthoritiesMapper implements GrantedAuthoritiesMapper {
private static final Logger logger = LoggerFactory.getLogger(OAuth2GrantedAuthoritiesMapper.class);
private final OAuth2Properties oAuth2Properties;
public OAuth2GrantedAuthoritiesMapper(OAuth2Properties oAuth2Properties) {
th... | .map(SimpleGrantedAuthority::new)
.collect(Collectors.toSet());
mappedAuthorities.addAll(grantedAuthorities);
} else if (groupAttribute instanceof String) {
String groupNameDelimiter = identityProviderProperties.getGroupNameDelimiter();
String groupsAttribute = (Strin... | repos\camunda-bpm-platform-master\spring-boot-starter\starter-security\src\main\java\org\camunda\bpm\spring\boot\starter\security\oauth2\impl\OAuth2GrantedAuthoritiesMapper.java | 1 |
请完成以下Java代码 | private void fireAllEventsProcessedCheck(@NonNull final EventDescriptor eventDescriptor)
{
Check.assumeNotNull(eventDescriptor.getTraceId(), "eventDescriptor.getTraceId() is not null; eventDescriptor={}", eventDescriptor);
trxManager
.getCurrentTrxListenerManagerOrAutoCommit()
.newEventListener(ITrxListen... | if (eventProgress.areAllEventsProcessed())
{
notifyLocalAndRemoteObserver(eventDescriptor);
}
}
private void notifyLocalAndRemoteObserver(@NonNull final EventDescriptor eventDescriptor)
{
final AllEventsProcessedEvent allEventsProcessedEvent = AllEventsProcessedEvent.builder()
.eventDescriptor(eventDes... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\MaterialEventObserver.java | 1 |
请完成以下Java代码 | public int getAD_Role_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Role_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Included Role.
@param AD_Role_Included_ID Included Role */
@Override
public void setAD_Role_Included_ID (int AD_Role_Included_ID)
{
if (AD_Role_Included... | return 0;
return ii.intValue();
}
/** Set Sequence.
@param SeqNo
Method of ordering records; lowest number comes first
*/
@Override
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Sequence.
@return Method of ordering records; lowest number comes ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Role_Included.java | 1 |
请完成以下Java代码 | public ExecutionInfo getExecutionInfo() {
return delegate.getExecutionInfo();
}
@Override
public int remaining() {
return delegate.remaining();
}
@NonNull
@Override
public Iterable<Row> currentPage() {
return delegate.currentPage();
}
@Override
public b... | List<Row> allRows,
SettableFuture<List<Row>> resultFuture,
Executor executor) {
allRows.addAll(loadRows(resultSet));
if (resultSet.hasMorePages()) {
ByteBuffer nextPagingState = resultSet.getExecutionInfo().getPagingState();
... | repos\thingsboard-master\common\dao-api\src\main\java\org\thingsboard\server\dao\nosql\TbResultSet.java | 1 |
请完成以下Java代码 | public static class UpdateASIAttributeFromModelCommandBuilder
{
public void execute()
{
build().execute();
}
}
public void execute()
{
final IAttributeSetInstanceAware asiAware = attributeSetInstanceAwareFactoryService.createOrNull(sourceModel);
if (asiAware == null)
{
return;
}
final Produc... | final AttributeId attributeId = attributeDAO.retrieveActiveAttributeIdByValueOrNull(attributeCode);
if (attributeId == null)
{
return;
}
attributeSetInstanceBL.getCreateASI(asiAware);
final AttributeSetInstanceId asiId = AttributeSetInstanceId.ofRepoIdOrNull(asiAware.getM_AttributeSetInstance_ID());
fin... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\adempiere\mm\attributes\api\impl\UpdateASIAttributeFromModelCommand.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getSymbol() {
return symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
public BigDecimal getPrice() {
return price;
}
... | QuoteDTO quoteDTO = (QuoteDTO) o;
if (quoteDTO.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), quoteDTO.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toS... | repos\tutorials-master\jhipster-modules\jhipster-uaa\quotes\src\main\java\com\baeldung\jhipster\quotes\service\dto\QuoteDTO.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class ScannableCodeFormatRepository
{
@NotNull private final IQueryBL queryBL = Services.get(IQueryBL.class);
@NotNull private final CCache<Integer, ScannableCodeFormatsCollection> cache = CCache.<Integer, ScannableCodeFormatsCollection>builder()
.tableName(I_C_ScannableCode_Format.Table_Name)
.additiona... | .addInArrayFilter(I_C_ScannableCode_Format_Part.COLUMNNAME_C_ScannableCode_Format_ID, formatIds)
.create()
.delete();
return queryBL.createQueryBuilder(I_C_ScannableCode_Format.class)
.addInArrayFilter(I_C_ScannableCode_Format.COLUMNNAME_C_ScannableCode_Format_ID, formatIds)
.create()
.delete();
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\scannable_code\format\repository\ScannableCodeFormatRepository.java | 2 |
请完成以下Java代码 | boolean isAssignable(Class<?> clazz, Object value) {
return ClassUtils.isAssignableValue(clazz, value);
}
private void refreshCachedProperties() {
PropertySources propertySources = environment.getPropertySources();
propertySources.forEach(this::refreshPropertySource);
}
@Suppre... | private Class<?> getClassSafe(String className) {
try {
return ClassUtils.forName(className, null);
} catch (ClassNotFoundException e) {
return null;
}
}
/** {@inheritDoc} */
@Override
public void afterPropertiesSet() throws Exception {
Stream
... | repos\jasypt-spring-boot-master\jasypt-spring-boot\src\main\java\com\ulisesbocchio\jasyptspringboot\caching\RefreshScopeRefreshedEventListener.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected DeploymentWithDefinitions tryToRedeploy(RedeploymentDto redeployment) {
RepositoryService repositoryService = getProcessEngine().getRepositoryService();
DeploymentBuilder builder = repositoryService.createDeployment();
builder.nameFromDeployment(deploymentId);
String tenantId = getDeployment... | throw new InvalidRequestException(Status.NOT_FOUND, "Deployment with id '" + deploymentId + "' do not exist");
}
boolean cascade = isQueryPropertyEnabled(uriInfo, CASCADE);
boolean skipCustomListeners = isQueryPropertyEnabled(uriInfo, "skipCustomListeners");
boolean skipIoMappings = isQueryPropertyEnab... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\repository\impl\DeploymentResourceImpl.java | 2 |
请完成以下Java代码 | public void setIsAutoProcess (final boolean IsAutoProcess)
{
set_Value (COLUMNNAME_IsAutoProcess, IsAutoProcess);
}
@Override
public boolean isAutoProcess()
{
return get_ValueAsBoolean(COLUMNNAME_IsAutoProcess);
}
@Override
public void setIsForbidAggCUsForDifferentOrders (final boolean IsForbidAggCUsForDi... | * WEBUI_PickingTerminal_ViewProfile AD_Reference_ID=540772
* Reference name: WEBUI_PickingTerminal_ViewProfile
*/
public static final int WEBUI_PICKINGTERMINAL_VIEWPROFILE_AD_Reference_ID=540772;
/** groupByProduct = groupByProduct */
public static final String WEBUI_PICKINGTERMINAL_VIEWPROFILE_GroupByProduct = ... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\picking\model\X_M_Picking_Config.java | 1 |
请完成以下Java代码 | public AuthorRecord value1(Integer value) {
setId(value);
return this;
}
@Override
public AuthorRecord value2(String value) {
setFirstName(value);
return this;
}
@Override
public AuthorRecord value3(String value) {
setLastName(value);
return this... | }
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached AuthorRecord
*/
public AuthorRecord() {
super(Author.AUTHOR);
}
/**
* ... | repos\tutorials-master\persistence-modules\jooq\src\main\java\com\baeldung\jooq\model\tables\records\AuthorRecord.java | 1 |
请完成以下Java代码 | public class TemplateDefinition {
public enum TemplateType {
VARIABLE,
FILE,
}
private String from;
private String subject;
private TemplateType type;
private String value;
TemplateDefinition() {}
public TemplateDefinition(TemplateType type, String value) {
... | public TemplateType getType() {
return type;
}
public void setType(TemplateType type) {
this.type = type;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TemplateDefinition ... | repos\Activiti-develop\activiti-core\activiti-spring-process-extensions\src\main\java\org\activiti\spring\process\model\TemplateDefinition.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserApi {
@Autowired
UserService userService;
@Autowired
TokenService tokenService;
//登录
@PostMapping("/login")
public Object login( User user){
JSONObject jsonObject=new JSONObject();
User userForBase=userService.findByUsername(user);
if(userForBase==nul... | String token = tokenService.getToken(userForBase);
jsonObject.put("token", token);
jsonObject.put("user", userForBase);
return jsonObject;
}
}
}
@UserLoginToken
@GetMapping("/getMessage")
//登录注解,说明该接口必须登录获取token后,在请求头中加上token并通过验证才... | repos\springboot-demo-master\jwt\src\main\java\com\et\jwt\api\UserApi.java | 2 |
请完成以下Java代码 | private IDunnableDoc createDunnableDoc(
@NonNull final IDunningContext context,
@NonNull final I_C_Dunning_Candidate_Invoice_v1 candidate)
{
final int invoiceId = candidate.getC_Invoice_ID();
final int invoicePayScheduleId = candidate.getC_InvoicePaySchedule_ID();
final int adClientId = candidate.getAD_Cli... | PaymentTermId.ofRepoId(paymentTermId),
dateInvoiced,
context.getDunningDate());
}
final IDunnableDoc dunnableDoc = new DunnableDoc(tableName,
recordId,
documentNo, // FRESH-504 DocumentNo is also needed
adClientId,
adOrgId,
bpartnerId,
bpartnerLocationId,
contactId,
curren... | repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java\de\metas\dunning\invoice\spi\impl\InvoiceSource.java | 1 |
请完成以下Java代码 | private static AdTabId extractTabId(final I_AD_UI_Section from) {return AdTabId.ofRepoId(from.getAD_Tab_ID());}
private static ImmutableSet<AdUISectionId> extractUISectionIds(final Collection<I_AD_UI_Section> uiSections)
{
return uiSections.stream().map(DAOWindowUIElementsProvider::extractUISectionId).distinct().c... | private static AdUIElementGroupId extractUIElementGroupId(final I_AD_UI_ElementGroup from) {return AdUIElementGroupId.ofRepoId(from.getAD_UI_ElementGroup_ID());}
private static AdUIElementGroupId extractUIElementGroupId(final I_AD_UI_Element from) {return AdUIElementGroupId.ofRepoId(from.getAD_UI_ElementGroup_ID());}... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\factory\standard\DAOWindowUIElementsProvider.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CostClassificationId implements RepoIdAware
{
@JsonCreator
public static CostClassificationId ofRepoId(final int repoId)
{
return new CostClassificationId(repoId);
}
@Nullable
public static CostClassificationId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? new CostClassificationId(repo... | int repoId;
private CostClassificationId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "repoId");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public static boolean equals(@Nullable final CostClassificationId id1, @Nullable final CostClassificationId id2) {ret... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\cost\classification\CostClassificationId.java | 2 |
请完成以下Java代码 | public BigDecimal getESR_Control_Amount()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_ESR_Control_Amount);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setESR_Control_Trx_Qty (final @Nullable BigDecimal ESR_Control_Trx_Qty)
{
set_Value (COLUMNNAME_ESR_Control_Trx_Qty, ESR_... | public void setIsReceipt (final boolean IsReceipt)
{
set_Value (COLUMNNAME_IsReceipt, IsReceipt);
}
@Override
public boolean isReceipt()
{
return get_ValueAsBoolean(COLUMNNAME_IsReceipt);
}
@Override
public void setIsReconciled (final boolean IsReconciled)
{
set_Value (COLUMNNAME_IsReconciled, IsRecon... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java-gen\de\metas\payment\esr\model\X_ESR_Import.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class QueueProcessorService
{
private final ITrxManager trxManager = Services.get(ITrxManager.class);
private final IAsyncBatchBL asyncBatchBL = Services.get(IAsyncBatchBL.class);
@NonNull
private final AsyncBatchObserver asyncBatchObserver;
public QueueProcessorService(final @NonNull AsyncBatchObserver a... | return;
}
final AsyncProcessorPlanner asyncProcessorPlanner = new AsyncProcessorPlanner();
try
{
asyncProcessorPlanner.addQueueProcessor(queueProcessor);
asyncProcessorPlanner.start();
asyncBatchObserver.observeOn(asyncBatchId);
asyncBatchObserver.waitToBeProcessed(asyncBatchId);
}
finally
{... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\processor\impl\QueueProcessorService.java | 2 |
请完成以下Java代码 | public class InMemoryReactiveSessionRegistry implements ReactiveSessionRegistry {
private final ConcurrentMap<Object, Set<String>> sessionIdsByPrincipal;
private final Map<String, ReactiveSessionInformation> sessionById;
public InMemoryReactiveSessionRegistry() {
this.sessionIdsByPrincipal = new ConcurrentHashM... | return Mono.justOrEmpty(this.sessionById.get(sessionId));
}
@Override
public Mono<ReactiveSessionInformation> removeSessionInformation(String sessionId) {
return getSessionInformation(sessionId).doOnNext((sessionInformation) -> {
this.sessionById.remove(sessionId);
Set<String> sessionsUsedByPrincipal = this... | repos\spring-security-main\core\src\main\java\org\springframework\security\core\session\InMemoryReactiveSessionRegistry.java | 1 |
请完成以下Java代码 | public void setR_Status_Value (String R_Status_Value)
{
set_Value (COLUMNNAME_R_Status_Value, R_Status_Value);
}
/** Get Request Status.
@return Request Status */
public String getR_Status_Value ()
{
return (String)get_Value(COLUMNNAME_R_Status_Value);
}
public I_AD_User getSalesRep() throws RuntimeEx... | */
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 getSale... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\callcenter\model\X_RV_R_Group_Prospect.java | 1 |
请完成以下Java代码 | private static SessionFactory buildSessionFactory(Strategy strategy) {
try {
ServiceRegistry serviceRegistry = configureServiceRegistry();
MetadataSources metadataSources = new MetadataSources(serviceRegistry);
for (Class<?> entityClass : strategy.getEntityClasses()) {
... | Metadata metadata = metadataSources.getMetadataBuilder()
.build();
return metadata.getSessionFactoryBuilder()
.build();
}
private static ServiceRegistry configureServiceRegistry() throws IOException {
Properties properties = getProperties();
return new Sta... | repos\tutorials-master\persistence-modules\hibernate-mapping\src\main\java\com\baeldung\hibernate\HibernateUtil.java | 1 |
请完成以下Java代码 | private static <T> HashSet<T> collectValueIfNotNull(@Nullable HashSet<T> collector, @Nullable T value)
{
if (value == null)
{
return collector;
}
if (collector == null)
{
collector = new HashSet<>();
}
collector.add(value);
return collector;
}
private static HashSet<Integer> collectValueIfPo... | private static int singleElementOrZero(@Nullable HashSet<Integer> collection)
{
if (collection == null)
{
return 0;
}
if (collection.size() != 1)
{
return 0;
}
final Integer element = collection.iterator().next();
return element != null ? element : 0;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\document\dimension\Dimension.java | 1 |
请完成以下Java代码 | public boolean isApiReady() {
return toBooleanDefaultIfNull(edqsReady, false) && syncStatus == EdqsSyncStatus.FINISHED;
}
@JsonIgnore
public boolean isApiEnabled() {
return apiMode != null && (apiMode == EdqsApiMode.ENABLED || apiMode == EdqsApiMode.AUTO_ENABLED);
}
@Override
p... | public enum EdqsSyncStatus {
REQUESTED,
STARTED,
FINISHED,
FAILED
}
public enum EdqsApiMode {
ENABLED,
AUTO_ENABLED,
DISABLED,
AUTO_DISABLED
}
} | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\edqs\EdqsState.java | 1 |
请完成以下Java代码 | public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
URI requestUrl = exchange.getRequiredAttribute(GATEWAY_REQUEST_URL_ATTR);
String scheme = requestUrl.getScheme();
if (isAlreadyRouted(exchange) || !"stream".equals(scheme)) {
return chain.filter(exchange);
}
setAlreadyRouted(... | request.getQueryParams().toSingleValueMap());
// TODO: sanitize?
}
inputMessage = builder.copyHeaders(headers.toSingleValueMap()).build();
// TODO: output content type
boolean send = streamBridge.send(requestUrl.getHost(), inputMessage);
HttpStatus responseStatus = (send) ? HttpStatus.OK : HttpStat... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\StreamRoutingFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | SqlServerTimelyExecutor sqlServerTimelyExecutor(io.debezium.config.Configuration configuration) {
SqlServerTimelyExecutor sqlServerTimelyExecutor = new SqlServerTimelyExecutor();
DebeziumEngine<RecordChangeEvent<SourceRecord>> debeziumEngine = DebeziumEngine
.create(ChangeEventFormat.of(... | public void afterPropertiesSet() {
Assert.notNull(debeziumEngine, "DebeZiumEngine 不能为空!");
}
public enum ThreadPoolEnum {
/**
* 实例
*/
INSTANCE;
public static final String SQL_SERVER_LISTENER_POOL = "sql-server-listener-pool";
... | repos\springboot-demo-master\debezium\src\main\java\com\et\debezium\config\ChangeEventConfig.java | 2 |
请完成以下Java代码 | public int getPP_Cost_Collector_ImportAudit_ID()
{
return get_ValueAsInt(COLUMNNAME_PP_Cost_Collector_ImportAudit_ID);
}
@Override
public void setPP_Cost_Collector_ImportAuditItem_ID (int PP_Cost_Collector_ImportAuditItem_ID)
{
if (PP_Cost_Collector_ImportAuditItem_ID < 1)
set_ValueNoCheck (COLUMNNAME_PP... | }
@Override
public void setPP_Order_ID (int PP_Order_ID)
{
if (PP_Order_ID < 1)
set_Value (COLUMNNAME_PP_Order_ID, null);
else
set_Value (COLUMNNAME_PP_Order_ID, Integer.valueOf(PP_Order_ID));
}
@Override
public int getPP_Order_ID()
{
return get_ValueAsInt(COLUMNNAME_PP_Order_ID);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Cost_Collector_ImportAuditItem.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public enum QueryVariableOperation {
EQUALS("equals"), NOT_EQUALS("notEquals"), EQUALS_IGNORE_CASE("equalsIgnoreCase"), NOT_EQUALS_IGNORE_CASE("notEqualsIgnoreCase"), LIKE("like"), L... | }
public String getFriendlyName() {
return friendlyName;
}
public static QueryVariableOperation forFriendlyName(String friendlyName) {
for (QueryVariableOperation type : values()) {
if (type.friendlyName.equals(friendlyName)) {
return... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\engine\variable\QueryVariable.java | 2 |
请完成以下Java代码 | public Object execute(CommandContext commandContext) {
commandContext.getAuthorizationManager().checkCamundaAdminOrPermission(CommandChecker::checkDeleteLicenseKey);
final ResourceManager resourceManager = commandContext.getResourceManager();
final PropertyManager propertyManager = commandContext.getProper... | // always delete license key legacy property if it still exists
new DeletePropertyCmd(LICENSE_KEY_PROPERTY_NAME).execute(commandContext);
if(deleteProperty) {
// delete license key byte array id
new DeletePropertyCmd(LICENSE_KEY_BYTE_ARRAY_ID).execute(commandContext);
}
if (updateDiagnosti... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\DeleteLicenseKeyCmd.java | 1 |
请完成以下Java代码 | static StockQtyAndUOMQty getMaxQtyCUsPerLU(final @NonNull StockQtyAndUOMQty qty, final I_M_HU_LUTU_Configuration lutuConfigurationInStockUOM, final ProductId productId)
{
final StockQtyAndUOMQty maxQtyCUsPerLU;
if (lutuConfigurationInStockUOM.isInfiniteQtyTU() || lutuConfigurationInStockUOM.isInfiniteQtyCU())
{
... | final Quantity qtyCUsPerTUInStockUOM;
if (orderLineRecord.getQtyItemCapacity().signum() > 0)
{
// we use the capacity which the goods were ordered in
qtyCUsPerTUInStockUOM = Quantitys.of(orderLineRecord.getQtyItemCapacity(), stockQty.getUomId());
}
else if (!lutuConfigurationInStockUOM.isInfiniteQtyCU())
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\IHUPIItemProductBL.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.