instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public static int toRepoIdOr( @Nullable final UserId userId, final int defaultValue) { return userId != null ? userId.getRepoId() : defaultValue; } public static boolean equals(@Nullable final UserId userId1, @Nullable final UserId userId2) { return Objects.equals(userId1, userId2); } int repoId; pr...
} @Override @JsonValue public int getRepoId() { return repoId; } public boolean isSystemUser() {return isSystemUser(repoId);} private static boolean isSystemUser(final int repoId) {return repoId == SYSTEM.repoId;} public boolean isRegularUser() {return !isSystemUser();} private static boolean isRegularU...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\user\UserId.java
1
请完成以下Java代码
public Future<Integer> releaseAfterTrxCommit(final String trxName) { final FutureValue<Integer> countUnlockedFuture = new FutureValue<>(); final ITrxManager trxManager = Services.get(ITrxManager.class); trxManager.getTrxListenerManagerOrAutoCommit(trxName) .newEventListener(TrxEventTiming.AFTER_COMMIT) ...
_recordsToUnlock.setRecordsByModels(models); return this; } @Override public IUnlockCommand setRecordByTableRecordId(final int tableId, final int recordId) { _recordsToUnlock.setRecordByTableRecordId(tableId, recordId); return this; } @Override public IUnlockCommand setRecordByTableRecordId(final String ...
repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\lock\api\impl\UnlockCommand.java
1
请完成以下Java代码
public void unregisterProducerByTableId(@NonNull final AdTableId tableId) { outboundProducersLock.lock(); try { unregisterProducerByTableId0(tableId); } finally { outboundProducersLock.unlock(); } } private void unregisterProducerByTableId0(@NonNull final AdTableId tableId) { final IDocOutbou...
outboundProducers.remove(tableId); } private List<IDocOutboundProducer> getProducersList() { return new ArrayList<>(outboundProducers.values()); } @Override public void createDocOutbound(@NonNull final Object model) { for (final IDocOutboundProducer producer : getProducersList()) { if (!producer.accep...
repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive\de.metas.document.archive.base\src\main\java\de\metas\document\archive\api\impl\DocOutboundProducerService.java
1
请在Spring Boot框架中完成以下Java代码
public class PersonService { private final PersonRepository personRepository; public PersonService(PersonRepository personRepository) { this.personRepository = personRepository; } public PersonRepository getPersonRepository() { return personRepository; } public Promise<Verifie...
} private VerifiedPerson verify(VerifiedPerson person) { if(person.description().startsWith("Good")) { return new VerifiedPerson(person.name(), person.description(), person.notes(), "SUCCESS"); } return new VerifiedPerson(person.name(), person.description(),...
repos\tutorials-master\libraries\src\main\java\com\baeldung\activej\service\PersonService.java
2
请完成以下Java代码
public abstract class AbstractDDOrderEvent implements MaterialEvent { @NonNull private final EventDescriptor eventDescriptor; @NonNull private final DDOrder ddOrder; /** * Set to not-null mainly if this event is about and "advise" that was created due to a {@link SupplyRequiredEvent}, but also<br> * if this eve...
this.ddOrder = ddOrder; this.supplyRequiredDescriptor = supplyRequiredDescriptor; } @JsonIgnore public WarehouseId getFromWarehouseId() {return ddOrder.getSourceWarehouseId();} @JsonIgnore public WarehouseId getToWarehouseId() {return ddOrder.getTargetWarehouseId();} public TableRecordReference getSourceTabl...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\ddorder\AbstractDDOrderEvent.java
1
请在Spring Boot框架中完成以下Java代码
public C requestMatchers(String... patterns) { return requestMatchers(null, patterns); } /** * <p> * Match when the {@link HttpMethod} is {@code method} * </p> * <p> * If a specific {@link RequestMatcher} must be specified, use * {@link #requestMatchers(RequestMatcher...)} instead * </p> * @param m...
*/ public C requestMatchers(HttpMethod method) { return requestMatchers(method, "/**"); } /** * Subclasses should implement this method for returning the object that is chained to * the creation of the {@link RequestMatcher} instances. * @param requestMatchers the {@link RequestMatcher} instances that were ...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\AbstractRequestMatcherRegistry.java
2
请完成以下Java代码
public Instant getLastAccessedTime() { return this.cached.getLastAccessedTime(); } @Override public void setMaxInactiveInterval(Duration interval) { this.cached.setMaxInactiveInterval(interval); this.delta.put(RedisSessionMapper.MAX_INACTIVE_INTERVAL_KEY, (int) getMaxInactiveInterval().getSeconds()); ...
this.isNew = false; } } private void saveChangeSessionId() { if (hasChangedSessionId()) { if (!this.isNew) { String originalSessionIdKey = getSessionKey(this.originalSessionId); String sessionIdKey = getSessionKey(getId()); RedisSessionRepository.this.sessionRedisOperations.rename(original...
repos\spring-session-main\spring-session-data-redis\src\main\java\org\springframework\session\data\redis\RedisSessionRepository.java
1
请在Spring Boot框架中完成以下Java代码
public class PaymentTermId implements RepoIdAware { @JsonCreator public static PaymentTermId ofRepoId(final int repoId) { return new PaymentTermId(repoId); } @Nullable public static PaymentTermId ofRepoIdOrNull(final int repoId) { return repoId > 0 ? ofRepoId(repoId) : null; } public static Optional<Paym...
private PaymentTermId(final int repoId) { this.repoId = Check.assumeGreaterThanZero(repoId, "C_PaymentTerm_ID"); } @Override @JsonValue public int getRepoId() { return repoId; } public static int toRepoId(@Nullable final PaymentTermId id) { return id != null ? id.getRepoId() : -1; } public static bo...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\payment\paymentterm\PaymentTermId.java
2
请完成以下Java代码
public void huParentChanged(final I_M_HU hu, final I_M_HU_Item parentHUItemOld) { final IHandlingUnitsBL handlingUnitsBL = Services.get(IHandlingUnitsBL.class); // If it's not an TU or VHU, we shall do nothing if (!handlingUnitsBL.isTransportUnitOrVirtual(hu)) { return; } final I_M_HU tuHU = hu; fin...
// // If referenced model of the load transaction is a Receipt Schedule, use that final Object loadReferencedModel = loadTrx.getReferencedModel(); if (InterfaceWrapperHelper.isInstanceOf(loadReferencedModel, I_M_ReceiptSchedule.class)) { return InterfaceWrapperHelper.create(loadReferencedModel, I_M_ReceiptSc...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\receiptschedule\impl\ReceiptScheduleHUTrxListener.java
1
请完成以下Java代码
public ProcessInstanceStartEventSubscriptionBuilder tenantId(String tenantId) { this.tenantId = tenantId; return this; } public String getProcessDefinitionKey() { return processDefinitionKey; } public Map<String, Object> getCorrelationParameterValues() { return correlat...
} @Override public EventSubscription subscribe() { checkValidInformation(); return runtimeService.registerProcessInstanceStartEventSubscription(this); } protected void checkValidInformation() { if (StringUtils.isEmpty(processDefinitionKey)) { throw new FlowableIlleg...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\runtime\ProcessInstanceStartEventSubscriptionBuilderImpl.java
1
请完成以下Java代码
private static byte[] encrypt(byte[] text, PublicKey key, RsaAlgorithm alg) { ByteArrayOutputStream output = new ByteArrayOutputStream(text.length); try { final Cipher cipher = Cipher.getInstance(alg.getJceName()); int limit = Math.min(text.length, alg.getMaxLength()); int pos = 0; while (pos < text.len...
pos += limit; byte[] buffer = cipher.doFinal(); output.write(buffer, 0, buffer.length); } return output.toByteArray(); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new IllegalStateException("Cannot decrypt", ex); } } // copied from sun.security.rsa.RSACore.ge...
repos\spring-security-main\crypto\src\main\java\org\springframework\security\crypto\encrypt\RsaRawEncryptor.java
1
请完成以下Java代码
public long getInstances() { return instances; } public void setInstances(long instances) { this.instances = instances; } public long getFinished() { return finished; } public void setFinished(long finished) { this.finished = finished; } public long getCanceled() { return cancele...
public void setOpenIncidents(long openIncidents) { this.openIncidents = openIncidents; } public long getResolvedIncidents() { return resolvedIncidents; } public void setResolvedIncidents(long resolvedIncidents) { this.resolvedIncidents = resolvedIncidents; } public long getDeletedIncidents() ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\HistoricActivityStatisticsImpl.java
1
请完成以下Java代码
public class City implements Serializable { private static final long serialVersionUID = -1L; /** * 城市编号 */ private Long id; /** * 城市名称 */ private String name; /** * 描述 */ private String description; /** * 城市评分 */ private Integer score; ...
public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Integer getScore() { return score; } public void setScore(Integer score) { this.score = score; } }
repos\springboot-learning-example-master\spring-data-elasticsearch-crud\src\main\java\org\spring\springboot\domain\City.java
1
请完成以下Java代码
public Object getModel(@NonNull final IContextAware context) { checkModelStaled(context); // // Load the model now final Object cachedModel = modelRef.get(); if (cachedModel != null) { return cachedModel; } final Properties ctx = context.getCtx(); final String trxName = context.getTrxName(); f...
* Deprecated: pls use appropriate DAO/Repository for loading models * e.g. ModelDAO.getById({@link TableRecordReference#getIdAssumingTableName(String, IntFunction)}) */ @Deprecated @Override public <T> T getModel(final Class<T> modelClass) { return getModel(PlainContextAware.newWithThreadInheritedTrx(), model...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\util\lang\impl\TableRecordReference.java
1
请在Spring Boot框架中完成以下Java代码
public ObjectFactory jaxbObjectFactoryV1() { return new ObjectFactory(); } // e.g. http://localhost:8080/ws/Msv3VerbindungTestenService.wsdl @Bean(name = TestConnectionWebServiceV1.WSDL_BEAN_NAME) public Wsdl11Definition testConnectionWebServiceV1() { return createWsdl(TestConnectionWebServiceV1.WSDL_BEAN_NA...
{ return createXsdSchema("Msv3Service_schema1.xsd"); } @Bean("Msv3FachlicheFunktionen") public XsdSchema msv3FachlicheFunktionenV1() { return createXsdSchema("Msv3FachlicheFunktionen.xsd"); } private static Wsdl11Definition createWsdl(@NonNull final String beanName) { return new SimpleWsdl11Definition(cr...
repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.server\src\main\java\de\metas\vertical\pharma\msv3\server\WebServiceConfigV1.java
2
请在Spring Boot框架中完成以下Java代码
ConcurrentKafkaListenerContainerFactoryConfigurer kafkaListenerContainerFactoryConfigurerVirtualThreads() { ConcurrentKafkaListenerContainerFactoryConfigurer configurer = configurer(); SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor("kafka-"); executor.setVirtualThreads(true); configurer.setListe...
@Bean @ConditionalOnMissingBean(name = "kafkaListenerContainerFactory") ConcurrentKafkaListenerContainerFactory<?, ?> kafkaListenerContainerFactory( ConcurrentKafkaListenerContainerFactoryConfigurer configurer, ObjectProvider<ConsumerFactory<Object, Object>> kafkaConsumerFactory, ObjectProvider<ContainerCust...
repos\spring-boot-4.0.1\module\spring-boot-kafka\src\main\java\org\springframework\boot\kafka\autoconfigure\KafkaAnnotationDrivenConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
JvmGcMetrics jvmGcMetrics() { return new JvmGcMetrics(); } @Bean @ConditionalOnMissingBean JvmHeapPressureMetrics jvmHeapPressureMetrics() { return new JvmHeapPressureMetrics(); } @Bean @ConditionalOnMissingBean JvmMemoryMetrics jvmMemoryMetrics(ObjectProvider<JvmMemoryMeterConventions> jvmMemoryMeterConv...
@ConditionalOnClass(name = VIRTUAL_THREAD_METRICS_CLASS) static class VirtualThreadMetricsConfiguration { @Bean @ConditionalOnMissingBean(type = VIRTUAL_THREAD_METRICS_CLASS) @ImportRuntimeHints(VirtualThreadMetricsRuntimeHintsRegistrar.class) MeterBinder virtualThreadMetrics() throws ClassNotFoundException {...
repos\spring-boot-main\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\jvm\JvmMetricsAutoConfiguration.java
2
请完成以下Java代码
public List<I_GL_DistributionLine> retrieveLines(final I_GL_Distribution glDistribution) { Check.assumeNotNull(glDistribution, "glDistribution not null"); final Properties ctx = InterfaceWrapperHelper.getCtx(glDistribution); final String trxName = InterfaceWrapperHelper.getTrxName(glDistribution); final int gl...
.endOrderBy() // .create() .list(I_GL_DistributionLine.class); } @Override public final int retrieveLastLineNo(final I_GL_Distribution glDistribution) { Check.assumeNotNull(glDistribution, "glDistribution not null"); final Integer lastLineNo = Services.get(IQueryBL.class) .createQueryBuilder(I_...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\gldistribution\impl\GLDistributionDAO.java
1
请完成以下Java代码
public long getSecondsToWaitOnShutdown() { return getConfiguration().getAwaitTerminationPeriod().getSeconds(); } public void setSecondsToWaitOnShutdown(long secondsToWaitOnShutdown) { getConfiguration().setAwaitTerminationPeriod(Duration.ofSeconds(secondsToWaitOnShutdown)); } public Bl...
public ThreadFactory getThreadFactory() { return threadFactory; } public void setThreadFactory(ThreadFactory threadFactory) { this.threadFactory = threadFactory; } public RejectedExecutionHandler getRejectedExecutionHandler() { return rejectedExecutionHandler; } public...
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\async\DefaultAsyncTaskExecutor.java
1
请完成以下Java代码
public void setStartedAfter(Date startedAfter) { this.startedAfter = startedAfter; } public String getStartedBy() { return startedBy; } public void setStartedBy(String startedBy) { this.startedBy = startedBy; } public String getLocale() { return locale; } ...
public void setSafeProcessInstanceIds(List<List<String>> safeProcessInstanceIds) { this.safeProcessInstanceIds = safeProcessInstanceIds; } public List<List<String>> getSafeInvolvedGroups() { return safeInvolvedGroups; } public void setSafeInvolvedGroups(List<List<String>> safeInvolvedG...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\ExecutionQueryImpl.java
1
请完成以下Java代码
static HandlerFilterFunction<ServerResponse, ServerResponse> rewritePath(String regexp, String replacement) { return ofRequestProcessor(BeforeFilterFunctions.rewritePath(regexp, replacement)); } @Shortcut static HandlerFilterFunction<ServerResponse, ServerResponse> rewriteResponseHeader(String name, String regexp...
@Shortcut static HandlerFilterFunction<ServerResponse, ServerResponse> setStatus(HttpStatusHolder statusCode) { return ofResponseProcessor(AfterFilterFunctions.setStatus(statusCode)); } static HandlerFilterFunction<ServerResponse, ServerResponse> uri(String uri) { return ofRequestProcessor(BeforeFilterFunctions...
repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\filter\FilterFunctions.java
1
请完成以下Java代码
public ProcessDefinitionCacheEntry getProcessDefinitionCacheEntry(String processDefinitionId) { return processDefinitionCache.get(processDefinitionId); } // getters and setters //////////////////////////////////////////////////////// @Override public String getName() { return name; ...
} @Override public String getEngineVersion() { return engineVersion; } @Override public void setEngineVersion(String engineVersion) { this.engineVersion = engineVersion; } @Override public String getDerivedFrom() { return derivedFrom; } @Override ...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\persistence\entity\DeploymentEntityImpl.java
1
请完成以下Java代码
public ReturnsInOutHeaderFiller setReturnsDocTypeIdProvider(final IReturnsDocTypeIdProvider returnsDocTypeIdProvider) { this.returnsDocTypeIdProvider = returnsDocTypeIdProvider; return this; } private int getReturnsDocTypeId(final String docBaseType, final boolean isSOTrx, final int adClientId, final int adOrgI...
public ReturnsInOutHeaderFiller setExternalId(@Nullable final String externalId) { this.externalId = externalId; return this; } private String getExternalId() { return this.externalId; } private String getExternalResourceURL() { return this.externalResourceURL; } public ReturnsInOutHeaderFiller setE...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inout\returns\ReturnsInOutHeaderFiller.java
1
请在Spring Boot框架中完成以下Java代码
public class MultipleMongoConfig { @Autowired private MultipleMongoProperties mongoProperties; @Primary @Bean(name = PrimaryMongoConfig.MONGO_TEMPLATE) public MongoTemplate primaryMongoTemplate() throws Exception { return new MongoTemplate(primaryFactory(this.mongoProperties.getPrimary())); } @Bean @Qua...
} @Bean @Primary public MongoDbFactory primaryFactory(MongoProperties mongo) throws Exception { MongoClient client = new MongoClient(new MongoClientURI(mongoProperties.getPrimary().getUri())); return new SimpleMongoDbFactory(client, mongoProperties.getPrimary().getDatabase()); } @Bean public MongoDbFacto...
repos\spring-boot-leaning-master\1.x\第12课:MongoDB 实战\spring-boot-multi-mongodb\src\main\java\com\neo\config\MultipleMongoConfig.java
2
请完成以下Java代码
public void setAD_UserGroup(org.compiere.model.I_AD_UserGroup AD_UserGroup) { set_ValueFromPO(COLUMNNAME_AD_UserGroup_ID, org.compiere.model.I_AD_UserGroup.class, AD_UserGroup); } /** Set Users Group. @param AD_UserGroup_ID Users Group */ @Override public void setAD_UserGroup_ID (int AD_UserGroup_ID) { i...
@param ValidFrom Gültig ab inklusiv (erster Tag) */ @Override public void setValidFrom (java.sql.Timestamp ValidFrom) { set_Value (COLUMNNAME_ValidFrom, ValidFrom); } /** Get Gültig ab. @return Gültig ab inklusiv (erster Tag) */ @Override public java.sql.Timestamp getValidFrom () { return (java...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_UserGroup_User_Assign.java
1
请完成以下Java代码
public HandlerMethodArgumentResolverComposite getResolvers() { return this.resolvers; } /** * Get the method argument values for the current request, checking the provided * argument values and falling back to the configured argument resolvers. * @param environment the data fetching environment to resolve a...
if (!this.resolvers.supportsParameter(parameter)) { throw new IllegalStateException(formatArgumentError(parameter, "No suitable resolver")); } try { args[i] = this.resolvers.resolveArgument(parameter, environment); } catch (Exception ex) { // Leave stack trace for later, exception may actually b...
repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\data\method\annotation\support\DataFetcherHandlerMethodSupport.java
1
请完成以下Java代码
public class OssFileController { @Autowired private IOssFileService ossFileService; @ResponseBody @GetMapping("/list") public Result<IPage<OssFile>> queryPageList(OssFile file, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, ...
@ResponseBody @DeleteMapping("/delete") 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("删除成功!"); } ...
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\oss\controller\OssFileController.java
1
请完成以下Java代码
public void stop() throws Exception { } /* * (non-Javadoc) * * @see org.eclipse.jetty.server.Handler#destroy() */ @Override public void destroy() { } /* * (non-Javadoc) * * @see org.eclipse.jetty.server.Handler#getServer() */ @Override public S...
* * @see org.eclipse.jetty.server.Handler#handle(java.lang.String, * org.eclipse.jetty.server.Request, javax.servlet.http.HttpServletRequest, * javax.servlet.http.HttpServletResponse) */ @Override public void handle(String arg0, Request arg1, HttpServletRequest arg2, HttpServletResponse arg...
repos\tutorials-master\libraries-server-2\src\main\java\com\baeldung\jetty\programmatic\LoggingRequestHandler.java
1
请完成以下Java代码
public class SoehenleResponseStringParser implements IParser<ISoehenleCmd> { private static final Logger logger = LogManager.getLogger(SoehenleResponseStringParser.class); public static final int STATUS_IN_ALIBISPEICHER_EXPECTED_LENGTH = 15; public static final int STATUS_EXPECTED_LENGTH = 7; @SuppressWarnings("un...
catch (final Exception e) { throw new ParserException(cmd, stringToParse, elementName, clazz, e); } } private static String getStatus(final ISoehenleCmd cmd, final String[] tokens) { final SoehenleResultStringElement statusInfo = cmd.getResultElements().get(RESULT_ELEMENT_STATUS); final String status = t...
repos\metasfresh-new_dawn_uat\backend\de.metas.device.scales\src\main\java\de\metas\device\scales\impl\soehenle\SoehenleResponseStringParser.java
1
请在Spring Boot框架中完成以下Java代码
public static class LogoutOnRequestConfiguration { @Bean public SecurityFilterChain filterChainLogoutOnRequest(HttpSecurity http) throws Exception { http.securityMatcher("/request/**") .authorizeHttpRequests(authz -> authz.anyRequest() .permitAll()) ...
Cookie cookieToDelete = new Cookie(cookieName, null); cookieToDelete.setMaxAge(0); response.addCookie(cookieToDelete); } })); return http.build(); } } @Order(1) @Configuration public ...
repos\tutorials-master\spring-security-modules\spring-security-web-login-2\src\main\java\com\baeldung\manuallogout\SimpleSecurityConfiguration.java
2
请完成以下Java代码
private OrderLinePackingMaterialDocumentLineSource toImpl(final IPackingMaterialDocumentLineSource source) { return (OrderLinePackingMaterialDocumentLineSource)source; } @Override protected void removeDocumentLine(final IPackingMaterialDocumentLine pmLine) { final OrderLinePackingMaterialDocumentLine orderLin...
InterfaceWrapperHelper.save(pmOrderLine); } @Override protected void linkSourceToDocumentLine(final IPackingMaterialDocumentLineSource source, final IPackingMaterialDocumentLine pmLine) { final OrderLinePackingMaterialDocumentLineSource orderLineSource = toImpl(source); final OrderLinePackingMaterialDocumen...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\order\api\impl\OrderPackingMaterialDocumentLinesBuilder.java
1
请在Spring Boot框架中完成以下Java代码
public class ShiroRealm extends AuthorizingRealm { @Autowired private UserMapper userMapper; /** * 获取用户角色和权限 */ @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principal) { return null; } /** * 登录认证 */ @Override protected AuthenticationInfo doGetAuthenticationInfo(...
if (user == null) { throw new UnknownAccountException("用户名或密码错误!"); } if (!password.equals(user.getPassword())) { throw new IncorrectCredentialsException("用户名或密码错误!"); } if (user.getStatus().equals("0")) { throw new LockedAccountException("账号已被锁定,请联系管理员!"); } SimpleAuthenticationInfo info = new Sim...
repos\SpringAll-master\11.Spring-Boot-Shiro-Authentication\src\main\java\com\springboot\shiro\ShiroRealm.java
2
请完成以下Java代码
public OidcIdToken getIdToken() { return this.idToken; } /** * Returns the {@link OidcUserInfo UserInfo} containing claims about the user, may be * {@code null}. * @return the {@link OidcUserInfo} containing claims about the user, or {@code null} */ public OidcUserInfo getUserInfo() { return this.userIn...
} return (this.getUserInfo() != null) ? this.getUserInfo().equals(that.getUserInfo()) : that.getUserInfo() == null; } @Override public int hashCode() { int result = super.hashCode(); result = 31 * result + this.getIdToken().hashCode(); result = 31 * result + ((this.getUserInfo() != null) ? this.getUserI...
repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\oidc\user\OidcUserAuthority.java
1
请完成以下Java代码
public boolean isReadable() { return this.delegate.isReadable(); } @Override public Instant lastModified() { return this.delegate.lastModified(); } @Override public long length() { return this.delegate.length(); } @Override public URI getURI() { return this.delegate.getURI(); } @Override public ...
private Resource asLoaderHidingResource(Resource resource) { return (resource instanceof LoaderHidingResource) ? resource : new LoaderHidingResource(this.base, resource); } @Override public @Nullable Resource resolve(String subUriPath) { if (subUriPath.startsWith(LOADER_RESOURCE_PATH_PREFIX)) { return null; ...
repos\spring-boot-4.0.1\module\spring-boot-jetty\src\main\java\org\springframework\boot\jetty\servlet\LoaderHidingResource.java
1
请完成以下Java代码
public class Person { @Id private UUID id; private String firstName; public Person(final UUID id, final String firstName) { this.id = id; this.firstName = firstName; } private Person() { } public UUID getId() { return id; }
public String getFirstName() { return firstName; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Person person = (Person) o; return Objects.equals(id, person.id) && Objects.equals(fi...
repos\tutorials-master\spring-reactive-modules\spring-reactive-data-couchbase\src\main\java\com\baeldung\couchbase\domain\Person.java
1
请完成以下Java代码
public static X_AD_ReplicationTable getReplicationTable(Properties ctx ,int AD_ReplicationStrategy_ID, int AD_Table_ID) { final String whereClause = I_AD_ReplicationTable.COLUMNNAME_AD_ReplicationStrategy_ID + "=? AND " + I_AD_ReplicationTable.COLUMNNAME_AD_Table_ID + "=?"; return new Query(ctx, ...
* @return X_AD_ReplicationDocument Document to replication */ public static X_AD_ReplicationDocument getReplicationDocument(Properties ctx ,int AD_ReplicationStrategy_ID , int AD_Table_ID, int C_DocType_ID) { final String whereClause = I_AD_ReplicationDocument.COLUMNNAME_AD_ReplicationStrategy_ID + "=? AND " ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MReplicationStrategy.java
1
请完成以下Java代码
public void setPreAuthenticatedUserDetailsService( AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> uds) { this.preAuthenticatedUserDetailsService = uds; } /** * If true, causes the provider to throw a BadCredentialsException if the presented * authentication request is invalid (contain...
} /** * Sets authorities that this provider should grant once authentication completes * @param grantedAuthoritySupplier the supplier that grants authorities */ public void setGrantedAuthoritySupplier(Supplier<Collection<GrantedAuthority>> grantedAuthoritySupplier) { Assert.notNull(grantedAuthoritySupplier, ...
repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\preauth\PreAuthenticatedAuthenticationProvider.java
1
请完成以下Java代码
public static boolean doesProductMatchFilter( @NonNull final I_M_Product product, @NonNull final ProductFilterVO filterVO) { final boolean ignoreCase = true; // ProductName final String productName = filterVO.getProductName(); if (!Check.isEmpty(productName, true)) { final StringLikeFilter<I_M_Prod...
// IsPurchase if (filterVO.getIsPurchased() != null && filterVO.getIsPurchased() != product.isPurchased()) { return false; } // IsSold if (filterVO.getIsSold() != null && filterVO.getIsSold() != product.isSold()) { return false; } // IsActive if (filterVO.getIsActive() != null && filterVO.getI...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\material\cockpit\filters\ProductFilterUtil.java
1
请完成以下Java代码
private final UserNotificationRequest createFlatrateTermGeneratedEvent( @NonNull final I_C_Flatrate_Term contract, final UserId recipientUserId, @NonNull final AdMessageKey message) { if (recipientUserId == null) { // nothing to do return null; } final TableRecordReference flatrateTermRef = Tab...
.build(); } private final UserNotificationRequest.UserNotificationRequestBuilder newUserNotificationRequest() { return UserNotificationRequest.builder() .topic(EVENTBUS_TOPIC); } private void postNotification(final UserNotificationRequest notification) { Services.get(INotificationBL.class).sendAfterCom...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\event\FlatrateUserNotificationsProducer.java
1
请完成以下Java代码
public class Person { private String name = "John"; private byte age = 30; private short uidNumber = 5555; private int pinCode = 452002; private long contactNumber = 123456789L; private float height = 6.1242f; private double weight = 75.2564; private char gender = 'M'; private boole...
} public void setContactNumber(long contactNumber) { this.contactNumber = contactNumber; } public float getHeight() { return height; } public void setHeight(float height) { this.height = height; } public double getWeight() { return weight; } publi...
repos\tutorials-master\core-java-modules\core-java-reflection\src\main\java\com\baeldung\reflection\access\privatefields\Person.java
1
请完成以下Java代码
public void setScriptScannerFactory(final IScriptScannerFactory scriptScannerFactory) { getDelegate().setScriptScannerFactory(scriptScannerFactory); } @Override public IScriptScannerFactory getScriptScannerFactory() { return getDelegate().getScriptScannerFactory(); } @Override public IScriptScannerFactory...
public IScriptFactory getScriptFactoryToUse() { return getDelegate().getScriptFactoryToUse(); } @Override public boolean hasNext() { return getDelegate().hasNext(); } @Override public IScript next() { return getDelegate().next(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.base\src\main\java\de\metas\migration\scanner\impl\ForwardingScriptScanner.java
1
请完成以下Java代码
public String[] toWordArray() { List<Word> wordList = toSimpleWordList(); String[] wordArray = new String[wordList.size()]; Iterator<Word> iterator = wordList.iterator(); for (int i = 0; i < wordArray.length; i++) { wordArray[i] = iterator.next().value; } ...
return result; } public Sentence mergeCompoundWords() { ListIterator<IWord> listIterator = wordList.listIterator(); while (listIterator.hasNext()) { IWord word = listIterator.next(); if (word instanceof CompoundWord) { listIterator...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\document\sentence\Sentence.java
1
请在Spring Boot框架中完成以下Java代码
public String metricKeyPrefix() { return obtain(v2(V2::getMetricKeyPrefix), DynatraceConfig.super::metricKeyPrefix); } @Override public Map<String, String> defaultDimensions() { return obtain(v2(V2::getDefaultDimensions), DynatraceConfig.super::defaultDimensions); } @Override public boolean enrichWithDynatr...
return obtain(v2(V2::isUseDynatraceSummaryInstruments), DynatraceConfig.super::useDynatraceSummaryInstruments); } @Override public boolean exportMeterMetadata() { return obtain(v2(V2::isExportMeterMetadata), DynatraceConfig.super::exportMeterMetadata); } private <V> Getter<DynatraceProperties, V> v1(Getter<V1,...
repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\dynatrace\DynatracePropertiesConfigAdapter.java
2
请完成以下Java代码
public static <IT, OT> Iterator<OT> map(@NonNull final Iterator<IT> iterator, @NonNull final Function<IT, OT> mapper) { return new MappingIteratorWrapper<>(iterator, mapper); } public static <T> Iterator<T> unmodifiableIterator(final Iterator<T> iterator) { return new UnmodifiableIterator<>(iterator); } pub...
Spliterator<T> spliterator = Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED); final boolean parallel = false; return StreamSupport.stream(spliterator, parallel); } public static <T> Stream<T> stream(final BlindIterator<T> blindIterator) { return stream(asIterator(blindIterator)); } publi...
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\collections\IteratorUtils.java
1
请完成以下Java代码
public final void removeAncestorKeyBindingsOf(final JComponent comp, final Predicate<KeyStroke> isRemoveKeyStrokePredicate) { // Skip null components (but tolerate that) if (comp == null) { return; } // Get component's ancestors input map (the map which defines which key bindings will work when pressed i...
continue; } // NOTE: Instead of removing it, it is much more safe to bind it to "none", // to explicitly say to not consume that key event even if is defined in some parent map of this input map. compInputMap.put(key, "none"); if (log.isDebugEnabled()) { log.debug("Removed " + key + "->" + compA...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\APanel.java
1
请完成以下Java代码
public static PickedHUEditorRow ofUnprocessedRow( @NonNull final HUEditorRow huEditorRow, @NonNull final ImmutableMap<HuId, ImmutableSet<OrderId>> huIds2OpenPickingOrderIds) { return new PickedHUEditorRow(huEditorRow, false, huIds2OpenPickingOrderIds); } @NonNull HUEditorRow huEditorRow; boolean processed;...
@NonNull public ImmutableMap<HuId, ImmutableSet<OrderId>> getPickingOrderIdsFor(@NonNull final ImmutableSet<HuId> huIds) { return huIds.stream() .collect(ImmutableMap.toImmutableMap(Function.identity(), huId -> Optional.ofNullable(huIds2OpenPickingOrderIds.get(huId)) .orElse(Immuta...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\pickingslot\PickedHUEditorRow.java
1
请在Spring Boot框架中完成以下Java代码
protected Pair<Boolean, Boolean> saveOrUpdateCalculatedField(TenantId tenantId, CalculatedFieldId calculatedFieldId, CalculatedFieldUpdateMsg calculatedFieldUpdateMsg) { boolean isCreated = false; boolean isNameUpdated = false; try { CalculatedField calculatedField = JacksonUtil.from...
calculatedFieldValidator.validate(calculatedField, CalculatedField::getTenantId); if (isCreated) { calculatedField.setId(calculatedFieldId); } edgeCtx.getCalculatedFieldService().save(calculatedField, false); } catch (Exception e) { log.error("[{...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\edge\rpc\processor\cf\BaseCalculatedFieldProcessor.java
2
请在Spring Boot框架中完成以下Java代码
public PreInvocationAuthorizationAdvice preInvocationAuthorizationAdvice() { ExpressionBasedPreInvocationAdvice preInvocationAdvice = new ExpressionBasedPreInvocationAdvice(); preInvocationAdvice.setExpressionHandler(getExpressionHandler()); return preInvocationAdvice; } /** * Obtains the attributes from {@l...
@Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.context = beanFactory; } private AuthenticationConfiguration getAuthenticationConfiguration() { return this.context.getBean(AuthenticationConfiguration.class); } private boolean prePostEnabled() { return enableMethod...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\method\configuration\GlobalMethodSecurityConfiguration.java
2
请完成以下Java代码
public static List<Integer> findByTreeMap(Integer[] arr, int n) { // Create a TreeMap and use a reverse order comparator to sort the entries by frequency in descending order Map<Integer, Integer> countMap = new TreeMap<>(Collections.reverseOrder()); for (int i : arr) { countMap.put(...
freqMap.put(num, freqMap.getOrDefault(num, 0) + 1); } // Loop through the HashMap and add each element to its corresponding bucket based on its frequency count for (int num : freqMap.keySet()) { int freq = freqMap.get(num); if (bucket[freq] == null) { buc...
repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-7\src\main\java\com\baeldung\algorithms\frequentelements\MostFrequentElementsFinder.java
1
请完成以下Java代码
public String toString() { final StringBuilder sb = new StringBuilder(word.length * 50); for (CoNLLWord word : this.word) { sb.append(word); sb.append('\n'); } return sb.toString(); } /** * 获取边的列表,edge[i][j]表示id为i的词语与j存在一条依存关系为该值的边,否则为nul...
* @param word * @return */ public List<CoNLLWord> findChildren(CoNLLWord word) { List<CoNLLWord> result = new LinkedList<CoNLLWord>(); for (CoNLLWord other : this) { if (other.HEAD == word) result.add(other); } return result; } ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\dependency\CoNll\CoNLLSentence.java
1
请完成以下Java代码
public class Person { private String name; private String nickname; private int age; public Person() { } public Person(String name, String nickname, int age) { super(); this.name = name; this.nickname = nickname; this.age = age; } public String getName...
public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
repos\tutorials-master\libraries-data\src\main\java\com\baeldung\dozer\Person.java
1
请在Spring Boot框架中完成以下Java代码
GeodeGatewaySendersHealthIndicator gatewaySendersHealthIndicator(GemFireCache gemfireCache) { return new GeodeGatewaySendersHealthIndicator(gemfireCache); } @Bean BeanPostProcessor cacheServerLoadProbeWrappingBeanPostProcessor() { return new BeanPostProcessor() { @Nullable @Override @SuppressWarnings("all"...
} return bean; } private ServerLoadProbe wrap(ServerLoadProbe serverLoadProbe) { return new ActuatorServerLoadProbeWrapper(serverLoadProbe); } }; } public static final class PeerCacheCondition implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMet...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-actuator-autoconfigure\src\main\java\org\springframework\geode\boot\actuate\autoconfigure\config\PeerCacheHealthIndicatorConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
public Mono<Integer> add(@RequestBody Publisher<UserAddDTO> addDTO) { // 插入用户记录,返回编号 Integer returnId = 1; // 返回用户编号 return Mono.just(returnId); } /** * 添加用户 * * @param addDTO 添加用户信息 DTO * @return 添加成功的用户编号 */ @PostMapping("add2") public Mono<Int...
/** * 删除指定用户编号的用户 * * @param id 用户编号 * @return 是否删除成功 */ @PostMapping("/delete") // URL 修改成 /delete ,RequestMethod 改成 DELETE public Mono<Boolean> delete(@RequestParam("id") Integer id) { // 删除用户记录 Boolean success = true; // 返回是否更新成功 return Mono.just(succe...
repos\SpringBoot-Labs-master\lab-27\lab-27-webflux-01\src\main\java\cn\iocoder\springboot\lab27\springwebflux\controller\UserController.java
2
请在Spring Boot框架中完成以下Java代码
public class Comment extends BaseAuditingEntity implements Serializable { @Serial private static final long serialVersionUID = -420530763778423311L; private String content; @Enumerated(EnumType.STRING) private CommentStatus status = CommentStatus.AWAITING_APPROVAL; @JoinColumn(nullable = fals...
this.parentCommentId = parentCommentId; } public void addChildComment(Comment childComment) { childComment.setParentCommentId(getId()); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClas...
repos\spring-boot-web-application-sample-master\main-app\main-orm\src\main\java\gt\app\domain\Comment.java
2
请完成以下Java代码
public class UniqueDigitCounter { static int bruteForce(int n) { int count = 0; int limit = (int)Math.pow(10, n); for (int num = 0; num < limit; num++) { if (hasUniqueDigits(num)) { count++; } } return count; } static ...
int current = 9; int available = 9; for (int i = 2; i <= n; i++) { current *= available; result += current; available--; } return result; } static int dp(int n) { if (n == 0) return 1; int result = 10; in...
repos\tutorials-master\core-java-modules\core-java-numbers-9\src\main\java\com\baeldung\uniquedigitcounter\UniqueDigitCounter.java
1
请完成以下Java代码
public OrgId getOrgId() {return getEventDescriptor().getOrgId();} @NonNull @JsonIgnore public SupplyRequiredDescriptor withNewEventId() { return toBuilder().eventDescriptor(newEventDescriptor()).build(); } @NonNull @JsonIgnore public EventDescriptor newEventDescriptor() {return getEventDescriptor().withNewE...
public BPartnerId getCustomerId() {return getMaterialDescriptor().getCustomerId();} @JsonIgnore public WarehouseId getWarehouseId() {return getMaterialDescriptor().getWarehouseId();} @JsonIgnore public int getAttributeSetInstanceId() {return getMaterialDescriptor().getAttributeSetInstanceId();} @JsonIgnore pub...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\commons\SupplyRequiredDescriptor.java
1
请完成以下Spring Boot application配置
spring: ssl: bundle: pem: default: keystore: certificate: "classpath:default/test-hello-server.crt" private-key: "classpath:default/test-hello-server.key" truststore: certificate: "classpath:ca/test-ca.crt" alt: keystore: ...
lt" management: server: port: 8444 ssl: bundle: "default" server-name-bundles: - server-name: "hello.example.com" bundle: "default" - server-name: "hello-alt.example.com" bundle: "alt" endpoints: web: exposure: include: - "*"
repos\spring-boot-4.0.1\integration-test\spring-boot-sni-integration-tests\spring-boot-sni-reactive-app\src\main\resources\application.yml
2
请完成以下Java代码
private PlainHUPackingAware createQuickInputPackingAware(@NonNull final OrderLineCandidate candidate) { final PlainHUPackingAware huPackingAware = new PlainHUPackingAware(); huPackingAware.setBpartnerId(candidate.getBpartnerId()); huPackingAware.setInDispute(false); huPackingAware.setProductId(candidate.getPro...
} @Nullable private AttributeSetInstanceId createASI( @NonNull final ProductId productId, @NonNull final ImmutableAttributeSet attributes) { if (attributes.isEmpty()) { return null; } final I_M_AttributeSetInstance asi = asiBL.createASIWithASFromProductAndInsertAttributeSet( productId, att...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\quickinput\orderline\OrderLineQuickInputProcessor.java
1
请在Spring Boot框架中完成以下Java代码
public String getMimeType() { return mimeType; } /** * Sets the value of the mimeType property. * * @param value * allowed object is * {@link String } * */ public void setMimeType(String value) { this.mimeType = value; } /** * T...
*/ public byte[] getAttachmentData() { return attachmentData; } /** * Sets the value of the attachmentData property. * * @param value * allowed object is * byte[] */ public void setAttachmentData(byte[] value) { this.attachmentData = value; } ...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ext\AttachmentType.java
2
请完成以下Java代码
private void enqueuePrintQueues(@NonNull final PrintingQueueQueryRequest queryRequest) { final List<I_C_Printing_Queue> printingQueues = queryRequest.getQuery().list(); if (printingQueues.isEmpty()) { Loggables.withLogger(logger, Level.DEBUG).addLog("*** There is nothing to enqueue. Skipping it: {}", queryReq...
final IQuery<I_C_Printing_Queue> query = createPrintingQueueQuery(whereClause); final PrintingQueueQueryRequest request = PrintingQueueQueryRequest.builder() .queryName(key) .query(query) .build(); queries.add(request); } return queries; } private IQuery<I_C_Printing_Queue> createPrintingQu...
repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java\de\metas\printing\model\validator\ConcatenatePDFsCommand.java
1
请完成以下Java代码
public String toString() { StringBuilder sb = new StringBuilder("MMShipperTransportation["); sb.append(get_ID()).append("-").append(getSummary()) .append("]"); return sb.toString(); } // toString /** * Package Lines */ private List<I_M_ShippingPackage> m_lines = null; /** * Get Lines * * @...
return m_lines; } final String whereClause = I_M_ShippingPackage.COLUMNNAME_M_ShipperTransportation_ID + "=?"; m_lines = new Query(getCtx(), I_M_ShippingPackage.Table_Name, whereClause, trxName) .setParameters(new Object[] { getM_ShipperTransportation_ID() }) .listImmutable(I_M_ShippingPackage.class); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\shipping\model\MMShipperTransportation.java
1
请完成以下Java代码
public void actionPerformed(ActionEvent e) { resultField.setText(processStatements (sqlField.getText(), false)); } // actionedPerformed /** * Process SQL Statements * @param sqlStatements one or more statements separated by ; * @param allowDML allow DML statements * @return result */ public static St...
if (count == -1) { result.append("---> ResultSet"); } else result.append("---> Result=").append(count); } catch (SQLException e) { log.error("process statement: " + sql + " - " + e.toString()); result.append("===> ").append(e.toString()); } // Clean up try { stmt.close(); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\form\VSQLProcess.java
1
请完成以下Java代码
public List<DefaultMetadataElement> getConfigurationFileFormats() { return this.configurationFileFormats; } public List<DefaultMetadataElement> getBootVersions() { return this.bootVersions; } public SimpleElement getGroupId() { return this.groupId; } public SimpleElement getArtifactId() { return this.a...
this.title = title; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } public void...
repos\initializr-main\initializr-metadata\src\main\java\io\spring\initializr\metadata\InitializrProperties.java
1
请完成以下Java代码
public void addAndSaveLocation(final I_C_BPartner_Location bpartnerLocation) { bpartnersRepo.save(bpartnerLocation); final BPartnerLocationId bpartnerLocationId = BPartnerLocationId.ofRepoId(bpartnerLocation.getC_BPartner_ID(), bpartnerLocation.getC_BPartner_Location_ID()); if (!getBPLocationById(bpartnerLo...
contacts = new ArrayList<>(); } } return contacts; } public BPartnerContactId addAndSaveContact(final I_AD_User contact) { bpartnersRepo.save(contact); final BPartnerContactId contactId = BPartnerContactId.ofRepoId(contact.getC_BPartner_ID(), contact.getAD_User_ID()); if (!getContactById(con...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\bpartner\impexp\BPartnersCache.java
1
请完成以下Java代码
protected String doIt() throws Exception { if (qtyCUsPerTU == null || qtyCUsPerTU.signum() <= 0) { throw new FillMandatoryException(PARAM_QtyCUsPerTU); } final I_M_HU fromHU = getSingleSelectedPickingSlotTopLevelHU(); final IAllocationSource source = HUListAllocationSourceDestination .of(fromHU) ...
@Override protected void postProcess(final boolean success) { if (!success) { return; } // Invalidate views getPickingSlotsClearingView().invalidateAll(); getPackingHUsView().invalidateAll(); } private IHUProducerAllocationDestination createHUProducer(@NonNull final I_M_HU fromHU) { final Pickin...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pickingslotsClearing\process\WEBUI_PickingSlotsClearingView_TakeOutHUAndAddToNewHU.java
1
请在Spring Boot框架中完成以下Java代码
public Boolean getIncludeCaseVariables() { return includeCaseVariables; } public void setIncludeCaseVariables(Boolean includeCaseVariables) { this.includeCaseVariables = includeCaseVariables; } public Collection<String> getIncludeCaseVariablesNames() { return includeCaseVariabl...
public Boolean getWithoutTenantId() { return withoutTenantId; } public String getTenantIdLike() { return tenantIdLike; } public void setTenantIdLike(String tenantIdLike) { this.tenantIdLike = tenantIdLike; } public String getTenantIdLikeIgnoreCase() { retur...
repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\caze\CaseInstanceQueryRequest.java
2
请完成以下Java代码
public static String decodeBase64String(String str) throws IOException { BASE64Decoder encoder = new BASE64Decoder(); return new String(encoder.decodeBuffer(str)); } private static String encode(String str, String method) { MessageDigest mdInst = null; // 把密文转换成十六进制的字符串形式 // 单线程用StringBuilder,速度快 多线程用strin...
if (tmp < 0) { tmp += 256; } if (tmp < 16) { dstr.append("0"); } dstr.append(Integer.toHexString(tmp)); } } catch (NoSuchAlgorithmException e) { LOG.error(e); } return dstr.toString(); } }
repos\roncoo-pay-master\roncoo-pay-common-core\src\main\java\com\roncoo\pay\common\core\utils\EncryptUtil.java
1
请完成以下Java代码
public boolean hasNamespace(WebServerNamespace webServerNamespace) { return this.namespace.equals(webServerNamespace); } @Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } AdditionalHealthEndp...
/** * Creates an {@link AdditionalHealthEndpointPath} from the given * {@link WebServerNamespace} and value. * @param webServerNamespace the server namespace * @param value the value * @return the new instance */ public static AdditionalHealthEndpointPath of(WebServerNamespace webServerNamespace, String va...
repos\spring-boot-4.0.1\module\spring-boot-health\src\main\java\org\springframework\boot\health\actuate\endpoint\AdditionalHealthEndpointPath.java
1
请完成以下Java代码
public void setShipper_Location_ID (final int Shipper_Location_ID) { if (Shipper_Location_ID < 1) set_Value (COLUMNNAME_Shipper_Location_ID, null); else set_Value (COLUMNNAME_Shipper_Location_ID, Shipper_Location_ID); } @Override public int getShipper_Location_ID() { return get_ValueAsInt(COLUMNNAM...
{ return get_ValueAsString(COLUMNNAME_TrackingID); } @Override public void setVesselName (final @Nullable java.lang.String VesselName) { set_Value (COLUMNNAME_VesselName, VesselName); } @Override public java.lang.String getVesselName() { return get_ValueAsString(COLUMNNAME_VesselName); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\shipping\model\X_M_ShipperTransportation.java
1
请完成以下Java代码
public void setIsTrackIssues (boolean IsTrackIssues) { set_Value (COLUMNNAME_IsTrackIssues, Boolean.valueOf(IsTrackIssues)); } /** Get Track Issues. @return Enable tracking issues for this asset */ public boolean isTrackIssues () { Object oo = get_Value(COLUMNNAME_IsTrackIssues); if (oo != null) { ...
/** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ public String getName () { return (String)get_Value(COLUMNNAME_Name); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Group.java
1
请在Spring Boot框架中完成以下Java代码
public String getScopeType() { return this.scopeType; } @Override public void setScopeType(String scopeType) { this.scopeType = scopeType; } @Override public String getScopeDefinitionId() { return this.scopeDefinitionId; } @Override public void setScope...
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("IdentityLinkEntity[id=").append(id); sb.append(", type=").append(type); if (userId != null) { sb.append(", userId=").append(userId); } if (groupId != null) { ...
repos\flowable-engine-main\modules\flowable-identitylink-service\src\main\java\org\flowable\identitylink\service\impl\persistence\entity\HistoricIdentityLinkEntityImpl.java
2
请在Spring Boot框架中完成以下Java代码
public void setMHUPackagingCodeText(String value) { this.mhuPackagingCodeText = value; } /** * Gets the value of the ediExpDesadvPackItem property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the...
* * <p> * Objects of the following type(s) are allowed in the list * {@link EDIExpDesadvPackItemType } * * */ public List<EDIExpDesadvPackItemType> getEDIExpDesadvPackItem() { if (ediExpDesadvPackItem == null) { ediExpDesadvPackItem = new ArrayList<EDIExpDesadvPa...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_metasfreshinhousev1\de\metas\edi\esb\jaxb\metasfreshinhousev1\EDIExpDesadvPackType.java
2
请完成以下Java代码
public boolean hasChanges() { if (isNew()) { return true; } final Set<String> changedPropertyNames = valuesOld.keySet(); for (final String propertyName : changedPropertyNames) { if (isValueChanged(propertyName)) { return true; } } return false; } public int getLoadCount() { retu...
} @Override public boolean has_Variable(final String variableName) { return POJOWrapper.this.hasColumnName(variableName); } @Override public String get_ValueOldAsString(final String variableName) { throw new UnsupportedOperationException("not implemented"); } }; } public IModelInt...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\wrapper\POJOWrapper.java
1
请在Spring Boot框架中完成以下Java代码
public class FlowableConfig { @Bean public void processEngine(DataSourceTransactionManager transactionManager, DataSource dataSource) throws IOException { SpringProcessEngineConfiguration configuration = new SpringProcessEngineConfiguration(); //自动部署已有的流程文件 Resource[] resources = new PathMatchingResourcePatt...
public TaskService taskService(ProcessEngine processEngine) { return processEngine.getTaskService(); } @Bean public HistoryService historyService(ProcessEngine processEngine) { return processEngine.getHistoryService(); } @Bean public ManagementService managementService(ProcessEngine processEngine) { retur...
repos\spring-boot-quick-master\quick-flowable\src\main\java\com\quick\flowable\config\FlowableConfig.java
2
请完成以下Java代码
private ViewEvaluationCtx getViewEvaluationCtx() { return viewEvaluationCtxSupplier.get(); } public void updateChangedRows( @NonNull final Set<DocumentId> changedRowIds, @NonNull final AddRemoveChangedRowIdsCollector changesCollector) { if (changedRowIds.isEmpty()) { return; } computeCurrentSel...
private ViewRowIdsOrderedSelection createSelectionFromSelection( @NonNull final ViewRowIdsOrderedSelection fromSelection, @Nullable final DocumentQueryOrderByList orderBys) { final ViewEvaluationCtx viewEvaluationCtx = getViewEvaluationCtx(); final SqlDocumentFilterConverterContext filterConverterContext = S...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\ViewRowIdsOrderedSelectionsHolder.java
1
请在Spring Boot框架中完成以下Java代码
public Result<List<ClusterUniversalStatePairVO>> apiGetClusterStateOfApp(@PathVariable String app) { if (StringUtil.isEmpty(app)) { return Result.ofFail(-1, "app cannot be null or empty"); } try { return clusterConfigService.getClusterUniversalState(app) ....
if (request.getPort() == null || request.getPort() < 0) { return Result.ofFail(-1, "invalid port"); } if (request.getMode() == null || request.getMode() < 0) { return Result.ofFail(-1, "invalid mode"); } if (!checkIfSupported(request.getApp(), request.getIp(), req...
repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\controller\cluster\ClusterConfigController.java
2
请完成以下Java代码
private void updateInOutLine(final org.compiere.model.I_M_InOutLine inOutLine, final I_M_Material_Tracking materialTracking) { createUpdateASIAndLink(inOutLine, materialTracking); addLog(msgBL.parseTranslation(getCtx(), "@Processed@: @M_InOut_ID@ " + inOutLine.getM_InOut().getDocumentNo() + " @Line@ " + inOutLine...
@Override public ProcessPreconditionsResolution checkPreconditionsApplicable(final IProcessPreconditionsContext context) { if (I_C_Order.Table_Name.equals(context.getTableName())) { final I_C_Order order = context.getSelectedModel(I_C_Order.class); if (order == null) { return ProcessPreconditionsReso...
repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\process\M_Material_Tracking_CreateOrUpdate_ID.java
1
请在Spring Boot框架中完成以下Java代码
public boolean isAwaitTermination() { return this.awaitTermination; } public void setAwaitTermination(boolean awaitTermination) { this.awaitTermination = awaitTermination; } public @Nullable Duration getAwaitTerminationPeriod() { return this.awaitTerminationPeriod; } public void setAwaitTerminat...
* @since 3.5.0 */ public enum Mode { /** * Create the task executor if no user-defined executor is present. */ AUTO, /** * Create the task executor even if a user-defined executor is present. */ FORCE } }
repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\task\TaskExecutionProperties.java
2
请完成以下Java代码
public String getContractNumber() { return contractNumber; } /** * Sets the value of the contractNumber property. * * @param value * allowed object is * {@link String } * */ public void setContractNumber(String value) { this.contractNumber = ...
* possible object is * {@link String } * */ public String getNif() { return nif; } /** * Sets the value of the nif property. * * @param value * allowed object is * {@link String } * */ public void setNif(String value) ...
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\IvgLawType.java
1
请完成以下Java代码
public String getToUserName() { return ToUserName; } public void setToUserName(String toUserName) { ToUserName = toUserName; } public String getFromUserName() { return FromUserName; } public void setFromUserName(String fromUserName) { FromUserName = fromUserName; } public long getCreateTime() { return...
} public void setMsgType(String msgType) { MsgType = msgType; } public int getFuncFlag() { return FuncFlag; } public void setFuncFlag(int funcFlag) { FuncFlag = funcFlag; } @Override public String toString() { return "BaseMessage{" + "ToUserName='" + ToUserName + '\'' + ", FromUserName='" + FromUserNam...
repos\spring-boot-quick-master\quick-wx-public\src\main\java\com\wx\pn\api\model\BaseMessage.java
1
请在Spring Boot框架中完成以下Java代码
public ReturnT<String> update(HttpServletRequest request, XxlJobUser xxlJobUser) { // avoid opt login seft XxlJobUser loginUser = (XxlJobUser) request.getAttribute(LoginService.LOGIN_IDENTITY_KEY); if (loginUser.getUsername().equals(xxlJobUser.getUsername())) { return new ReturnT<St...
return ReturnT.SUCCESS; } @RequestMapping("/updatePwd") @ResponseBody public ReturnT<String> updatePwd(HttpServletRequest request, String password){ // valid password if (password==null || password.trim().length()==0){ return new ReturnT<String>(ReturnT.FAIL.getCode(), "密码不...
repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-xxljob\src\main\java\com\xxl\job\admin\controller\UserController.java
2
请完成以下Java代码
public ProcessExtensionModel read(InputStream inputStream) throws IOException { objectMapper.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS); ProcessExtensionModel mappedModel = objectMapper.readValue(inputStream, ProcessExtensionModel.class); return convertJsonVariables(mappedModel); }...
} } return processExtensionModel; } private void saveVariableAsJsonObject(Extension extension) { for (VariableDefinition variableDefinition : extension.getProperties().values()) { if ( !variableTypeMap.containsKey(variableDefinition.getType()) || ...
repos\Activiti-develop\activiti-core\activiti-spring-process-extensions\src\main\java\org\activiti\spring\process\ProcessExtensionResourceReader.java
1
请完成以下Java代码
public OnMoreThanOneFound getOnMoreThanOneFound() { return onMoreThanOneFound; } @Override public IMaterialTrackingQuery setCompleteFlatrateTerm(final Boolean completeFlatrateTerm) { this.completeFlatrateTerm = completeFlatrateTerm; return this; } @Override public Boolean getCompleteFlatrateTerm() { ...
@Override public String getLot() { return lot; } @Override public IMaterialTrackingQuery setReturnReadOnlyRecords(boolean returnReadOnlyRecords) { this.returnReadOnlyRecords = returnReadOnlyRecords; return this; } @Override public boolean isReturnReadOnlyRecords() { return returnReadOnlyRecords; } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\impl\MaterialTrackingQuery.java
1
请完成以下Spring Boot application配置
server.port=8080 #spring.activemq.broker-url=tcp://60.205.191.82:8081 #spring.activemq.user=admin #spring.activemq.password=admin #spring.activemq.in-memory=true #spring.activemq.pool.enabled=false activemq.switch=true activemq.url=failover:(tcp://localhost:61616) jsa.activemq.queue.name_1=test_queue_1 jsa.activemq...
ctivemq.simple.queue.name_2=simpe_queue_2 jsa.activemq.simple.queue.name_3=simpe_queue_3 jsa.activemq.simple.queue.name_4=simpe_queue_4 jsa.activemq.simple.queue.name_5=simpe_queue_5 jsa.activemq.simple.names.concurrency=1,2,3,4,5 test=today
repos\spring-boot-quick-master\quick-activemq2\src\main\resources\application.properties
2
请完成以下Java代码
public void setPP_Product_BOMLine(final org.eevolution.model.I_PP_Product_BOMLine PP_Product_BOMLine) { set_ValueFromPO(COLUMNNAME_PP_Product_BOMLine_ID, org.eevolution.model.I_PP_Product_BOMLine.class, PP_Product_BOMLine); } @Override public void setPP_Product_BOMLine_ID (final int PP_Product_BOMLine_ID) { i...
} @Override public void setQtyEntered (final @Nullable BigDecimal QtyEntered) { set_Value (COLUMNNAME_QtyEntered, QtyEntered); } @Override public BigDecimal getQtyEntered() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyEntered); return bd != null ? bd : BigDecimal.ZERO; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_OrderLine_Candidate.java
1
请完成以下Java代码
public PickingJobStepPickedTo removing(final List<PickingJobStepPickedToHU> toRemove) { if (toRemove.isEmpty()) { return this; } final ImmutableList<PickingJobStepPickedToHU> actualPickedHUsNew = this.actualPickedHUs.stream() .filter(pickedHU -> !toRemove.contains(pickedHU)) .collect(ImmutableList....
@NonNull public List<HuId> getPickedHuIds() { return actualPickedHUs.stream() .map(PickingJobStepPickedToHU::getActualPickedHU) .map(HUInfo::getId) .collect(ImmutableList.toImmutableList()); } @NonNull public Optional<PickingJobStepPickedToHU> getLastPickedHu() { return actualPickedHUs.stream() ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\model\PickingJobStepPickedTo.java
1
请在Spring Boot框架中完成以下Java代码
public String getPayType() { return payType; } public void setPayType(String payType) { this.payType = payType; } public Integer getNumberOfStages() { return numberOfStages; } public void setNumberOfStages(Integer numberOfStages) { this.numberOfStages = numberO...
return "ScanPayRequestBo{" + "payKey='" + payKey + '\'' + ", productName='" + productName + '\'' + ", orderNo='" + orderNo + '\'' + ", orderPrice=" + orderPrice + ", orderIp='" + orderIp + '\'' + ", orderDate='" + orderDate ...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\trade\bo\ScanPayRequestBo.java
2
请完成以下Java代码
protected void onCurrentItemChanged(MTreeNode node) { onTreeNodeSelected(node); } }; treeSearchLabel.setText(msgBL.getMsg(Env.getCtx(), "TreeSearch") + " "); treeSearchLabel.setLabelFor(treeSearch); treeSearchLabel.setToolTipText(msgBL.getMsg(Env.getCtx(), "TreeSearchText")); treeSearch.setBackgro...
{ treeSearchAutoCompleter.setTreeNodes(root); } /** @return the search label of {@link #getSearchField()} */ public final CLabel getSearchFieldLabel() { return treeSearchLabel; } /** @return the search field (with auto-complete support) */ public final CTextField getSearchField() { return treeSearch; }...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\tree\VTreePanelSearchSupport.java
1
请完成以下Java代码
private final String getQtyCapacityUOMSymbol() { final I_C_UOM uom = IHUPIItemProductBL.extractUOMOrNull(getM_HU_PI_Item_Product()); if (uom == null) { return null; } return uom.getUOMSymbol(); } /** * * @return QtyMoved / QtyPlanned string */ private String getQtysDisplayName() { if (_qtyTU...
return this; } @Override public IHUPIItemProductDisplayNameBuilder setQtyTUMoved(final BigDecimal qtyTUMoved) { _qtyTUMoved = qtyTUMoved; return this; } @Override public IHUPIItemProductDisplayNameBuilder setQtyTUMoved(final int qtyTUMoved) { setQtyTUMoved(BigDecimal.valueOf(qtyTUMoved)); return this;...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\HUPIItemProductDisplayNameBuilder.java
1
请完成以下Java代码
public static class GitIgnoreSection implements Section { private final String name; private final LinkedList<String> items; public GitIgnoreSection(String name) { this.name = name; this.items = new LinkedList<>(); } public void add(String... items) { this.items.addAll(Arrays.asList(items)); } ...
@Override public void write(PrintWriter writer) { if (!this.items.isEmpty()) { if (this.name != null) { writer.println(); writer.println(String.format("### %s ###", this.name)); } this.items.forEach(writer::println); } } } }
repos\initializr-main\initializr-generator-spring\src\main\java\io\spring\initializr\generator\spring\scm\git\GitIgnore.java
1
请完成以下Java代码
public class C_Workplace_PrintQRCode_ViewSelection extends ViewBasedProcessTemplate implements IProcessPrecondition { private final WorkplaceService workplaceService = SpringContextHolder.instance.getBean(WorkplaceService.class); private final GlobalQRCodeService globalQRCodeService = SpringContextHolder.instance.get...
return MSG_OK; } private Collection<Workplace> getWorkplaces() { final ImmutableSet<WorkplaceId> workplaceIds = streamSelectedRows() .map(row -> row.getId().toId(WorkplaceId::ofRepoId)) .collect(ImmutableSet.toImmutableSet()); return workplaceService.getByIds(workplaceIds); } private static Immutabl...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\workplace\qrcode\process\C_Workplace_PrintQRCode_ViewSelection.java
1
请完成以下Java代码
public class MHRPayroll extends X_HR_Payroll { /** * */ private static final long serialVersionUID = -1407037967021019961L; /** Cache */ private static CCache<Integer, MHRPayroll> s_cache = new CCache<Integer, MHRPayroll>(Table_Name, 10); /** Cache */ private static CCache<String, MHRPayroll> s_cacheValue = n...
{ payroll = null; } return payroll; } /** * Standard Constructor * @param ctx context * @param HR_Payroll_ID id */ public MHRPayroll (Properties ctx, int HR_Payroll_ID, String trxName) { super (ctx, HR_Payroll_ID, trxName); if (HR_Payroll_ID == 0) { setProcessing (false); // N } } // HR...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.libero.liberoHR\src\main\java\org\eevolution\model\MHRPayroll.java
1
请完成以下Java代码
public int getQuantity() { return quantity; } public void setQuantity(int quantity) { this.quantity = quantity; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } public int getWeight() { return weight; } public void setWeight(int weight) { this....
public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @ManyToOne @JoinColumn(name = "customer_id") private User customer; }
repos\E-commerce-project-springBoot-master2\JtProject\src\main\java\com\jtspringproject\JtSpringProject\models\Product.java
1
请完成以下Java代码
public static boolean isPalindromeHalfReversal(int number) { if (number < 0 || (number % 10 == 0 && number != 0)) { return false; } int reversedNumber = 0; while (number > reversedNumber) { reversedNumber = reversedNumber * 10 + number % 10; number /...
int divisor = 1; while (number / divisor >= 10) { divisor *= 10; } while (number != 0) { int leading = number / divisor; int trailing = number % 10; if (leading != trailing) { return false; } number = (num...
repos\tutorials-master\algorithms-modules\algorithms-numeric\src\main\java\com\baeldung\algorithms\palindrome\PalindromeNumber.java
1
请在Spring Boot框架中完成以下Java代码
public class OpenTelemetryTracingProperties { /** * Span export configuration. */ private final Export export = new Export(); public Export getExport() { return this.export; } public static class Export { /** * Whether unsampled spans should be exported. */ private boolean includeUnsampled; ...
this.timeout = timeout; } public int getMaxBatchSize() { return this.maxBatchSize; } public void setMaxBatchSize(int maxBatchSize) { this.maxBatchSize = maxBatchSize; } public int getMaxQueueSize() { return this.maxQueueSize; } public void setMaxQueueSize(int maxQueueSize) { this.maxQueu...
repos\spring-boot-4.0.1\module\spring-boot-micrometer-tracing-opentelemetry\src\main\java\org\springframework\boot\micrometer\tracing\opentelemetry\autoconfigure\OpenTelemetryTracingProperties.java
2
请在Spring Boot框架中完成以下Java代码
private ClassInfo parseTableStructure(ParamInfo paramInfo) throws Exception { String dataType = MapUtil.getString(paramInfo.getOptions(), "dataType"); ParserTypeEnum parserType = ParserTypeEnum.fromValue(dataType); // 添加调试信息 log.debug("解析数据类型: {}, 解析结果: {}", dataType, parserType...
return sqlParserService.processInsertSqlToClassInfo(paramInfo); case SQL_REGEX: // 正则表达式模式(非完善版本):parse sql by regex return sqlParserService.processTableToClassInfoByRegex(paramInfo); case SELECT_SQL: // SelectSqlBySQLPraser模式:parse select sql by J...
repos\SpringBootCodeGenerator-master\src\main\java\com\softdev\system\generator\service\impl\CodeGenServiceImpl.java
2
请完成以下Java代码
public static MaterialCockpitDetailsRowAggregation getValueOrDefault(@Nullable final String value) { for (final MaterialCockpitDetailsRowAggregation aggregation : MaterialCockpitDetailsRowAggregation.values()) { if (aggregation.name().equalsIgnoreCase(value)) { return aggregation; } } return getDe...
public boolean isNone() { return this == NONE; } public boolean isPlant() { return this == PLANT; } public boolean isWarehouse() { return this == WAREHOUSE; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\material\cockpit\MaterialCockpitDetailsRowAggregation.java
1
请完成以下Java代码
private DocumentFilterDescriptorsProvider createFiltersProvider( @NonNull final String tableName) { if (!I_C_BPartner.Table_Name.equals(tableName)) { logger.debug("Skip creating Postgres FTS filters because table {} isn't supported", tableName); return NullDocumentFilterDescriptorsProvider.instance; } ...
final ITranslatableString caption = TranslatableStrings.adMessage(MSG_FULL_TEXT_SEARCH_CAPTION); return ImmutableDocumentFilterDescriptorsProvider.of( DocumentFilterDescriptor.builder() .setFilterId(FILTER_ID) .setSortNo(DocumentFilterDescriptorsConstants.SORT_NO_POSTGRES_FULL_TEXT_SEARCH) .set...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\provider\fullTextSearch\PostgresFTSDocumentFilterDescriptorsProviderFactory.java
1
请完成以下Java代码
public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String getCondition() { return condition; }
public void setCondition(String condition) { this.condition = condition; } public static QueryRuleEnum getByValue(String value){ if(oConvertUtils.isEmpty(value)) { return null; } for(QueryRuleEnum val :values()){ if (val.getValue().equals(value) || val.getCondition().equalsIgnor...
repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\system\query\QueryRuleEnum.java
1
请完成以下Java代码
public ValueConversionException setFieldName(@Nullable final String fieldName) { setParameter("fieldName", fieldName); return this; } public ValueConversionException setWidgetType(@Nullable final DocumentFieldWidgetType widgetType) { setParameter("widgetType", widgetType); return this; } publi...
} public ValueConversionException setTargetType(@Nullable final Class<?> targetType) { setParameter("targetType", targetType); return this; } public ValueConversionException setLookupDataSource(@Nullable final LookupValueByIdSupplier lookupDataSource) { setParameter("lookupDataSource", lookupDataSo...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\datatypes\DataTypes.java
1