instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | static byte[] toIntegerBytes(BigInteger bigInt) {
int bitlen = bigInt.bitLength();
// round bitlen
bitlen = ((bitlen + 7) >> 3) << 3;
byte[] bigBytes = bigInt.toByteArray();
if (((bigInt.bitLength() % 8) != 0) && (((bigInt.bitLength() / 8) + 1) == (bitlen / 8))) {
re... | byte[] resizedBytes = new byte[bitlen / 8];
System.arraycopy(bigBytes, startSrc, resizedBytes, startDst, len);
return resizedBytes;
}
/**
* Resets this Base64 object to its initial newly constructed state.
*/
private void reset() {
buffer = null;
pos = 0;
r... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\digest\_apacheCommonsCodec\Base64.java | 1 |
请完成以下Java代码 | public class Product {
private final UUID id;
private final BigDecimal price;
private final String name;
@JsonCreator
public Product(@JsonProperty("id") final UUID id, @JsonProperty("price") final BigDecimal price, @JsonProperty("name") final String name) {
this.id = id;
this.price ... | public UUID getId() {
return id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Product product = (Product) o;
return Objects.equals(id, product.id) && Objects.equals(price, product... | repos\tutorials-master\patterns-modules\ddd\src\main\java\com\baeldung\dddhexagonalspring\domain\Product.java | 1 |
请完成以下Java代码 | public void preventCompleteIfMissingSalesPartner(@NonNull final I_C_Order orderRecord)
{
final DocumentSalesRepDescriptor documentSalesRepDescriptor = documentSalesRepDescriptorFactory.forDocumentRecord(orderRecord);
if (documentSalesRepDescriptor.validatesOK())
{
return; // nothing to do
}
throw docume... | }
final OrgId orderOrgId = OrgId.ofRepoId(orderRecord.getAD_Org_ID());
final BPartnerId salesBPartnerIdBySalesCode = bpartnerDAO
.getBPartnerIdBySalesPartnerCode(orderRecord.getSalesPartnerCode(), ImmutableSet.of(orderOrgId, OrgId.ANY))
.orElse(null);
if (salesBPartnerIdBySalesCode != null && !salesBPar... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\commission\salesrep\interceptor\C_Order.java | 1 |
请完成以下Java代码 | public JwsAlgorithm getAlgorithm() {
return super.getAlgorithm();
}
/**
* Returns a new {@link Builder}, initialized with the provided {@link JwsAlgorithm}.
* @param jwsAlgorithm the {@link JwsAlgorithm}
* @return the {@link Builder}
*/
public static Builder with(JwsAlgorithm jwsAlgorithm) {
return new ... | private Builder(JwsHeader headers) {
Assert.notNull(headers, "headers cannot be null");
getHeaders().putAll(headers.getHeaders());
}
/**
* Builds a new {@link JwsHeader}.
* @return a {@link JwsHeader}
*/
@Override
public JwsHeader build() {
return new JwsHeader(getHeaders());
}
}
} | repos\spring-security-main\oauth2\oauth2-jose\src\main\java\org\springframework\security\oauth2\jwt\JwsHeader.java | 1 |
请完成以下Java代码 | public String getType() {
return type;
}
@Override
public void setType(String type) {
this.type = type;
}
@Override
public String getProcessDefinitionId() {
return processDefinitionId;
}
@Override
public void setProcessDefinitionId(String processDefinitionI... | @Override
public byte[] getData() {
return data;
}
@Override
public void setData(byte[] data) {
this.data = data;
}
@Override
public String getLockOwner() {
return lockOwner;
}
@Override
public void setLockOwner(String lockOwner) {
this.lockOwne... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\persistence\entity\EventLogEntryEntityImpl.java | 1 |
请完成以下Java代码 | public SpinJsonDataFormatException unableToDetectCanonicalType(Object parameter) {
return new SpinJsonDataFormatException(exceptionMessage("008", "Cannot detect canonical data type for parameter '{}'", parameter));
}
public SpinJsonDataFormatException unableToMapInput(Object input, Exception cause) {
retur... | return new SpinJsonPathException(
exceptionMessage("013", "Unable to evaluate JsonPath expression on element '{}'", node.getClass().getName()), cause);
}
public SpinJsonPathException unableToCompileJsonPathExpression(String expression, Exception cause) {
return new SpinJsonPathException(
exceptionM... | repos\camunda-bpm-platform-master\spin\dataformat-json-jackson\src\main\java\org\camunda\spin\impl\json\jackson\JacksonJsonLogger.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setSessionLanguage(@NonNull final LanguageKey language)
{
final HttpSession httpSession = getCurrentHttpSessionOrNull();
if (httpSession == null)
{
throw new IllegalStateException("No session");
}
httpSession.setAttribute(I18N.HTTP_SESSION_language, language);
}
public LanguageKey getCurren... | return getLanguageData(language).getFrontendMessagesMap();
}
private static class LanguageData
{
@Getter
private final ResourceBundle resourceBundle;
@Getter
private final ImmutableMap<String, String> frontendMessagesMap;
private LanguageData(final @NonNull LanguageKey language)
{
resourceBundle = R... | repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\service\I18N.java | 2 |
请完成以下Java代码 | public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
/**
* Return if the registration is enabled.
* @return if enabled (default {@code true})
*/
public boolean isEnabled() {
return this.enabled;
}
/**
* Set the order of the registration bean.
* @param order the order | */
public void setOrder(int order) {
this.order = order;
}
/**
* Get the order of the registration bean.
* @return the order
*/
@Override
public int getOrder() {
return this.order;
}
} | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\web\servlet\RegistrationBean.java | 1 |
请完成以下Java代码 | public int getAD_Table_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_Table_ID);
}
@Override
public void setDescription (final java.lang.String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
@Override
public java.lang.String getDescription()
{
return get_ValueAsString(COLUMNNAME_Descri... | {
return get_ValueAsBoolean(COLUMNNAME_IsManualImport);
}
@Override
public void setIsMultiLine (final boolean IsMultiLine)
{
set_Value (COLUMNNAME_IsMultiLine, IsMultiLine);
}
@Override
public boolean isMultiLine()
{
return get_ValueAsBoolean(COLUMNNAME_IsMultiLine);
}
@Override
public void setName... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_ImpFormat.java | 1 |
请完成以下Java代码 | private static <T> Set<T> toUnmodifiableSet(@NonNull final Collection<T> collection)
{
if (collection.isEmpty())
{
return ImmutableSet.of();
}
else if (collection instanceof ImmutableSet)
{
return (ImmutableSet<T>)collection;
}
else
{
// avoid using ImmutableSet because the given set might con... | public final InSetPredicate<T> intersectWith(@NonNull final T... onlyValues)
{
return intersectWith(only(onlyValues));
}
public InSetPredicate<T> intersectWith(@NonNull final Set<T> onlyValues)
{
return intersectWith(only(onlyValues));
}
public InSetPredicate<T> intersectWith(@NonNull final InSetPredicate<T... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\InSetPredicate.java | 1 |
请完成以下Java代码 | public Mono<UserViewWrapper> currentUser() {
return userSessionProvider.getCurrentUserSessionOrEmpty()
.map(UserView::fromUserAndToken)
.map(UserViewWrapper::new);
}
@PutMapping("/user")
public Mono<UserViewWrapper> updateUser(@RequestBody @Valid UpdateUserRequestWra... | .map(ProfileWrapper::new);
}
@PostMapping("/profiles/{username}/follow")
public Mono<ProfileWrapper> follow(@PathVariable String username) {
return userSessionProvider.getCurrentUserOrEmpty()
.flatMap(currentUser -> userFacade.follow(username, currentUser))
.map(Prof... | repos\realworld-spring-webflux-master\src\main\java\com\realworld\springmongo\api\UserController.java | 1 |
请完成以下Java代码 | public <T extends Number> T createGauge(String key, T number, String... tags) {
return meterRegistry.gauge(key, Tags.of(tags), number);
}
@Override
public <T extends Number> T createGauge(String type, String name, T number, String... tags) {
return createGauge(type, number, getTags(name, ta... | }
private static String[] getTags(String statsName, String[] otherTags) {
String[] tags = new String[]{STATS_NAME_TAG, statsName};
if (otherTags.length > 0) {
if (otherTags.length % 2 != 0) {
throw new IllegalArgumentException("Invalid tags array size");
}
... | repos\thingsboard-master\common\stats\src\main\java\org\thingsboard\server\common\stats\DefaultStatsFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void shutdownExecutor() {
if (executor != null) {
executor.shutdownNow();
}
}
@Override
public void processRestApiCallToRuleEngine(TenantId tenantId, UUID requestId, TbMsg request, boolean useQueueFromTbMsg, Consumer<TbMsg> responseConsumer) {
log.trace("[{}] Proc... | private void sendRequestToRuleEngine(TenantId tenantId, TbMsg msg, boolean useQueueFromTbMsg) {
clusterService.pushMsgToRuleEngine(tenantId, msg.getOriginator(), msg, useQueueFromTbMsg, null);
}
private void scheduleTimeout(TbMsg request, UUID requestId, ConcurrentMap<UUID, Consumer<TbMsg>> requestsMap... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\ruleengine\DefaultRuleEngineCallService.java | 2 |
请完成以下Java代码 | public I_DLM_Partition getPartitionToComplete()
{
return partitionToComplete;
}
@Override
public String toString()
{
return "CreatePartitionRequest [onNotDLMTable=" + onNotDLMTable + ", oldestFirst=" + oldestFirst + ", partitionToComplete=" + partitionToComplete + ", recordToAttach=" + recordToAttach +... | partitionRequest.getOnNotDLMTable());
this.partitionRequest = partitionRequest; // we use it for the toString() method
this.count = count;
this.dontReEnqueueAfter = dontReEnqueueAfter;
}
/**
* Only enqueue the given number of work packages (one after each other).
*
* @return
*/
public int g... | repos\metasfresh-new_dawn_uat\backend\de.metas.dlm\base\src\main\java\de\metas\dlm\partitioner\PartitionRequestFactory.java | 1 |
请完成以下Java代码 | public void processParameterValueChanges(final List<JSONDocumentChangedEvent> events, final ReasonSupplier reason)
{
parametersDocument.processValueChanges(events, reason);
}
@Override
public ProcessInstanceResult getExecutionResult()
{
Check.assumeNotNull(result, "action was already executed");
return resu... | }
private ResultAction processResultAction(final ResultAction resultAction, final IViewsRepository viewRepos)
{
if (resultAction == null)
{
return null;
}
if (resultAction instanceof CreateAndOpenIncludedViewAction)
{
final IView view = viewRepos.createView(((CreateAndOpenIncludedViewAction)resultAc... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\process\view\ViewActionInstance.java | 1 |
请完成以下Java代码 | public BulletedSection<String> getWarnings() {
return this.warnings;
}
public GettingStartedSection gettingStarted() {
return this.gettingStarted;
}
public PreDefinedSection nextSteps() {
return this.nextSteps;
}
public HelpDocument addSection(Section section) {
this.sections.add(section);
return thi... | public List<Section> getSections() {
return Collections.unmodifiableList(this.sections);
}
public void write(PrintWriter writer) throws IOException {
List<Section> allSections = new ArrayList<>();
allSections.add(this.warnings);
allSections.add(this.gettingStarted);
allSections.addAll(this.sections);
all... | repos\initializr-main\initializr-generator-spring\src\main\java\io\spring\initializr\generator\spring\documentation\HelpDocument.java | 1 |
请完成以下Java代码 | public void setVariable(String variableName, Object variableValue) {
variables.put(variableName, variableValue);
}
@Override
public void setTransientVariable(String variableName, Object variableValue) {
throw new UnsupportedOperationException();
}
public String getInstanceId() ... | @Override
public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
@Override
public Set<String> getVariableNames() {
return variables.keySet();
}
@Override
public String toString() {
ret... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\el\VariableContainerWrapper.java | 1 |
请完成以下Java代码 | private class PreAuthenticatedProcessingRequestMatcher implements RequestMatcher {
@Override
public boolean matches(HttpServletRequest request) {
Authentication currentUser = AbstractPreAuthenticatedProcessingFilter.this.securityContextHolderStrategy
.getContext()
.getAuthentication();
if (currentUse... | AbstractPreAuthenticatedProcessingFilter.this.logger
.debug("Pre-authenticated principal has changed and will be reauthenticated");
if (AbstractPreAuthenticatedProcessingFilter.this.invalidateSessionOnPrincipalChange) {
AbstractPreAuthenticatedProcessingFilter.this.securityContextHolderStrategy.clearContext(... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\preauth\AbstractPreAuthenticatedProcessingFilter.java | 1 |
请完成以下Java代码 | public boolean isExplicitProductPriceAttribute()
{
return olCandRecord.isExplicitProductPriceAttribute();
}
public int getFlatrateConditionsId()
{
return olCandRecord.getC_Flatrate_Conditions_ID();
}
public int getHUPIProductItemId()
{
final HUPIItemProductId packingInstructions = olCandEffectiveValuesBL... | public BPartnerInfo getBPartnerInfo()
{
return bpartnerInfo;
}
public boolean isAssignToBatch(@NonNull final AsyncBatchId asyncBatchIdCandidate)
{
if (this.asyncBatchId == null)
{
return false;
}
return asyncBatchId.getRepoId() == asyncBatchIdCandidate.getRepoId();
}
public void setHeaderAggregati... | repos\metasfresh-new_dawn_uat\backend\de.metas.salescandidate.base\src\main\java\de\metas\ordercandidate\api\OLCand.java | 1 |
请完成以下Java代码 | public void setCRM_Occupation_ID (final int CRM_Occupation_ID)
{
if (CRM_Occupation_ID < 1)
set_ValueNoCheck (COLUMNNAME_CRM_Occupation_ID, null);
else
set_ValueNoCheck (COLUMNNAME_CRM_Occupation_ID, CRM_Occupation_ID);
}
@Override
public int getCRM_Occupation_ID()
{
return get_ValueAsInt(COLUMNNAM... | /** Job = B */
public static final String JOBTYPE_Job = "B";
/** Specialization = F */
public static final String JOBTYPE_Specialization = "F";
/** AdditionalSpecialization = Z */
public static final String JOBTYPE_AdditionalSpecialization = "Z";
@Override
public void setJobType (final @Nullable java.lang.String... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CRM_Occupation.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setPRICEQUAL(String value) {
this.pricequal = value;
}
/**
* Gets the value of the price property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPRICE() {
return price;
}
/**
* Sets the val... | *
*/
public String getPRICEBASIS() {
return pricebasis;
}
/**
* Sets the value of the pricebasis property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPRICEBASIS(String value) {
this.pricebasis = v... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_stepcom_desadv\de\metas\edi\esb\jaxb\stepcom\desadv\DPRIC1.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@Column(name = "name")
private String name;
@Column(name = "email")
private String email;
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "up_id")
private UserProfile userProfil... | public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public UserProfile getUserProfile() {
return userProfile;
}
public void setUserProfile(UserProfile userProfile) {
this.userProfile = userProfile;... | repos\Spring-Boot-Advanced-Projects-main\springboot-hibernate-one-one-mapping\src\main\java\net\alanbinu\springboot\entity\User.java | 2 |
请完成以下Java代码 | default ConfigurationPropertyState containsDescendantOf(ConfigurationPropertyName name) {
return ConfigurationPropertyState.UNKNOWN;
}
/**
* Return a filtered variant of this source, containing only names that match the
* given {@link Predicate}.
* @param filter the filter to match
* @return a filtered {@l... | default ConfigurationPropertySource withPrefix(@Nullable String prefix) {
return (StringUtils.hasText(prefix)) ? new PrefixedConfigurationPropertySource(this, prefix) : this;
}
/**
* Return the underlying source that is actually providing the properties.
* @return the underlying property source or {@code null}... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\properties\source\ConfigurationPropertySource.java | 1 |
请完成以下Java代码 | public java.lang.String getUnixAttachmentPath ()
{
return (java.lang.String)get_Value(COLUMNNAME_UnixAttachmentPath);
}
/** Set Suchschlüssel.
@param Value
Search key for the record in the format required - must be unique
*/
@Override
public void setValue (java.lang.String Value)
{
set_Value (COLUMN... | @Override
public java.lang.String getWindowsArchivePath ()
{
return (java.lang.String)get_Value(COLUMNNAME_WindowsArchivePath);
}
/** Set Windows Attachment Path.
@param WindowsAttachmentPath Windows Attachment Path */
@Override
public void setWindowsAttachmentPath (java.lang.String WindowsAttachmentPath)... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Client.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static MethodInterceptor preAuthorizeAuthorizationMethodInterceptor(
ObjectProvider<PrePostMethodSecurityConfiguration> _prePostMethodSecurityConfiguration) {
return new DeferringMethodInterceptor<>(preAuthorizePointcut,
() -> _prePostMethodSecurityConfiguration.getObject().preAuthorizeMethodInterceptor);
}
... | return new PrePostAuthorizeHintsRegistrar();
}
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
EnableMethodSecurity annotation = importMetadata.getAnnotations().get(EnableMethodSecurity.class).synthesize();
this.preFilterMethodInterceptor.setOrder(this.preFilterMethodInterceptor.get... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\method\configuration\PrePostMethodSecurityConfiguration.java | 2 |
请完成以下Java代码 | public ViewLayout getViewLayout(
final WindowId windowId,
final JSONViewDataType viewDataType,
final ViewProfileId profileId)
{
Check.assumeEquals(windowId, WINDOW_ID, "windowId");
return ViewLayout.builder()
.setWindowId(WINDOW_ID)
.setCaption(TranslatableStrings.empty())
.setAllowOpeningRow... | : null;
}
private static ViewId toBankStatementReconciliationViewId(@NonNull final ViewId paymentsToReconcileViewId)
{
return paymentsToReconcileViewId.withWindowId(BankStatementReconciliationViewFactory.WINDOW_ID);
}
@Override
public void closeById(final ViewId viewId, final ViewCloseAction closeAction)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\bankstatement_reconciliation\PaymentsToReconcileViewFactory.java | 1 |
请完成以下Java代码 | public void addTransitionInstanceReport(MigratingTransitionInstanceValidationReport instanceReport) {
transitionInstanceReports.add(instanceReport);
}
public List<MigratingActivityInstanceValidationReport> getActivityInstanceReports() {
return activityInstanceReports;
}
@Override
public List<Migrati... | sb.append("\tCannot migrate activity instance '")
.append(report.getActivityInstanceId())
.append("':\n");
for (String failure : report.getFailures()) {
sb.append("\t\t").append(failure).append("\n");
}
}
for (MigratingTransitionInstanceValidationReport report : transitionI... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\migration\validation\instance\MigratingProcessInstanceValidationReportImpl.java | 1 |
请完成以下Java代码 | public URI getURI() {
return this.delegate.getURI();
}
@Override
public String getName() {
return this.delegate.getName();
}
@Override
public String getFileName() {
return this.delegate.getFileName();
}
@Override
public InputStream newInputStream() throws IOException {
return this.delegate.newInputS... | }
Resource resolved = this.delegate.resolve(subUriPath);
return (resolved != null) ? new LoaderHidingResource(this.base, resolved) : null;
}
@Override
public boolean isAlias() {
return this.delegate.isAlias();
}
@Override
public URI getRealURI() {
return this.delegate.getRealURI();
}
@Override
publi... | repos\spring-boot-4.0.1\module\spring-boot-jetty\src\main\java\org\springframework\boot\jetty\servlet\LoaderHidingResource.java | 1 |
请完成以下Java代码 | public ImmutableList<I_M_Source_HU> retrieveSourceHuMarkers(@NonNull final Collection<HuId> huIds)
{
return queryBL
.createQueryBuilder(I_M_Source_HU.class)
.addOnlyActiveRecordsFilter()
.addInArrayFilter(I_M_Source_HU.COLUMN_M_HU_ID, huIds)
.create()
.listImmutable(I_M_Source_HU.class);
}
@Ov... | .addOnlyActiveRecordsFilter()
.addInSubQueryFilter(I_M_Source_HU.COLUMN_M_HU_ID, I_M_HU.COLUMN_M_HU_ID, huQuery)
.create()
.list();
}
@VisibleForTesting
static ICompositeQueryFilter<I_M_HU> createHuFilter(@NonNull final MatchingSourceHusQuery query)
{
final IQueryBL queryBL = Services.get(IQueryBL.cl... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\sourcehu\impl\SourceHuDAO.java | 1 |
请完成以下Java代码 | public boolean isFulfilled(ActivityExecutionTuple element) {
return errorDeclarationFinder.getErrorEventDefinition() != null || element == null;
}
});
} catch(Exception e) {
LOG.errorPropagationException(execution.getActivityInstanceId(), e);
// separate the exception handling ... | ErrorEventDefinition errorDefinition = errorDeclarationFinder.getErrorEventDefinition();
PvmExecutionImpl errorHandlingExecution = activityExecutionMappingCollector.getExecutionForScope(errorHandlingActivity.getEventScope());
if(errorDefinition.getErrorCodeVariable() != null) {
errorHandlingExecuti... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\helper\BpmnExceptionHandler.java | 1 |
请完成以下Java代码 | public boolean isUseSsl() {
return useSsl;
}
public void setUseSsl(boolean useSsl) {
this.useSsl = useSsl;
}
public boolean isUsePosixGroups() {
return usePosixGroups;
}
public void setUsePosixGroups(boolean usePosixGroups) {
this.usePosixGroups = usePosixGroups;
}
public SearchContr... | }
public void setAllowAnonymousLogin(boolean allowAnonymousLogin) {
this.allowAnonymousLogin = allowAnonymousLogin;
}
public boolean isAuthorizationCheckEnabled() {
return authorizationCheckEnabled;
}
public void setAuthorizationCheckEnabled(boolean authorizationCheckEnabled) {
this.authorizati... | repos\camunda-bpm-platform-master\engine-plugins\identity-ldap\src\main\java\org\camunda\bpm\identity\impl\ldap\LdapConfiguration.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static class GLNLocation
{
@NonNull
GlnWithLabel glnWithLabel;
@NonNull
OrgId orgId;
@NonNull
BPartnerLocationId bpLocationId;
boolean isMatching(@Nullable final Set<OrgId> onlyOrgIds,
@Nullable final String glnLookupLabel)
{
return isMatchingLookupLabel(glnLookupLabel) && isMatc... | {
return true;
}
return glnLookupLabel.equals(glnWithLabel.getLabel());
}
private boolean isMatchingOrgId(@Nullable final Set<OrgId> onlyOrgIds)
{
if (onlyOrgIds == null || onlyOrgIds.isEmpty())
{
return true;
}
return onlyOrgIds.contains(orgId);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\bpartner\service\impl\GLNLoadingCache.java | 2 |
请完成以下Java代码 | public class ProcessTaskItemHandler extends ProcessOrCaseTaskItemHandler {
protected CmmnActivityBehavior getActivityBehavior() {
return new ProcessTaskActivityBehavior();
}
protected ProcessTask getDefinition(CmmnElement element) {
return (ProcessTask) super.getDefinition(element);
}
protected Str... | return definition.getCamundaProcessBinding();
}
protected String getVersion(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context) {
ProcessTask definition = getDefinition(element);
return definition.getCamundaProcessVersion();
}
protected String getTenantId(CmmnElement element, Cmmn... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\handler\ProcessTaskItemHandler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List listByRoleIds(String roleIdsStr) {
return this.pmsMenuDao.listByRoleIds(roleIdsStr);
}
/**
* 根据菜单ID查找菜单(可用于判断菜单下是否还有子菜单).
*
* @param parentId
* .
* @return menuList.
*/
public List<PmsMenu> listByParentId(Long parentId) {
return pmsMenuDao.listByParentId(parentId);
}
/***
... | * 更新菜单.
*
* @param menu
*/
public void update(PmsMenu menu) {
pmsMenuDao.update(menu);
}
/**
* 根据角色查找角色对应的菜单ID集
*
* @param roleId
* @return
*/
public String getMenuIdsByRoleId(Long roleId) {
List<PmsMenuRole> menuList = pmsMenuRoleDao.listByRoleId(roleId);
StringBuffer menuIds = new String... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\permission\service\impl\PmsMenuServiceImpl.java | 2 |
请完成以下Java代码 | private String computeServerSecretApplicableAt(long time) {
return this.serverSecret + ":" + Long.valueOf(time % this.serverInteger).intValue();
}
/**
* @param serverSecret the new secret, which can contain a ":" if desired (never being
* sent to the client)
*/
public void setServerSecret(String serverSecre... | this.pseudoRandomNumberBytes = pseudoRandomNumberBytes;
}
public void setServerInteger(Integer serverInteger) {
this.serverInteger = serverInteger;
}
@Override
public void afterPropertiesSet() {
Assert.hasText(this.serverSecret, "Server secret required");
Assert.notNull(this.serverInteger, "Server integer ... | repos\spring-security-main\core\src\main\java\org\springframework\security\core\token\KeyBasedPersistenceTokenService.java | 1 |
请完成以下Java代码 | public int getAsyncExecutorDefaultAsyncJobAcquireWaitTime() {
return asyncExecutorDefaultAsyncJobAcquireWaitTime;
}
public ProcessEngineConfigurationImpl setAsyncExecutorDefaultAsyncJobAcquireWaitTime(int asyncExecutorDefaultAsyncJobAcquireWaitTime) {
this.asyncExecutorDefaultAsyncJobAcquireWai... | public ProcessEngineConfigurationImpl setAsyncExecutorTimerLockTimeInMillis(int asyncExecutorTimerLockTimeInMillis) {
this.asyncExecutorTimerLockTimeInMillis = asyncExecutorTimerLockTimeInMillis;
return this;
}
public int getAsyncExecutorAsyncJobLockTimeInMillis() {
return asyncExecutor... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\cfg\ProcessEngineConfigurationImpl.java | 1 |
请完成以下Java代码 | public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
ServerBootstrap b = new ServerBootstrap();
b.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel... | }
});
ChannelFuture f = b.bind(port)
.sync();
f.channel()
.closeFuture()
.sync();
} finally {
bossGroup.shutdownGracefully();
workerGroup.shutdownGracefully();
}
}
} | repos\tutorials-master\server-modules\netty\src\main\java\com\baeldung\http\server\HttpServer.java | 1 |
请完成以下Java代码 | private void process(@NonNull final ProductsToProcess productsToProcess)
{
final Action action = productsToProcess.getAction();
final InventoryId inventoryId = productsToProcess.getInventoryId();
for (final SecurPharmProduct product : productsToProcess.getProducts())
{
process(product, action, inventoryId);... | private enum Action
{
DECOMMISSION, UNDO_DECOMMISSION
}
@Value
@Builder
private static class ProductsToProcess
{
@NonNull
Action action;
@NonNull
InventoryId inventoryId;
@NonNull
@Singular
ImmutableList<SecurPharmProduct> products;
public boolean isEmpty()
{
return getProducts().isEmpt... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.securpharm\src\main\java\de\metas\vertical\pharma\securpharm\process\M_Inventory_SecurpharmActionRetry.java | 1 |
请完成以下Java代码 | String getRequestAsString()
{
return elementToString(requestElement);
}
@Nullable
String getResponseAsString()
{
return elementToString(responseElement);
}
@Nullable
private String elementToString(@Nullable final Object element)
{
if (element == null)
{
return null;
}
try
{
final StringR... | return cleanupPdfData(result.toString());
}
catch (final Exception ex)
{
throw new AdempiereException("Failed converting " + element + " to String", ex);
}
}
/**
* remove the pdfdata since it's long and useless and we also attach it to the PO record
*/
@NonNull
@VisibleForTesting
static String clea... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dpd\src\main\java\de\metas\shipper\gateway\dpd\logger\DpdClientLogEvent.java | 1 |
请在Spring Boot框架中完成以下Java代码 | void setAuthorizationEventPublisher(AuthorizationEventPublisher publisher) {
this.preAuthorizeMethodInterceptor.setAuthorizationEventPublisher(publisher);
this.postAuthorizeMethodInterceptor.setAuthorizationEventPublisher(publisher);
}
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
static MethodInterceptor pr... | @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
static MethodInterceptor postFilterAuthorizationMethodInterceptor(
ObjectProvider<PrePostMethodSecurityConfiguration> _prePostMethodSecurityConfiguration) {
return new DeferringMethodInterceptor<>(postFilterPointcut,
() -> _prePostMethodSecurityConfiguration.getObject... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\method\configuration\PrePostMethodSecurityConfiguration.java | 2 |
请完成以下Java代码 | public java.math.BigDecimal getLineNetAmt ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_LineNetAmt);
if (bd == null)
return BigDecimal.ZERO;
return bd;
}
/** Set Position.
@param LineNo
Zeile Nr.
*/
@Override
public void setLineNo (int LineNo)
{
set_Value (COLUMNNAME_LineNo, Integer.... | Produkt, Leistung, Artikel
*/
@Override
public void setM_Product_ID (int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
else
set_Value (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID));
}
/** Get Produkt.
@return Produkt, Leistung, Artikel
*/
@Override... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Customs_Invoice_Line.java | 1 |
请完成以下Java代码 | public col setAlign(String align)
{
addAttribute("align",align);
return(this);
}
/**
Sets the valign="" attribute convience variables are provided in the AlignType interface
@param valign Sets the valign="" attribute
*/
public col setVAlign(String valign... | @param hashcode name of element for hash table
@param element Adds an Element to the element.
*/
public col addElement(String hashcode,Element element)
{
addElementToRegistry(hashcode,element);
return(this);
}
/**
Adds an Element to the element.
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\xhtml\col.java | 1 |
请完成以下Java代码 | public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws IOException, ServletException {
if (!(authentication instanceof OidcLogoutAuthenticationToken)) {
if (this.logger.isErrorEnabled()) {
this.logger.error(Authentication.class.ge... | if (oidcLogoutAuthentication.isPrincipalAuthenticated()) {
this.securityContextLogoutHandler.logout(request, response,
(Authentication) oidcLogoutAuthentication.getPrincipal());
}
}
private void sendLogoutRedirect(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) t... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\oidc\web\authentication\OidcLogoutAuthenticationSuccessHandler.java | 1 |
请完成以下Java代码 | public String getProcessDefinitionKey() {
return subscriptionConfiguration.getProcessDefinitionKey();
}
@Override
public List<String> getProcessDefinitionKeyIn() {
return subscriptionConfiguration.getProcessDefinitionKeyIn();
}
@Override
public String getProcessDefinitionVersionTag() {
return ... | }
@Override
public boolean isIncludeExtensionProperties() {
return subscriptionConfiguration.getIncludeExtensionProperties();
}
protected String[] toArray(List<String> list) {
return list.toArray(new String[0]);
}
@Override
public void afterPropertiesSet() throws Exception {
}
} | repos\camunda-bpm-platform-master\spring-boot-starter\starter-client\spring\src\main\java\org\camunda\bpm\client\spring\impl\subscription\SpringTopicSubscriptionImpl.java | 1 |
请完成以下Java代码 | private static final class ICUpdateResult
{
private int countOk = 0;
private int countErrors = 0;
public void addInvoiceCandidate()
{
countOk++;
}
public void incrementErrorsCount()
{
countErrors++;
}
@Override
public String toString()
{
return getSummary();
}
public String getSu... | private final class ICTrxItemExceptionHandler extends FailTrxItemExceptionHandler
{
private final ICUpdateResult result;
public ICTrxItemExceptionHandler(@NonNull final ICUpdateResult result)
{
this.result = result;
}
/**
* Resets the given IC to its old values, and sets an error flag in it.
*/
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\InvoiceCandInvalidUpdater.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Cctop140V implements Serializable
{
/**
*
*/
private static final long serialVersionUID = -791114480567945931L;
private String cInvoiceID;
private String discount;
private Date discountDate;
private String discountDays;
private String rate;
public final String getcInvoiceID()
{
return cI... | {
if (other.discount != null)
{
return false;
}
}
else if (!discount.equals(other.discount))
{
return false;
}
if (discountDate == null)
{
if (other.discountDate != null)
{
return false;
}
}
else if (!discountDate.equals(other.discountDate))
{
return false;
}
if (di... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\invoicexport\compudata\Cctop140V.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class ThymeleafController {
@GetMapping("/thymeleaf")
public String hello(HttpServletRequest request, @RequestParam(value = "description", required = false, defaultValue = "springboot3-thymeleaf") String description) {
request.setAttribute("description", description);
return "thymeleaf";... | map.put("thymeleafText", "lanqiao");
map.put("number1", 2025);
map.put("number2", 3);
return "simple";
}
@GetMapping("/test")
public String test(ModelMap map) {
map.put("title", "Thymeleaf 语法测试");
map.put("testString", "玩转 Spring Boot");
map.put("bool", true)... | repos\spring-boot-projects-main\玩转SpringBoot系列案例源码\spring-boot-web-thymeleaf-syntax\src\main\java\cn\lanqiao\springboot3\controller\ThymeleafController.java | 2 |
请完成以下Java代码 | public I_M_ProductDownload getM_ProductDownload() throws RuntimeException
{
return (I_M_ProductDownload)MTable.get(getCtx(), I_M_ProductDownload.Table_Name)
.getPO(getM_ProductDownload_ID(), get_TrxName()); }
/** Set Product Download.
@param M_ProductDownload_ID
Product downloads
*/
public void setM... | public String getSerNo ()
{
return (String)get_Value(COLUMNNAME_SerNo);
}
/** Set URL.
@param URL
Full URL address - e.g. http://www.adempiere.org
*/
public void setURL (String URL)
{
set_ValueNoCheck (COLUMNNAME_URL, URL);
}
/** Get URL.
@return Full URL address - e.g. http://www.adempiere.org
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Delivery.java | 1 |
请完成以下Java代码 | private static I_C_PurchaseCandidate_Alloc createOrLoadRecord(@NonNull final PurchaseItem purchaseOrderItem)
{
final I_C_PurchaseCandidate_Alloc record;
if (purchaseOrderItem.getPurchaseItemId() != null)
{
record = load(purchaseOrderItem.getPurchaseItemId().getRepoId(), I_C_PurchaseCandidate_Alloc.class);
}... | .purchaseItemId(PurchaseItemId.ofRepoId(record.getC_PurchaseCandidate_Alloc_ID()))
.datePromised(TimeUtil.asZonedDateTime(record.getDatePromised()))
.dateOrdered(TimeUtil.asZonedDateTime(record.getDateOrdered()))
.purchasedQty(purchasedQty)
.remotePurchaseOrderId(record.getRemotePurchaseOrderId())
... | repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\remotepurchaseitem\PurchaseItemRepository.java | 1 |
请完成以下Java代码 | public void setField (org.compiere.model.GridField mField)
{
m_mField = mField;
EditorContextPopupMenu.onGridFieldSet(this);
} // setField
@Override
public GridField getField() {
return m_mField;
}
private class CInputVerifier extends InputVerifier {
@Override
public boolean verify(JComponent inpu... | return true;
//
try
{
String text = getText();
fireVetoableChange(m_columnName, null, text);
m_oldText = text;
return true;
}
catch (PropertyVetoException pve) {}
return true;
} // verify
} // CInputVerifier
// metas
@Override
public boolean isAutoCommit()
{
return true;
}
} // V... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VMemo.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getStageInstanceId() {
return stageInstanceId;
}
public void setStageInstanceId(String stageInstanceId) {
this.stageInstanceId = stageInstanceId;
}
public String getPlanItemDefinitionId() {
return planItemDefinitionId;
}
public void setPlanItemDefinitionI... | }
public void setIncludeEnded(Boolean includeEnded) {
this.includeEnded = includeEnded;
}
public Boolean getIncludeLocalVariables() {
return includeLocalVariables;
}
public void setIncludeLocalVariables(boolean includeLocalVariables) {
this.includeLocalVariables = includeL... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\planitem\PlanItemInstanceQueryRequest.java | 2 |
请完成以下Java代码 | public int getC_BPartner_ID()
{
return get_ValueAsInt(COLUMNNAME_C_BPartner_ID);
}
@Override
public void setC_Project_ID (final int C_Project_ID)
{
if (C_Project_ID < 1)
set_Value (COLUMNNAME_C_Project_ID, null);
else
set_Value (COLUMNNAME_C_Project_ID, C_Project_ID);
}
@Override
public int get... | return get_ValueAsInt(COLUMNNAME_C_Project_User_ID);
}
@Override
public void setDescription (final @Nullable java.lang.String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
@Override
public java.lang.String getDescription()
{
return get_ValueAsString(COLUMNNAME_Description);
}
@Over... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Project_User.java | 1 |
请完成以下Java代码 | public static DDOrderMoveSchedulePickedHUs ofList(@NonNull final List<DDOrderMoveSchedulePickedHU> list)
{
return new DDOrderMoveSchedulePickedHUs(list);
}
public static DDOrderMoveSchedulePickedHUs of(@NonNull final DDOrderMoveSchedulePickedHU pickedHU)
{
return new DDOrderMoveSchedulePickedHUs(ImmutableList.... | if (inTransitLocatorIds.isEmpty())
{
// shall not happen
return ExplainedOptional.emptyBecause("No in transit locator found");
}
else if (inTransitLocatorIds.size() == 1)
{
final LocatorId inTransitLocatorId = inTransitLocatorIds.iterator().next();
return ExplainedOptional.of(inTransitLocatorId);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\distribution\ddorder\movement\schedule\DDOrderMoveSchedulePickedHUs.java | 1 |
请完成以下Java代码 | public Builder tokenEndpointAuthenticationSigningAlgorithm(JwsAlgorithm authenticationSigningAlgorithm) {
return setting(ConfigurationSettingNames.Client.TOKEN_ENDPOINT_AUTHENTICATION_SIGNING_ALGORITHM,
authenticationSigningAlgorithm);
}
/**
* Sets the expected subject distinguished name associated to t... | return setting(ConfigurationSettingNames.Client.X509_CERTIFICATE_SUBJECT_DN, x509CertificateSubjectDN);
}
/**
* Builds the {@link ClientSettings}.
* @return the {@link ClientSettings}
*/
@Override
public ClientSettings build() {
return new ClientSettings(getSettings());
}
}
} | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\settings\ClientSettings.java | 1 |
请完成以下Java代码 | public final ProductsProposalView createView(@NonNull final CreateViewRequest request)
{
final ProductsProposalRowsData rowsData = loadRowsData(request);
return ProductsProposalView.builder()
.windowId(getWindowId())
.rowsData(rowsData)
.processes(getRelatedProcessDescriptors())
.build();
}
pri... | return views.getIfPresent(viewId);
}
protected final ProductsProposalView getById(final ViewId viewId)
{
final ProductsProposalView view = getByIdOrNull(viewId);
if (view == null)
{
throw new EntityNotFoundException("View not found: " + viewId.toJson());
}
return view;
}
@Override
public final void... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\products_proposal\view\ProductsProposalViewFactoryTemplate.java | 1 |
请在Spring Boot框架中完成以下Java代码 | protected Dashboard saveOrUpdate(EntitiesImportCtx ctx, Dashboard dashboard, EntityExportData<Dashboard> exportData, IdProvider idProvider, CompareResult compareResult) {
var tenantId = ctx.getTenantId();
Set<ShortCustomerInfo> assignedCustomers = Optional.ofNullable(dashboard.getAssignedCustomers()).o... | return dashboard;
}
@Override
protected Dashboard deepCopy(Dashboard dashboard) {
return new Dashboard(dashboard);
}
@Override
protected boolean isUpdateNeeded(EntitiesImportCtx ctx, EntityExportData<Dashboard> exportData, Dashboard prepared, Dashboard existing) {
return super.... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\sync\ie\importing\impl\DashboardImportService.java | 2 |
请完成以下Java代码 | public Inventory assigningTo(@NonNull final UserId newResponsibleId)
{
return assigningTo(newResponsibleId, false);
}
public Inventory reassigningTo(@NonNull final UserId newResponsibleId)
{
return assigningTo(newResponsibleId, true);
}
private Inventory assigningTo(@NonNull final UserId newResponsibleId, b... | }
public Stream<InventoryLine> streamLines(@Nullable final InventoryLineId onlyLineId)
{
return onlyLineId != null
? Stream.of(getLineById(onlyLineId))
: lines.stream();
}
public Set<LocatorId> getLocatorIdsEligibleForCounting(@Nullable final InventoryLineId onlyLineId)
{
return streamLines(onlyLineI... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inventory\Inventory.java | 1 |
请完成以下Java代码 | public Builder setFilters(final DocumentFilterList filters)
{
_filtersById.clear();
filters.forEach(filter -> {
final boolean notDuplicate = isNotDuplicateDocumentFilter(filter);
if (notDuplicate)
{
_filtersById.put(filter.getFilterId(), filter);
}
});
return this;
}
private Docu... | return this;
}
private boolean isRefreshViewOnChangeEvents()
{
return refreshViewOnChangeEvents;
}
public Builder viewInvalidationAdvisor(@NonNull final IViewInvalidationAdvisor viewInvalidationAdvisor)
{
this.viewInvalidationAdvisor = viewInvalidationAdvisor;
return this;
}
private IViewInv... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\DefaultView.java | 1 |
请完成以下Java代码 | public class ScriptValueProvider implements ParameterValueProvider {
protected ExecutableScript script;
public ScriptValueProvider(ExecutableScript script) {
this.script = script;
}
public Object getValue(VariableScope variableScope) {
ScriptInvocation invocation = new ScriptInvocation(script, variab... | return invocation.getInvocationResult();
}
@Override
public boolean isDynamic() {
return true;
}
public ExecutableScript getScript() {
return script;
}
public void setScript(ExecutableScript script) {
this.script = script;
}
} | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\scripting\ScriptValueProvider.java | 1 |
请完成以下Java代码 | public void updateLUTUConfigurationFromDocumentLine(@NonNull final I_M_HU_LUTU_Configuration lutuConfiguration, @NonNull final I_M_InOutLine documentLine)
{
final I_M_InOut customerReturn = documentLine.getM_InOut();
//
// Set BPartner / Location to be used
final BPartnerId bpartnerId = BPartnerId.ofRepoIdOrNu... | lutuConfiguration.setQtyTU(documentLine.getQtyEnteredTU().signum() == 0 ? BigDecimal.ONE: documentLine.getQtyEnteredTU());
lutuConfiguration.setIsInfiniteQtyTU(false);
lutuConfiguration.setQtyCUsPerTU(documentLine.getMovementQty());
lutuConfiguration.setIsInfiniteQtyCU(false);
}
@Override
public I_M_HU_PI_It... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inout\returns\customer\CustomerReturnLUTUConfigurationHandler.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class RabbitConfig {
/**
* Direct Exchange 示例的配置类
*/
public static class DirectExchangeDemoConfiguration {
// 创建 Queue
@Bean
public Queue demo12Queue() {
return new Queue(Demo12Message.QUEUE, // Queue 名字
true, // durable: 是否持久化
... | false); // exclusive: 是否排它
}
// 创建 Binding
// Exchange:Demo12Message.EXCHANGE
// Routing key:Demo12Message.ROUTING_KEY
// Queue:Demo12Message.QUEUE
@Bean
public Binding demo12Binding() {
return BindingBuilder.bind(demo12Queue()).to(demo12Exchange()).... | repos\SpringBoot-Labs-master\lab-04-rabbitmq\lab-04-rabbitmq-demo-ack\src\main\java\cn\iocoder\springboot\lab04\rabbitmqdemo\config\RabbitConfig.java | 2 |
请完成以下Java代码 | public class SysUserSysDepPostModel {
/**
* 用户ID
*/
private String id;
/**
* 用户名
*/
private String username;
/* 真实姓名 */
private String realname;
/**
* 头像
*/
@Excel(name = "头像", width = 15, type = 2)
private String avatar;
/**
* 生日
*/... | * 同步工作流引擎(1-同步 0-不同步)
*/
private String activitiSync;
/**
* 主岗位
*/
@Excel(name = "主岗位", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
private String mainDepPostId;
/**
*... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\SysUserSysDepPostModel.java | 1 |
请完成以下Spring Boot application配置 | server.port=8081
# Rabbitmq
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
spring.rabbitmq.virtual-host=test
spring.rabbitmq.addresses=192.168.83.128:5672
#spring.rabbitmq.addresses=192.168.35.128:5672,192.168.35.129:5672,192.168.35.130:5672
spring.rabbitmq.connection-timeout=50000
#rabbitmq listetner
#... | \u5F00\u542F\u53D1\u9001\u6D88\u606F\u5230exchange\u786E\u8BA4\u673A\u5236
spring.rabbitmq.publisher-confirms=true
#\u5F00\u542F\u53D1\u9001\u6D88\u606F\u5230exchange\u4F46\u662Fexchange\u6CA1\u6709\u548C\u961F\u5217\u7ED1\u5B9A\u7684\u786E\u8BA4\u673A\u5236
spring.rabbitmq.publisher-returns=true
# \u914D\u7F6ERPC\u8D8... | repos\spring-boot-student-master\spring-boot-student-rabbitmq\src\main\resources\application.properties | 2 |
请在Spring Boot框架中完成以下Java代码 | public Name getId() {
return id;
}
public void setId(Name id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
} | public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return username;
}
} | repos\tutorials-master\spring-security-modules\spring-security-ldap\src\main\java\com\baeldung\ldap\data\repository\User.java | 2 |
请完成以下Java代码 | private PPOrderCost createPPOrderCost(
final PPOrderCostCandidate candidate,
final CurrentCost currentCost)
{
final PPOrderCostTrxType trxType = candidate.getTrxType();
final CostSegment costSegment = candidate.getCostSegment();
final UomId uomId = candidate.getUomId();
final I_C_UOM uom = uomDAO.getByI... | .accumulatedQty(Quantity.zero(uom))
.build();
}
private Set<CostingMethod> getCostingMethodsWhichRequiredBOMRollup()
{
return ImmutableSet.of(
CostingMethod.AverageInvoice,
CostingMethod.AveragePO);
}
@Value
@Builder
private static class PPOrderCostCandidate
{
@NonNull
CostSegment costSegmen... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\api\impl\CreatePPOrderCostsCommand.java | 1 |
请完成以下Java代码 | public void setC_DocType_Correction_ID (int C_DocType_Correction_ID)
{
if (C_DocType_Correction_ID < 1)
set_Value (COLUMNNAME_C_DocType_Correction_ID, null);
else
set_Value (COLUMNNAME_C_DocType_Correction_ID, Integer.valueOf(C_DocType_Correction_ID));
}
/** Get Belegart korrektur.
@return Belegart ko... | Integer ii = (Integer)get_Value(COLUMNNAME_DocumentLinesNumber);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Abgabemeldung Konfiguration.
@param M_Shipment_Declaration_Config_ID Abgabemeldung Konfiguration */
@Override
public void setM_Shipment_Declaration_Config_ID (int M_Shipment_Declar... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Shipment_Declaration_Config.java | 1 |
请完成以下Java代码 | private void enqueueForTellNextWithRetry(TbContext ctx, TbMsg msg, int retryAttempt) {
if (retryAttempt <= config.getMaxRetries()) {
ctx.enqueueForTellNext(msg, TbNodeConnectionType.SUCCESS,
() -> log.trace("[{}][{}][{}] Successfully enqueue deduplication result message!", ctx.ge... | private String getMergedData(List<TbMsg> msgs) {
ArrayNode mergedData = JacksonUtil.newArrayNode();
msgs.forEach(msg -> {
ObjectNode msgNode = JacksonUtil.newObjectNode();
msgNode.set("msg", JacksonUtil.toJsonNode(msg.getData()));
msgNode.set("metadata", JacksonUtil.v... | repos\thingsboard-master\rule-engine\rule-engine-components\src\main\java\org\thingsboard\rule\engine\deduplication\TbMsgDeduplicationNode.java | 1 |
请完成以下Java代码 | public class ADProcessLoggable implements ILoggable
{
private static final Logger logger = LogManager.getLogger(ADProcessLoggable.class);
private final ReentrantLock mainLock = new ReentrantLock();
private final int bufferSize = 100;
@Nullable
private List<ProcessInfoLog> buffer;
@NonNull
private final PInstan... | logEntries = buffer;
this.buffer = null;
if (logEntries == null || logEntries.isEmpty())
{
return;
}
pInstanceDAO.saveProcessInfoLogs(pInstanceId, logEntries);
}
catch (final Exception ex)
{
// make sure flush never fails
logger.warn("Failed saving {} log entries but IGNORED: {}", logE... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\process\impl\ADProcessLoggable.java | 1 |
请完成以下Java代码 | private static int minSymmetricMod(int x) {
if (Math.abs(x % MOD) <= Math.abs((MOD - x) % MOD)) {
return x % MOD;
} else {
return -1 * ((MOD - x) % MOD);
}
}
private static int minSymmetricMod(long x) {
if (Math.abs(x % MOD) <= Math.abs((MOD - x) % MOD)) ... | return mod(result);
}
public static int modPower(int base, int exp) {
int result = 1;
int b = base;
while (exp > 0) {
if ((exp & 1) == 1) {
result = minSymmetricMod((long) minSymmetricMod(result) * (long) minSymmetricMod(b));
}
b = min... | repos\tutorials-master\core-java-modules\core-java-lang-math-4\src\main\java\com\baeldung\math\moduloarithmetic\ModularArithmetic.java | 1 |
请完成以下Java代码 | public void updateLastReceiptDate(@NonNull final ZonedDateTime receiptDate)
{
lastReceiptDate = max(lastReceiptDate, receiptDate);
}
public void updateLastShipmentDate(@NonNull final ZonedDateTime shipmentDate)
{
lastShipmentDate = max(lastShipmentDate, shipmentDate);
}
private static final ZonedDateTime ma... | public boolean isAfter(@Nullable LastInvoiceInfo other)
{
if (other == null)
{
return true;
}
else if (this.invoiceDate.compareTo(other.invoiceDate) > 0)
{
return true;
}
else if (this.invoiceDate.compareTo(other.invoiceDate) == 0)
{
return this.invoiceId.getRepoId() > other.invoic... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\bpartner\product\stats\BPartnerProductStats.java | 1 |
请完成以下Java代码 | public boolean isDataRow(final int row)
{
if (row < 0)
{
return false;
}
final int rows = p_table.getRowCount();
// If this is the Totals row (last row), we need to skip it - teo_sarca [ 2860556 ]
if (p_table.getShowTotals() && row == rows - 1)
{
return false;
}
return row < rows;
}
public ... | 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 final Properties getCtx()
{
r... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\search\Info.java | 1 |
请完成以下Spring Boot application配置 | # configuration mail service
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=email
spring.mail.password=password
spring.mail.properties.mail.smtp.auth=true
spring.mail.propertie | s.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true | repos\springboot-demo-master\picocli\src\main\resources\application.properties | 2 |
请在Spring Boot框架中完成以下Java代码 | public abstract class RabbitListenerConfigUtils {
/**
* The bean name of the internally managed Rabbit listener annotation processor.
*/
public static final String RABBIT_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME =
"org.springframework.amqp.rabbit.config.internalRabbitListenerAnnotationProcessor";
/**
* The... | * The default property to enable/disable MultiRabbit processing.
*/
public static final String MULTI_RABBIT_ENABLED_PROPERTY = "spring.multirabbitmq.enabled";
/**
* The bean name of the ContainerFactory of the default broker for MultiRabbit.
*/
public static final String MULTI_RABBIT_CONTAINER_FACTORY_BEAN_NA... | repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\config\RabbitListenerConfigUtils.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Date getIssuedAtDateFromToken(String token) {
return getClaimFromToken(token, Claims::getIssuedAt);
}
public Date getExpirationDateFromToken(String token) {
return getClaimFromToken(token, Claims::getExpiration);
}
public <T> T getClaimFromToken(String token, Function<Claims, T> claimsResolver) {
fin... | public String generateToken(UserDetails userDetails) {
Map<String, Object> claims = new HashMap<>();
return doGenerateToken(claims, userDetails.getUsername());
}
private String doGenerateToken(Map<String, Object> claims, String subject) {
return Jwts.builder().setClaims(claims).setSubject(subject).setIssuedAt... | repos\SpringBoot-Projects-FullStack-master\Advanced-SpringSecure\spring-boot-jwt-without-JPA\spring-boot-jwt\src\main\java\com\javainuse\config\JwtTokenUtil.java | 2 |
请完成以下Java代码 | public AttachmentEntry getById(@NonNull final AttachmentEntryId id)
{
return attachmentEntryRepository.getById(id);
}
public byte[] retrieveData(@NonNull final AttachmentEntryId attachmentEntryId)
{
return attachmentEntryRepository.retrieveAttachmentEntryData(attachmentEntryId);
}
public AttachmentEntryData... | */
public void save(@NonNull final AttachmentEntry attachmentEntry)
{
attachmentEntryRepository.save(attachmentEntry);
}
@Value
public static class AttachmentEntryQuery
{
List<String> tagsSetToTrue;
List<String> tagsSetToAnyValue;
Object referencedRecord;
String mimeType;
@Builder
private Attac... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\attachments\AttachmentEntryService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void onDeviceDeleted(Device device) {
Optional<DeviceId> gatewayDeviceId = getGatewayDeviceIdFromAdditionalInfoInDevice(device);
if (gatewayDeviceId.isPresent()) {
TextNode deletedDeviceNode = new TextNode(device.getName());
ToDeviceRpcRequest rpcRequest = formDeviceToGate... | true,
3,
null
);
}
private Optional<DeviceId> getGatewayDeviceIdFromAdditionalInfoInDevice(Device device) {
JsonNode deviceAdditionalInfo = device.getAdditionalInfo();
if (deviceAdditionalInfo != null && deviceAdditionalInfo.has(DataConstants.LAST_CONNECT... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\gateway_device\DefaultGatewayNotificationsService.java | 2 |
请完成以下Java代码 | public String getEmail() {
return email;
}
public void setEmail(final String email) {
this.email = email;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public int getAge() {
retu... | public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return id == user.id &&
age == user.age &&
Objects.equals(name, user.name) &&
Objects.equals(creationDate, user.cre... | repos\tutorials-master\persistence-modules\spring-data-jpa-enterprise\src\main\java\com\baeldung\boot\domain\User.java | 1 |
请完成以下Java代码 | public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Set<Book> getBooks() {
return books;
}
public void setBooks(Set<Book> books) {
this.books = books;
}
@Override
public boolean equals(Object obj) {
i... | return false;
}
return id != null && id.equals(((Author) obj).id);
}
@Override
public int hashCode() {
return 2021;
}
@Override
public String toString() {
return "Author{" + "id=" + id + ", name=" + name
+ ", genre=" + genre + ", age=" + age + '... | repos\Hibernate-SpringBoot-master\HibernateSpringBootCloneEntity\src\main\java\com\bookstore\entity\Author.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SecurityConfiguration {
@Bean
SecurityFilterChain webauthnFilterChain(HttpSecurity http, WebAuthNProperties webAuthNProperties) throws Exception {
return http.authorizeHttpRequests( ht -> ht.anyRequest().authenticated())
.formLogin(withDefaults())
.webAuthn( webauth ->
... | return new DbPublicKeyCredentialUserEntityRepository(userRepository);
}
@Bean
UserCredentialRepository userCredentialRepository(PasskeyUserRepository userRepository, PasskeyCredentialRepository credentialRepository) {
return new DbUserCredentialRepository(credentialRepository,userRepository);
}... | repos\tutorials-master\spring-security-modules\spring-security-passkey\src\main\java\com\baeldung\tutorials\passkey\config\SecurityConfiguration.java | 2 |
请完成以下Java代码 | public org.compiere.model.I_M_Ingredients getM_Ingredients()
{
return get_ValueAsPO(COLUMNNAME_M_Ingredients_ID, org.compiere.model.I_M_Ingredients.class);
}
@Override
public void setM_Ingredients(final org.compiere.model.I_M_Ingredients M_Ingredients)
{
set_ValueFromPO(COLUMNNAME_M_Ingredients_ID, org.compie... | @Override
public void setParentElement(final org.compiere.model.I_M_Ingredients ParentElement)
{
set_ValueFromPO(COLUMNNAME_ParentElement_ID, org.compiere.model.I_M_Ingredients.class, ParentElement);
}
@Override
public void setParentElement_ID (final int ParentElement_ID)
{
if (ParentElement_ID < 1)
set_... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Product_Ingredients.java | 1 |
请完成以下Java代码 | public boolean search(int value) {
Node current = this.head;
for (int i = level; i >= 0; i--) {
while (current.forward[i] != null && current.forward[i].value < value) {
current = current.forward[i];
}
}
current = current.forward[0];
return ... | }
while (level > 0 && head.forward[level] == null) {
level--;
}
}
}
private int randomLevel() {
int lvl = 0;
while (lvl < maxLevel && random.nextDouble() < 0.5) {
lvl++;
}
return lvl;
}
} | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-8\src\main\java\com\baeldung\algorithms\skiplist\SkipList.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Timestamp getRegisterTime() {
return registerTime;
}
public void setRegisterTime(Timestamp registerTime) {
this.registerTime = registerTime;
}
public UserTypeEnum getUserTypeEnum() {
return userTypeEnum;
}
public void setUserTypeEnum(UserTypeEnum userTypeEnum) {... | @Override
public String toString() {
return "UserEntity{" +
"id='" + id + '\'' +
", username='" + username + '\'' +
", password='" + password + '\'' +
", phone='" + phone + '\'' +
", mail='" + mail + '\'' +
", li... | repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Common-Service-Facade\src\main\java\com\gaoxi\entity\user\UserEntity.java | 2 |
请完成以下Java代码 | private I_C_Order checkAndGetOrder(final Object model)
{
Check.assumeNotNull(model, "model not null");
final I_C_Order order = InterfaceWrapperHelper.create(model, I_C_Order.class);
Check.assume(!order.isSOTrx(), "Only purchase orders are handled: {}", order);
Check.assume(!Services.get(IOrderBL.class).isRequ... | final IReceiptScheduleProducer orderLineProducer = createOrderLineReceiptScheduleProducer();
final List<I_C_OrderLine> orderLines = Services.get(IOrderDAO.class).retrieveOrderLines(order);
for (final I_C_OrderLine ol : orderLines)
{
orderLineProducer.updateReceiptSchedules(ol);
}
}
@Override
public void... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\spi\impl\OrderReceiptScheduleProducer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Product implements Serializable, Cloneable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private Category category;
private double price;
public Long getId() {
return id;
}
public void setId(Long id) {
th... | public void setCategory(Category category) {
this.category = category;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
@Override
public Product clone() throws CloneNotSupportedException {
Product clone... | repos\tutorials-master\persistence-modules\java-jpa-4\src\main\java\com\baeldung\jpa\cloneentity\Product.java | 2 |
请完成以下Java代码 | public static IndentingWriterFactory withDefaultSettings() {
return create(new SimpleIndentStrategy(" "));
}
/**
* Create a {@link IndentingWriterFactory} with a single indenting strategy.
* @param defaultIndentingStrategy the default indenting strategy to use
* @return an {@link IndentingWriterFactory}
... | private final Function<Integer, String> defaultIndentingStrategy;
private final Map<String, Function<Integer, String>> indentingStrategies = new HashMap<>();
private Builder(Function<Integer, String> defaultIndentingStrategy) {
this.defaultIndentingStrategy = defaultIndentingStrategy;
}
/**
* Register ... | repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\io\IndentingWriterFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public FormLoginConfigurer<H> passwordParameter(String passwordParameter) {
getAuthenticationFilter().setPasswordParameter(passwordParameter);
return this;
}
/**
* Forward Authentication Failure Handler
* @param forwardUrl the target URL in case of failure
* @return the {@link FormLoginConfigurer} for addi... | /**
* Gets the HTTP parameter that is used to submit the password.
* @return the HTTP parameter that is used to submit the password
*/
private String getPasswordParameter() {
return getAuthenticationFilter().getPasswordParameter();
}
/**
* If available, initializes the {@link DefaultLoginPageGeneratingFil... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\FormLoginConfigurer.java | 2 |
请完成以下Java代码 | /* package */final class CalloutMethodPointcutKey
{
public static final CalloutMethodPointcutKey of(final String columnName)
{
return new CalloutMethodPointcutKey(columnName);
}
private final String columnName;
private CalloutMethodPointcutKey(final String columnName)
{
super();
Check.assumeNotEmpty(colu... | {
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final CalloutMethodPointcutKey other = (CalloutMethodPointcutKey)obj;
return columnName.equals(other.columnName);
}
public String getColumnName()
{
return col... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\callout\annotations\api\impl\CalloutMethodPointcutKey.java | 1 |
请完成以下Java代码 | public class M_InOutLine
{
private final IFlatrateBL flatrateBL = Services.get(IFlatrateBL.class);
@ModelChange(timings = { ModelValidator.TYPE_AFTER_NEW, ModelValidator.TYPE_AFTER_CHANGE })
public void updateFLatrateDataEntryQtyAdd(final I_M_InOutLine doc)
{
if (doc.getM_Product_ID() <= 0)
{
return; // not... | @ModelChange(timings = { ModelValidator.TYPE_BEFORE_CHANGE, ModelValidator.TYPE_BEFORE_DELETE })
public void updateFLatrateDataEntryQtySubstract(final I_M_InOutLine doc)
{
if (doc.getM_Product_ID() <= 0)
{
return; // nothing to do/avoid NPE
}
flatrateBL.updateFlatrateDataEntryQty(
loadOutOfTrx(doc.getM... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\interceptor\M_InOutLine.java | 1 |
请完成以下Java代码 | WebEndpointResponse<Resource> sbom(@Selector String id) {
Resource resource = this.sbomEndpoint.sbom(id);
if (resource == null) {
return new WebEndpointResponse<>(WebEndpointResponse.STATUS_NOT_FOUND);
}
MimeType type = getMediaType(id, resource);
return (type != null) ? new WebEndpointResponse<>(resource,... | SPDX(MimeType.valueOf("application/spdx+json")) {
@Override
boolean matches(String content) {
return content.contains("\"spdxVersion\"");
}
},
SYFT(MimeType.valueOf("application/vnd.syft+json")) {
@Override
boolean matches(String content) {
return content.contains("\"FoundBy\"") || content.co... | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\sbom\SbomEndpointWebExtension.java | 1 |
请完成以下Java代码 | public static GraphQlWebSocketMessage error(String id, List<GraphQLError> errors) {
Assert.notNull(errors, "GraphQlError's are required");
return new GraphQlWebSocketMessage(id, GraphQlWebSocketMessageType.ERROR,
errors.stream().map(GraphQLError::toSpecification).collect(Collectors.toList()));
}
/**
* Crea... | * @param payload an optional payload
*/
public static GraphQlWebSocketMessage ping(@Nullable Object payload) {
return new GraphQlWebSocketMessage(null, GraphQlWebSocketMessageType.PING, payload);
}
/**
* Create a {@code "pong"} client or server message.
* @param payload an optional payload
*/
public stat... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\server\support\GraphQlWebSocketMessage.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean hasErrors() {
return !this.errors.isEmpty();
}
/**
* Return error details regarding the validation attempt
* @return the collection of results in this result, if any; returns an empty list
* otherwise
*/
public Collection<Saml2Error> getErrors() {
return Collections.unmodifiableCollection... | private Builder(Saml2Error... errors) {
this(Arrays.asList(errors));
}
private Builder(Collection<Saml2Error> errors) {
Assert.noNullElements(errors, "errors cannot have null elements");
this.errors = new ArrayList<>(errors);
}
public Builder errors(Consumer<Collection<Saml2Error>> errorsConsumer) {
... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\provider\service\authentication\logout\Saml2LogoutValidatorResult.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class MainApplication {
private final BookstoreService bookstoreService;
public MainApplication(BookstoreService bookstoreService) {
this.bookstoreService = bookstoreService;
}
public static void main(String[] args) {
SpringApplication.run(MainApplication.class, args);
}
... | System.out.println("\n\nFetch by multiple IDs via @Query:");
bookstoreService.fetchByMultipleIdsIn();
System.out.println("\n\nFetch by multiple IDs via MultipleIdsRepository.byMultipleIds:");
bookstoreService.fetchByMultipleIds();
System.out.println("\n\nFetch by multip... | repos\Hibernate-SpringBoot-master\HibernateSpringBootLoadMultipleIds\src\main\java\com\bookstore\MainApplication.java | 2 |
请完成以下Java代码 | public class AuthorEventHandler {
Logger logger = Logger.getLogger("Class AuthorEventHandler");
public AuthorEventHandler() {
super();
}
@HandleBeforeCreate
public void handleAuthorBeforeCreate(Author author) {
logger.info("Inside Author Before Create....");
String name = ... | }
@HandleBeforeDelete
public void handleAuthorBeforeDelete(Author author) {
logger.info("Inside Author Before Delete ....");
String name = author.getName();
}
@HandleAfterDelete
public void handleAuthorAfterDelete(Author author) {
logger.info("Inside Author After Delete .... | repos\tutorials-master\persistence-modules\spring-data-rest-2\src\main\java\com\baeldung\books\events\AuthorEventHandler.java | 1 |
请完成以下Java代码 | public void processAnnotatedType(@Observes ProcessAnnotatedType<Flyway> patEvent) {
patEvent.configureAnnotatedType()
//Add Scope
.add(ApplicationScoped.Literal.INSTANCE)
//Add Qualifier
.add(new AnnotationLiteral<FlywayType>() {
})... | .types(javax.sql.DataSource.class, DataSource.class)
.qualifiers(new AnnotationLiteral<Default>() {}, new AnnotationLiteral<Any>() {})
.scope(ApplicationScoped.class)
.name(DataSource.class.getName())
.beanClass(DataSource.class)
.createWit... | repos\tutorials-master\di-modules\flyway-cdi-extension\src\main\java\com\baeldung\cdi\extension\FlywayExtension.java | 1 |
请完成以下Java代码 | private static KPIJsonOptions newKpiJsonOptions(final JSONOptions jsonOpts)
{
return KPIJsonOptions.builder()
.adLanguage(jsonOpts.getAdLanguage())
.zoneId(jsonOpts.getZoneId())
.prettyValues(true)
.build();
}
//
//
//
//
//
@ToString
private static class Result
{
public static Result of... | final UserDashboardItemDataResponse oldValue = oldResult.get(itemId);
if (oldValue == null || !newValue.isSameDataAs(oldValue))
{
resultEffective.add(newValue);
}
}
return resultEffective.build();
}
@Nullable
private UserDashboardItemDataResponse get(final UserDashboardItemId itemId)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\dashboard\websocket\UserDashboardWebsocketProducer.java | 1 |
请完成以下Java代码 | public void setC_TaxBase_ID (int C_TaxBase_ID)
{
if (C_TaxBase_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_TaxBase_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_TaxBase_ID, Integer.valueOf(C_TaxBase_ID));
}
/** Get Tax Base.
@return Tax Base */
public int getC_TaxBase_ID ()
{
Integer ii = (Integer)... | }
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Percentage.
@param Percentage
Percent of the entire amount
*/
public void setPercentage (int Percentage)
{
set_V... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_C_TaxBase.java | 1 |
请完成以下Java代码 | public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNam... | public void setPA_Goal_ID (int PA_Goal_ID)
{
if (PA_Goal_ID < 1)
set_Value (COLUMNNAME_PA_Goal_ID, null);
else
set_Value (COLUMNNAME_PA_Goal_ID, Integer.valueOf(PA_Goal_ID));
}
/** Get Goal.
@return Performance Goal
*/
public int getPA_Goal_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_PA... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_GoalRestriction.java | 1 |
请完成以下Java代码 | public int getPA_ReportSource_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_PA_ReportSource_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set User Element 1.
@param UserElement1_ID
User defined accounting Element
*/
public void setUserElement1_ID (int UserElement1_ID)
{
if (... | @param UserElement2_ID
User defined accounting Element
*/
public void setUserElement2_ID (int UserElement2_ID)
{
if (UserElement2_ID < 1)
set_Value (COLUMNNAME_UserElement2_ID, null);
else
set_Value (COLUMNNAME_UserElement2_ID, Integer.valueOf(UserElement2_ID));
}
/** Get User Element 2.
@retur... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_ReportSource.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ProjectAndLineId
{
public static ProjectAndLineId ofRepoId(final int projectRepoId, final int projectLineRepoId)
{
final ProjectId projectId = ProjectId.ofRepoId(projectRepoId);
return new ProjectAndLineId(projectId, projectLineRepoId);
}
public static ProjectAndLineId ofRepoId(@NonNull final Proj... | {
Check.assumeGreaterThanZero(projectLineRepoId, "C_ProjectLine_ID");
this.projectId = projectId;
this.projectLineRepoId = projectLineRepoId;
}
public int getRepoId()
{
return getProjectLineRepoId();
}
public static int toRepoId(@Nullable final ProjectAndLineId id)
{
return id != null ? id.getRepoId(... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\project\ProjectAndLineId.java | 2 |
请完成以下Java代码 | protected void prepare()
{
campaignId = getRecord_ID();
}
@Override
protected String doIt() throws Exception
{
final Set<Integer> campaignContactPersonIds = contactPersonRepo.getIdsByCampaignId(campaignId);
if (campaignContactPersonIds.isEmpty())
{
return MSG_Error + ": 0 records enqueued";
}
fin... | .setName("Create Letters for Campaign " + campaignId)
.buildAndEnqueue();
}
private void enqueue(
@NonNull final AsyncBatchId asyncbatchId,
@Nullable final Integer campaignContactPersonId)
{
if (campaignContactPersonId == null || campaignContactPersonId <= 0)
{
// should not happen
return;
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.marketing\serialletter\src\main\java\de\metas\letter\process\C_Letter_CreateFrom_MKTG_ContactPerson.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.