instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public de.metas.printing.model.I_AD_PrinterHW getAD_PrinterHW()
{
return get_ValueAsPO(COLUMNNAME_AD_PrinterHW_ID, de.metas.printing.model.I_AD_PrinterHW.class);
}
@Override
public void setAD_PrinterHW(de.metas.printing.model.I_AD_PrinterHW AD_PrinterHW)
{
set_ValueFromPO(COLUMNNAME_AD_PrinterHW_ID, de.metas.... | public int getAD_PrinterHW_MediaSize_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_PrinterHW_MediaSize_ID);
}
@Override
public void setName (java.lang.String Name)
{
set_ValueNoCheck (COLUMNNAME_Name, Name);
}
@Override
public java.lang.String getName()
{
return (java.lang.String)get_Value(COLUMNNAME_Na... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java-gen\de\metas\printing\model\X_AD_PrinterHW_MediaSize.java | 1 |
请完成以下Java代码 | public boolean matches(@NonNull final AttributesKeyPart part)
{
if (type == AttributeKeyPartPatternType.All)
{
return true;
}
else if (type == AttributeKeyPartPatternType.Other)
{
throw new AdempiereException("Invalid pattern " + this);
}
else if (type == AttributeKeyPartPatternType.None)
{
re... | return type == AttributeKeyPartPatternType.AttributeId;
}
AttributesKeyPart toAttributeKeyPart(@Nullable final AttributesKey context)
{
if (type == AttributeKeyPartPatternType.All)
{
return AttributesKeyPart.ALL;
}
else if (type == AttributeKeyPartPatternType.Other)
{
return AttributesKeyPart.OTHER;... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\adempiere\mm\attributes\keys\AttributesKeyPartPattern.java | 1 |
请完成以下Java代码 | public boolean isOne()
{
return (fromToMultiplier == null || fromToMultiplier.compareTo(BigDecimal.ONE) == 0)
&& (toFromMultiplier == null || toFromMultiplier.compareTo(BigDecimal.ONE) == 0);
}
public BigDecimal getFromToMultiplier()
{
if (fromToMultiplier != null)
{
return fromToMultiplier;
}
els... | }
return NumberUtils.stripTrailingDecimalZeros(BigDecimal.ONE.divide(multiplier, 12, RoundingMode.HALF_UP));
}
public BigDecimal convert(@NonNull final BigDecimal qty, @NonNull final UOMPrecision precision)
{
if (qty.signum() == 0)
{
return qty;
}
if (fromToMultiplier != null)
{
return precision.... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\uom\UOMConversionRate.java | 1 |
请在Spring Boot框架中完成以下Java代码 | InfoContributor buildInfoContributor(BuildProperties buildProperties) {
return new BuildInfoContributor(buildProperties);
}
@Bean
@ConditionalOnEnabledInfoContributor(value = "java", fallback = InfoContributorFallback.DISABLE)
@Order(DEFAULT_ORDER)
JavaInfoContributor javaInfoContributor() {
return new JavaIn... | @Bean
@ConditionalOnEnabledInfoContributor(value = "ssl", fallback = InfoContributorFallback.DISABLE)
@Order(DEFAULT_ORDER)
SslInfoContributor sslInfoContributor(SslInfo sslInfo) {
return new SslInfoContributor(sslInfo);
}
@Bean
@ConditionalOnMissingBean
@ConditionalOnEnabledInfoContributor(value = "ssl", fal... | repos\spring-boot-4.0.1\module\spring-boot-actuator-autoconfigure\src\main\java\org\springframework\boot\actuate\autoconfigure\info\InfoContributorAutoConfiguration.java | 2 |
请完成以下Java代码 | public int getPP_Order_BOMLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_PP_Order_BOMLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public org.eevolution.model.I_PP_Order getPP_Order() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_PP_Order_ID, org.eevolutio... | public int getPP_Order_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_PP_Order_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Menge.
@param Qty
Menge
*/
@Override
public void setQty (java.math.BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
/** Get Menge.
@retur... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_MRP_Alternative.java | 1 |
请完成以下Java代码 | public class ErrorResponse {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss")
private Date timestamp;
@JsonProperty(value = "code")
private int code;
@JsonProperty(value = "status")
private String status;
@JsonProperty(value = "message")
private String mes... | }
public Date getTimestamp() {
return timestamp;
}
public int getCode() {
return code;
}
public String getStatus() {
return status;
}
public String getMessage() {
return message;
}
public String getDetails() {
return details;
}
} | repos\tutorials-master\spring-cloud-modules\spring-cloud-openfeign-2\src\main\java\com\baeldung\cloud\openfeign\customizederrorhandling\exception\ErrorResponse.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public final class FeaturePolicyConfig {
private FeaturePolicyHeaderWriter writer;
private FeaturePolicyConfig() {
}
/**
* Allows completing configuration of Feature Policy and continuing configuration
* of headers.
* @return the {@link HeadersConfigurer} for additional configuration
*/
public ... | }
/**
* Sets the policy to be used in the {@code Cross-Origin-Embedder-Policy} header
* @param embedderPolicy a {@code Cross-Origin-Embedder-Policy}
* @return the {@link CrossOriginEmbedderPolicyConfig} for additional
* configuration
* @throws IllegalArgumentException if embedderPolicy is null
*/
... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\HeadersConfigurer.java | 2 |
请完成以下Java代码 | protected String getDeploymentId(CommandContext commandContext) {
return null;
}
protected abstract void checkAuthorization(CommandContext commandContext);
protected abstract void checkParameters(CommandContext commandContext);
protected abstract void updateSuspensionState(CommandContext commandContext, ... | definition = commandContext.getProcessDefinitionManager().findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);
} else {
// randomly use a latest process definition's deployment id from one of the tenants
List<ProcessDefinitionEntity> definitions = commandContext.getProcessDefinit... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\AbstractSetStateCmd.java | 1 |
请在Spring Boot框架中完成以下Java代码 | LogFileWebEndpoint logFileWebEndpoint(ObjectProvider<LogFile> logFile, LogFileWebEndpointProperties properties) {
return new LogFileWebEndpoint(logFile.getIfAvailable(), properties.getExternalFile());
}
private static final class LogFileCondition extends SpringBootCondition {
@Override
public ConditionOutcome... | return ConditionOutcome.match(message.found(LogFile.FILE_PATH_PROPERTY).items(config));
}
config = environment.getProperty("management.endpoint.logfile.external-file");
if (StringUtils.hasText(config)) {
return ConditionOutcome.match(message.found("management.endpoint.logfile.external-file").items(config))... | repos\spring-boot-4.0.1\module\spring-boot-actuator-autoconfigure\src\main\java\org\springframework\boot\actuate\autoconfigure\logging\LogFileWebEndpointAutoConfiguration.java | 2 |
请完成以下Java代码 | public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((author == null) ? 0 : author.hashCode());
long temp;
temp = Double.doubleToLongBits(cost);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + (... | return false;
if (Double.doubleToLongBits(cost) != Double.doubleToLongBits(other.cost))
return false;
if (isbn == null) {
if (other.isbn != null)
return false;
} else if (!isbn.equals(other.isbn))
return false;
if (publisher == null) {
... | repos\tutorials-master\persistence-modules\java-mongodb\src\main\java\com\baeldung\bsontojson\Book.java | 1 |
请完成以下Java代码 | public BigDecimal getCompleteOrderDiscount()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_CompleteOrderDiscount);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setM_Product_ID (final int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
e... | return get_ValueAsInt(COLUMNNAME_SeqNo);
}
/**
* Type AD_Reference_ID=540836
* Reference name: C_CompensationGroup_SchemaLine_Type
*/
public static final int TYPE_AD_Reference_ID=540836;
/** Revenue = R */
public static final String TYPE_Revenue = "R";
/** Flatrate = F */
public static final String TYPE_... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\order\model\X_C_CompensationGroup_SchemaLine.java | 1 |
请完成以下Java代码 | public IQueryFilter<I_M_ShipmentSchedule> getShipmentSchedulesQueryFiltersEffective()
{
final CompositeQueryFilter<I_M_ShipmentSchedule> result = CompositeQueryFilter.newInstance(I_M_ShipmentSchedule.class);
if (this.scheduleIds != null && !this.scheduleIds.isEmpty())
{
result.addOnlyActiveRecordsFilter();
... | return result;
}
public Set<PickingJobScheduleId> getPickingJobScheduleIds()
{
if (scheduleIds == null || scheduleIds.isEmpty()) {return ImmutableSet.of();}
return scheduleIds.getJobScheduleIds();
}
public Set<PickingJobScheduleId> getPickingJobScheduleIds(@NonNull final ShipmentScheduleId shipmentSchedul... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\shipmentschedule\api\ShipmentScheduleWorkPackageParameters.java | 1 |
请完成以下Java代码 | public String getParameterAsString(final String parameterName)
{
return params.getParameterAsString(parameterName);
}
@Override
public int getParameterAsInt(final String parameterName, final int defaultValue)
{
return params.getParameterAsInt(parameterName, defaultValue);
}
@Override
public <T extends Rep... | }
@Override
public ZonedDateTime getParameterAsZonedDateTime(final String parameterName)
{
return params.getParameterAsZonedDateTime(parameterName);
}
@Nullable
@Override
public Instant getParameterAsInstant(final String parameterName)
{
return params.getParameterAsInstant(parameterName);
}
@Override
... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\api\ForwardingParams.java | 1 |
请完成以下Java代码 | public ELContext buildWithCustomFunctions(List<CustomFunctionProvider> customFunctionProviders) {
CompositeELResolver elResolver = createCompositeResolver();
ActivitiElContext elContext = new ActivitiElContext(elResolver);
try {
addDateFunctions(elContext);
addListFunctio... | return elContext;
}
private void addResolvers(CompositeELResolver compositeResolver) {
Stream.ofNullable(resolvers).flatMap(Collection::stream).forEach(compositeResolver::add);
}
private CompositeELResolver createCompositeResolver() {
CompositeELResolver elResolver = new CompositeELRes... | repos\Activiti-develop\activiti-core-common\activiti-expression-language\src\main\java\org\activiti\core\el\ELContextBuilder.java | 1 |
请完成以下Java代码 | public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<DmnExpressionImpl> getConditions() {
return conditions;
}
public void setConditions... | public void setConclusions(List<DmnExpressionImpl> conclusions) {
this.conclusions = conclusions;
}
@Override
public String toString() {
return "DmnDecisionTableRuleImpl{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", conditions=" + conditions +
", conclusions=" + conclusio... | repos\camunda-bpm-platform-master\engine-dmn\engine\src\main\java\org\camunda\bpm\dmn\engine\impl\DmnDecisionTableRuleImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void postProcessEngineBuild(final ProcessEngine processEngine) {
requireNonNull(adminUser);
final IdentityService identityService = processEngine.getIdentityService();
final AuthorizationService authorizationService = processEngine.getAuthorizationService();
if (userAlreadyExists(identityServic... | }
identityService.createMembership(adminUser.getId(), CAMUNDA_ADMIN);
LOG.creatingInitialAdminUser(adminUser);
}
static boolean userAlreadyExists(IdentityService identityService, User adminUser) {
final User existingUser = identityService.createUserQuery()
.userId(adminUser.getId())
.singl... | repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\configuration\impl\custom\CreateAdminUserConfiguration.java | 2 |
请完成以下Java代码 | public void save(final Properties ctx, final int windowNo, final IInfoWindowGridRowBuilders builders)
{
for (final Map.Entry<Integer, BigDecimal> e : record2qty.entrySet())
{
final Integer recordKey = e.getKey();
if (recordKey == null)
{
continue;
}
final BigDecimal qty = e.getValue();
if (q... | return null;
}
@Override
public Object getParameterValue(final int index, final boolean returnValueTo)
{
return null;
}
@Override
public String[] getWhereClauses(final List<Object> params)
{
if (!checkbox.isEnabled() || !checkbox.isSelected())
{
return null;
}
if (record2productId.isEmpty())
{... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\adempiere\gui\search\InfoProductQtyController.java | 1 |
请完成以下Java代码 | public static void setUp() {
databaseName = "baeldung";
testCollectionName = "vehicle";
if (mongoClient == null) {
mongoClient = new MongoClient("localhost", 27017);
database = mongoClient.getDatabase(databaseName);
collection = database.getCollection(testCol... | System.out.println("updateReplaceResult:- " + updateReplaceResult);
}
public static void main(String args[]) {
//
// Connect to cluster (default is localhost:27017)
//
setUp();
//
// Update with upsert operation
//
updateOperations();
... | repos\tutorials-master\persistence-modules\java-mongodb-2\src\main\java\com\baeldung\mongo\update\UpsertOperations.java | 1 |
请完成以下Java代码 | public BoundaryEvent newInstance(ModelTypeInstanceContext instanceContext) {
return new BoundaryEventImpl(instanceContext);
}
});
cancelActivityAttribute = typeBuilder.booleanAttribute(BPMN_ATTRIBUTE_CANCEL_ACTIVITY)
.defaultValue(true)
.build();
attachedToRefAttribute = ty... | @Override
public BoundaryEventBuilder builder() {
return new BoundaryEventBuilder((BpmnModelInstance) modelInstance, this);
}
public boolean cancelActivity() {
return cancelActivityAttribute.getValue(this);
}
public void setCancelActivity(boolean cancelActivity) {
cancelActivityAttribute.setValu... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\BoundaryEventImpl.java | 1 |
请完成以下Java代码 | public <T> T unwrap(Class<T> cls) {
return delegate.unwrap(cls);
}
public Object getDelegate() {
return delegate.getDelegate();
}
public void close() {
log.info("[I229] close");
delegate.close();
}
public boolean isOpen()... | return delegate.createEntityGraph(graphName);
}
public EntityGraph<?> getEntityGraph(String graphName) {
return delegate.getEntityGraph(graphName);
}
public <T> List<EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass) {
return delegate.getEntityGraphs(... | repos\tutorials-master\apache-olingo\src\main\java\com\baeldung\examples\olingo2\CarsODataJPAServiceFactory.java | 1 |
请完成以下Java代码 | private Map<AsyncBatchId, List<CreateShipmentInfoCandidate>> getShipmentInfoCandidateByAsyncBatchId(@NonNull final List<JsonCreateShipmentInfo> createShipmentInfos)
{
final List<CreateShipmentInfoCandidate> createShipmentCandidates = createShipmentInfos.stream()
.map(this::buildCreateShipmentCandidate)
.coll... | private ShippingInfoCache newShippingInfoCache()
{
return ShippingInfoCache.builder()
.shipmentScheduleBL(shipmentScheduleBL)
.scheduleEffectiveBL(scheduleEffectiveBL)
.shipperDAO(shipperDAO)
.productDAO(productDAO)
.build();
}
@Value
@Builder
private static class CreateShipmentInfoCandidate... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\shipping\JsonShipmentService.java | 1 |
请完成以下Java代码 | public void setTtlNetNtryAmt(BigDecimal value) {
this.ttlNetNtryAmt = value;
}
/**
* Gets the value of the cdtDbtInd property.
*
* @return
* possible object is
* {@link CreditDebitCode }
*
*/
public CreditDebitCode getCdtDbtInd() {
return cdt... | public BankTransactionCodeStructure4 getBkTxCd() {
return bkTxCd;
}
/**
* Sets the value of the bkTxCd property.
*
* @param value
* allowed object is
* {@link BankTransactionCodeStructure4 }
*
*/
public void setBkTxCd(BankTransactionCodeStructure4 va... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\TotalsPerBankTransactionCode2.java | 1 |
请完成以下Java代码 | public void setHeader(final String header)
{
this.header = header;
}
private void setHeader(final String adLanguage, final String headerTrl)
{
Check.assumeNotEmpty(adLanguage, "adLanguage is not empty");
if (headerTrl == null)
{
return;
}
if (headerTrls == null)
{
headerTrls = new HashMap<>()... | if (ColumnSQL != null && !ColumnSQL.isEmpty())
{
if (withAS)
{
return ColumnSQL + " AS " + ColumnName;
}
else
{
return ColumnSQL;
}
}
return ColumnName;
} // getColumnSQL
public ColumnSql getColumnSql(@NonNull final String ctxTableName)
{
return ColumnSql.ofSql(getColumnSQL(fals... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\GridFieldVO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void deleteCorrespondingFailedRecordIfExists(@NonNull final ExternalId externalId)
{
failedTimeBookingRepository.getOptionalByExternalIdAndSystem(externalId.getExternalSystem(), externalId.getId())
.ifPresent(failedTimeBooking -> failedTimeBookingRepository.delete(failedTimeBooking.getFailedTimeBookingId... | throw new AdempiereException("Time bookings cannot be added for already processed issues!")
.appendParametersToMessage()
.setParameter("ImportTimeBookingInfo", importTimeBookingInfo)
.setParameter("Performing user", performingUser.getName())
.setParameter("Note", "This FailedTimeBooking record will ... | repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\timebooking\importer\TimeBookingsImporterService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public boolean isRunning() {
this.lifecycleLock.lock();
try {
return this.running;
}
finally {
this.lifecycleLock.unlock();
}
}
@Override
public void afterSingletonsInstantiated() {
try {
this.topology = getObject().build(this.properties);
this.infrastructureCustomizer.configureTopology(this... | * Called whenever a {@link KafkaStreams} is added or removed.
*
* @since 2.5.3
*
*/
public interface Listener {
/**
* A new {@link KafkaStreams} was created.
* @param id the streams id (factory bean name).
* @param streams the streams;
*/
default void streamsAdded(String id, KafkaStreams strea... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\config\StreamsBuilderFactoryBean.java | 2 |
请完成以下Java代码 | public Message postProcessMessage(Message message) throws AmqpException {
try {
ByteArrayOutputStream zipped = new ByteArrayOutputStream();
OutputStream zipper = getCompressorStream(zipped);
FileCopyUtils.copy(new ByteArrayInputStream(message.getBody()), zipper);
byte[] compressed = zipped.toByteArray();
... | @Override
public int getOrder() {
return this.order;
}
/**
* Set the order.
* @param order the order, default 0.
* @see Ordered
*/
protected void setOrder(int order) {
this.order = order;
}
/**
* Get the stream.
* @param stream The output stream to write the compressed data to.
* @return the c... | repos\spring-amqp-main\spring-amqp\src\main\java\org\springframework\amqp\support\postprocessor\AbstractCompressingPostProcessor.java | 1 |
请完成以下Java代码 | public void setELContext(ELContext context) {
this.context = context;
}
@SuppressWarnings("null") // args[i] can't be null due to earlier checks
public Object invoke(ELContext context, Object... args) throws ELException {
Objects.requireNonNull(context, "context is null");
int for... | context.enterLambdaScope(lambdaArguments);
try {
Object result = expression.getValue(context);
// Make arguments from this expression available to any nested
// expression
if (result instanceof LambdaExpression) {
((LambdaExpression) result).neste... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\javax\el\LambdaExpression.java | 1 |
请完成以下Java代码 | private int endIndexSearch(int[] sortedArray, int target) {
int left = 0;
int right = sortedArray.length - 1;
int result = -1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (sortedArray[mid] == target) {
result = mid;
... | private int startIndexSearch(int[] sortedArray, int target) {
int left = 0;
int right = sortedArray.length - 1;
int result = -1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (sortedArray[mid] == target) {
result = mid;
... | repos\tutorials-master\algorithms-modules\algorithms-searching\src\main\java\com\baeldung\algorithms\binarysearch\BinarySearch.java | 1 |
请完成以下Java代码 | public static void main(String[] args) throws IOException {
// Test readGZipFile method
List<String> fileContents = readGZipFile(filePath);
System.out.println("Contents of GZIP file:");
fileContents.forEach(System.out::println);
// Test findInZipFile method
String search... | }
return lines;
}
public static List<String> findInZipFile(String filePath, String toFind) throws IOException {
try (InputStream inputStream = new FileInputStream(filePath);
GZIPInputStream gzipInputStream = new GZIPInputStream(inputStream);
InputStreamReader inputStr... | repos\tutorials-master\core-java-modules\core-java-io-5\src\main\java\com\baeldung\usinggzipInputstream\Main.java | 1 |
请完成以下Java代码 | public void setMethod (final @Nullable java.lang.String Method)
{
set_Value (COLUMNNAME_Method, Method);
}
@Override
public java.lang.String getMethod()
{
return get_ValueAsString(COLUMNNAME_Method);
}
@Override
public void setPath (final @Nullable java.lang.String Path)
{
set_Value (COLUMNNAME_Path, ... | @Override
public void setStatus (final java.lang.String Status)
{
set_Value (COLUMNNAME_Status, Status);
}
@Override
public java.lang.String getStatus()
{
return get_ValueAsString(COLUMNNAME_Status);
}
@Override
public void setTime (final java.sql.Timestamp Time)
{
set_Value (COLUMNNAME_Time, Time);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_API_Request_Audit.java | 1 |
请完成以下Java代码 | public class ClaimTaskPayload implements Payload {
private String id;
private String taskId;
private String assignee;
public ClaimTaskPayload() {
this.id = UUID.randomUUID().toString();
}
public ClaimTaskPayload(String taskId, String assignee) {
this();
this.taskId = t... | }
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getAssignee() {
return assignee;
}
public void setAssignee(String assignee) {
this.assignee = assignee;
}
} | repos\Activiti-develop\activiti-api\activiti-api-task-model\src\main\java\org\activiti\api\task\model\payloads\ClaimTaskPayload.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public User userDTOToUser(UserDTO userDTO) {
if (userDTO == null) {
return null;
} else {
User user = new User();
user.setId(userDTO.getId());
user.setLogin(userDTO.getLogin());
user.setFirstName(userDTO.getFirstName());
user.setLas... | }).collect(Collectors.toSet());
}
return authorities;
}
public User userFromId(Long id) {
if (id == null) {
return null;
}
User user = new User();
user.setId(id);
return user;
}
} | repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\service\mapper\UserMapper.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getExportFilePrefix()
{
return exportFilePrefix;
}
@Override
public I_AD_User getFrom()
{
return from;
}
/**
* @return <code>null</code>
*/
@Override
public String getMessage()
{
return MESSAGE;
}
/**
* @return the title of the process
*/
@Override | public String getSubject()
{
return subject;
}
/**
* @return the title of the process
*/
@Override
public String getTitle()
{
return title;
}
@Override
public String getTo()
{
return to;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\org\compiere\report\email\service\impl\BPartnerEmailParams.java | 2 |
请完成以下Java代码 | private static String getIndexByCode(String roleCode) {
for (RoleIndexConfigEnum e : RoleIndexConfigEnum.values()) {
if (e.roleCode.equals(roleCode)) {
return e.componentUrl;
}
}
return null;
}
public static String getIndexByRoles(List<String> rol... | return roleCode;
}
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
public String getComponentUrl() {
return componentUrl;
}
public void setComponentUrl(String componentUrl) {
this.componentUrl = componentUrl;
}
} | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\constant\enums\RoleIndexConfigEnum.java | 1 |
请完成以下Java代码 | public List<String> shortcutFieldOrder() {
return Arrays.asList("defaultLocale");
}
@Override
public GatewayFilter apply(Config config) {
return (exchange, chain) -> {
if (exchange.getRequest()
.getHeaders()
.getAcceptLanguage()
.i... | .replaceQueryParams(new LinkedMultiValueMap<String, String>())
.build()
.toUri()))
.build();
logger.info("Removed all query params: {}", modifiedExchange.getRequest()
.getURI());
return chain.filter(modifiedExchange);
... | repos\tutorials-master\spring-cloud-modules\spring-cloud-gateway\src\main\java\com\baeldung\springcloudgateway\customfilters\gatewayapp\filters\factories\ModifyRequestGatewayFilterFactory.java | 1 |
请完成以下Java代码 | public class PdfEditor {
private static final String SOURCE = "src/main/resources/baeldung.pdf";
private static final String DESTINATION = "src/main/resources/baeldung-modified.pdf";
public static void main(String[] args) throws IOException {
PdfReader reader = new PdfReader(SOURCE);
PdfWr... | // 4.5. add a paragraph
Text title = new Text("This is a demo").setFontSize(16);
Text author = new Text("Baeldung tutorials.");
Paragraph p = new Paragraph().setFontSize(8)
.add(title)
.add(" from ")
.add(author);
document.add(p);
// 4.6. add ... | repos\tutorials-master\text-processing-libraries-modules\pdf-2\src\main\java\com\baeldung\pdfedition\PdfEditor.java | 1 |
请完成以下Java代码 | public void setUserDetailsPasswordService(ReactiveUserDetailsPasswordService userDetailsPasswordService) {
Assert.notNull(userDetailsPasswordService, "userDetailsPasswordService cannot be null");
this.userDetailsPasswordService = userDetailsPasswordService;
}
/**
* Sets the strategy which will be used to valid... | this.messages = new MessageSourceAccessor(messageSource);
}
/**
* Sets the {@link ReactiveCompromisedPasswordChecker} to be used before creating a
* successful authentication. Defaults to {@code null}.
* @param compromisedPasswordChecker the {@link CompromisedPasswordChecker} to use
* @since 6.3
*/
public... | repos\spring-security-main\core\src\main\java\org\springframework\security\authentication\AbstractUserDetailsReactiveAuthenticationManager.java | 1 |
请完成以下Java代码 | public class X_T_Query_Selection_ToDelete extends org.compiere.model.PO implements I_T_Query_Selection_ToDelete, org.compiere.model.I_Persistent
{
private static final long serialVersionUID = 1105719445L;
/** Standard Constructor */
public X_T_Query_Selection_ToDelete (Properties ctx, int T_Query_Selection_... | @Override
public void setT_Query_Selection_ToDelete_ID (int T_Query_Selection_ToDelete_ID)
{
if (T_Query_Selection_ToDelete_ID < 1)
set_ValueNoCheck (COLUMNNAME_T_Query_Selection_ToDelete_ID, null);
else
set_ValueNoCheck (COLUMNNAME_T_Query_Selection_ToDelete_ID, Integer.valueOf(T_Query_Selection_ToDelete... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\dao\selection\model\X_T_Query_Selection_ToDelete.java | 1 |
请完成以下Java代码 | public class TestSourceCodeProjectContributor<T extends TypeDeclaration, C extends CompilationUnit<T>, S extends SourceCode<T, C>>
implements ProjectContributor {
private final ProjectDescription description;
private final Supplier<S> sourceFactory;
private final SourceCodeWriter<S> sourceWriter;
private fina... | T testApplicationType = compilationUnit.createTypeDeclaration(testName);
customizeTestApplicationType(testApplicationType);
customizeTestSourceCode(sourceCode);
this.sourceWriter.writeTo(
this.description.getBuildSystem().getTestSource(projectRoot, this.description.getLanguage()),
sourceCode);
}
@Suppr... | repos\initializr-main\initializr-generator-spring\src\main\java\io\spring\initializr\generator\spring\code\TestSourceCodeProjectContributor.java | 1 |
请完成以下Java代码 | public String getX12DE355(@NonNull final UomId uomId)
{
final I_C_UOM uom = uomsRepo.getById(uomId);
return uom.getX12DE355();
}
public List<I_C_BPartner_Product> getBPartnerProductRecords(final Set<ProductId> productIds)
{
return partnerProductsRepo.retrieveForProductIds(productIds);
}
public List<I_M_HU... | {
return queryBL.createQueryBuilder(I_C_BPartner.class)
.addInArrayFilter(I_C_BPartner.COLUMN_C_BPartner_ID, manufacturerIds)
.create()
.list();
}
@NonNull
public JsonCreatedUpdatedInfo extractCreatedUpdatedInfo(@NonNull final I_M_Product_Category record)
{
final ZoneId orgZoneId = orgDAO.getTimeZo... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\product\ProductsServicesFacade.java | 1 |
请完成以下Java代码 | public int getC_PaymentTerm_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_PaymentTerm_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Rechnungsdatum.
@param DateInvoiced
Datum auf der Rechnung
*/
@Override
public void setDateInvoiced (java.sql.Timestamp DateInvoiced)
{
... | */
@Override
public void setGrandTotal (java.math.BigDecimal GrandTotal)
{
set_Value (COLUMNNAME_GrandTotal, GrandTotal);
}
/** Get Summe Gesamt.
@return Summe über Alles zu diesem Beleg
*/
@Override
public java.math.BigDecimal getGrandTotal ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Grand... | repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java-gen\de\metas\dunning\model\X_C_Dunning_Candidate_Invoice_v1.java | 1 |
请完成以下Java代码 | public void run() {
System.out.println(Thread.currentThread().getName() + "初始化任务开始。。。。。。");
try {
sleep(5);
} finally {
countDownLatch.countDown();
}
sleep(5);
System.out.println(Thread.currentThread().getName() + "初... | @Override
public void run() {
try {
System.out.println(Thread.currentThread().getName() + "初始化线程还未完成,业务线程阻塞----------");
countDownLatch.await(1, TimeUnit.MINUTES);
} catch (InterruptedException e) {
e.printStackTrace();
}
... | repos\spring-boot-student-master\spring-boot-student-concurrent\src\main\java\com\xiaolyuh\CountDownLatchTest.java | 1 |
请完成以下Java代码 | private PackageableRow createPackageableRow(final PackageableList packageables)
{
Check.assume(!packageables.isEmpty(), "packageables is not empty");
final BPartnerId customerId = packageables.getSingleCustomerId().get();
final LookupValue customer = Objects.requireNonNull(bpartnerLookup.get().findById(customer... | .orderId(salesOrderId)
.poReference(poReference)
.orderDocumentNo(salesOrderDocumentNo)
.customer(customer)
.warehouseTypeId(warehouseTypeId)
.warehouseTypeName(warehouseTypeName)
.lockedByUser(lockedByUser)
.lines(packageables.size())
.timeZone(timeZone)
.shipper(shipper)
.lineN... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pickingV2\packageable\PackageableRowsRepository.java | 1 |
请完成以下Java代码 | public void setHUAttributesDAO(final IHUAttributesDAO huAttributesDAO)
{
this.huAttributesDAO = huAttributesDAO;
for (final IAttributeStorageFactory factory : factories)
{
factory.setHUAttributesDAO(huAttributesDAO);
}
}
@Override
public IHUStorageDAO getHUStorageDAO()
{
return getHUStorageFactory()... | public void setHUStorageFactory(final IHUStorageFactory huStorageFactory)
{
this.huStorageFactory = huStorageFactory;
for (final IAttributeStorageFactory factory : factories)
{
factory.setHUStorageFactory(huStorageFactory);
}
}
@Override
public void flush()
{
for (final IAttributeStorageFactory fact... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\storage\impl\CompositeAttributeStorageFactory.java | 1 |
请完成以下Java代码 | public void releaseLock() {
executeCommand(new ReleaseLockCmd(lockName, engineType, false));
LOGGER.debug("successfully released lock {}", lockName);
hasAcquiredLock = false;
}
@Override
public void releaseAndDeleteLock() {
executeCommand(new ReleaseLockCmd(lockName, engineT... | return supplier.get();
} finally {
releaseLock();
}
}
protected <T> T executeCommand(Command<T> command) {
return commandExecutor.execute(lockCommandConfig, command);
}
protected Duration getLockPollRate() {
return lockPollRate;
}
} | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\lock\LockManagerImpl.java | 1 |
请完成以下Java代码 | protected boolean executeShortRunning(Runnable runnable) {
try {
workManager.schedule(new CommonjWorkRunnableAdapter(runnable));
return true;
} catch (WorkRejectedException e) {
logger.log(Level.FINE, "Work rejected", e);
} catch (WorkException e) {
logger.log(Lev... | } catch (WorkException e) {
logger.log(Level.WARNING, "Could not schedule Job Acquisition Runnable: "+e.getMessage(), e);
return false;
}
}
public Runnable getExecuteJobsRunnable(List<String> jobIds, ProcessEngineImpl processEngine) {
return new JcaInflowExecuteJobsRunnable(jobIds, pro... | repos\camunda-bpm-platform-master\javaee\jobexecutor-ra\src\main\java\org\camunda\bpm\container\impl\threading\ra\commonj\CommonJWorkManagerExecutorService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DefaultGlobalExceptionHandler extends ResponseEntityExceptionHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultGlobalExceptionHandler.class);
@Override
protected ResponseEntity<Object> handleExceptionInternal(Exception ex, @Nullable Object body, HttpHeaders headers, HttpStat... | httpResult = HttpResult.failure("Parameter verification error or data abnormality!");
} else {
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
is5xxServerError = true;
httpResult = HttpResult.failure(ErrorCode.serverError.getDesc());
}
if (is5xxServerError) {
LOGGER.error("handleException, ex caught, u... | repos\springboot-demo-master\Aviator\src\main\java\com\et\exception\DefaultGlobalExceptionHandler.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void deptRoleUserAdd(String userId, String newRoleId, String oldRoleId) {
List<String> add = getDiff(oldRoleId,newRoleId);
if(add!=null && add.size()>0) {
List<SysDepartRoleUser> list = new ArrayList<>();
for (String roleId : add) {
if(oConvertUtils.isNotEm... | * 从diff中找出main中没有的元素
* @param main
* @param diff
* @return
*/
private List<String> getDiff(String main, String diff){
if(oConvertUtils.isEmpty(diff)) {
return null;
}
if(oConvertUtils.isEmpty(main)) {
return Arrays.asList(diff.split(","));
... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\service\impl\SysDepartRoleUserServiceImpl.java | 2 |
请完成以下Java代码 | public class CorrelationUtil {
public static String getCorrelationKey(String elementName, CommandContext commandContext, ExecutionEntity executionEntity) {
return getCorrelationKey(elementName, commandContext, executionEntity.getCurrentFlowElement(), executionEntity);
}
public static String ge... | if (executionEntity != null) {
Object value = expressionManager.createExpression(valueExpression).getValue(executionEntity);
correlationParameters.put(name, value);
} else {
correlationParameters.put(name, valueE... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\util\CorrelationUtil.java | 1 |
请完成以下Java代码 | public static String insertSeparatorEveryNCharacters(
@NonNull final String string,
@NonNull final String groupSeparator,
final int groupSize)
{
if (groupSize < 1)
{
return string;
}
final StringBuilder result = new StringBuilder(string);
int insertPosition = groupSize;
while (insertPosition <... | }
return params;
}
@Nullable
public static String ucFirst(@Nullable final String str)
{
if (str == null || str.isEmpty())
{
return str;
}
final char first = str.charAt(0);
if (!Character.isLetter(first))
{
return str;
}
final char capital = Character.toUpperCase(first);
if(first == cap... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\StringUtils.java | 1 |
请完成以下Java代码 | public void setA_Finance_Meth (String A_Finance_Meth)
{
set_Value (COLUMNNAME_A_Finance_Meth, A_Finance_Meth);
}
/** Get Finance Method.
@return Finance Method */
public String getA_Finance_Meth ()
{
return (String)get_Value(COLUMNNAME_A_Finance_Meth);
}
/** Set Investment Credit.
@param A_Investme... | }
/** Set Tax Entity.
@param A_Tax_Entity Tax Entity */
public void setA_Tax_Entity (String A_Tax_Entity)
{
set_Value (COLUMNNAME_A_Tax_Entity, A_Tax_Entity);
}
/** Get Tax Entity.
@return Tax Entity */
public String getA_Tax_Entity ()
{
return (String)get_Value(COLUMNNAME_A_Tax_Entity);
}
/** ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Info_Tax.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class HUWithExpiryDatesRepository
{
private final IQueryBL queryBL = Services.get(IQueryBL.class);
private final IHandlingUnitsDAO handlingUnitsDAO = Services.get(IHandlingUnitsDAO.class);
private final IHUStatusBL huStatusBL = Services.get(IHUStatusBL.class);
public Stream<HUWithExpiryDates> streamByWarnDa... | @Nullable final LocalDate expiryWarnDate)
{
final Timestamp timestamp = TimeUtil.asTimestamp(expiryWarnDate);
final I_M_HU_BestBefore_V recordOrdNull = queryBL.createQueryBuilder(I_M_HU_BestBefore_V.class)
.addCompareFilter(I_M_HU_BestBefore_V.COLUMN_HU_ExpiredWarnDate, Operator.LESS_OR_EQUAL, timestamp, Date... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\expiry\HUWithExpiryDatesRepository.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public DistributionJob complete(@NonNull final DistributionJob job)
{
// just to make sure there is nothing reserved to this job
distributionJobHUReservationService.releaseAllReservations(job);
final DDOrderId ddOrderId = job.getDdOrderId();
ddOrderService.close(ddOrderId);
ddOrderService.print(ddOrderId);
... | final HUQRCode huQRCode = huService.resolveHUQRCode(request.getHuQRCode());
final ProductId productId;
if (request.getProductScannedCode() != null)
{
productId = productService.getProductIdByScannedProductCode(request.getProductScannedCode());
huService.assetHUContainsProduct(huQRCode, productId);
}
el... | repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\job\service\DistributionRestService.java | 2 |
请完成以下Java代码 | public Map<String, Object> setSession (HttpServletRequest request){
Map<String, Object> map = new HashMap<>();
request.getSession().setAttribute("message", request.getRequestURL());
map.put("request Url", request.getRequestURL());
return map;
}
@RequestMapping(value = "/getSessi... | if (user==null){
msg="please login first!";
}
return msg;
}
@RequestMapping(value = "/login")
public String login (HttpServletRequest request,String userName,String password){
String msg="logon failure!";
User user= userRepository.findByUserName(userName);
... | repos\spring-boot-leaning-master\1.x\第10课:Redis实现数据缓存和Session共享\spring-boot-redis-session\src\main\java\com\neo\web\UserController.java | 1 |
请完成以下Java代码 | public class Backtracking implements RestoreIPAddress {
public List<String> restoreIPAddresses(String s) {
List<String> result = new ArrayList<>();
backtrack(result, s, new ArrayList<>(), 0);
return result;
}
private void backtrack(List<String> result, String s, List<String> current... | String part = s.substring(index, index + len);
if (isValid(part)) {
current.add(part);
backtrack(result, s, current, index + len);
current.remove(current.size() - 1);
}
}
}
private boolean isValid(String part) {
if (part.le... | repos\tutorials-master\core-java-modules\core-java-arrays-operations-advanced-3\src\main\java\com\baeldung\restoreipaddress\Backtracking.java | 1 |
请完成以下Java代码 | public class PersonDto {
private Long id;
private String name;
private String role;
public PersonDto(Long id, String name) {
this.id = id;
this.name = name;
}
public PersonDto(Long id, String name, String role) {
this(id, name);
this.role = role;
}
pub... | public void setRole(String role) {
this.role = role;
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
i... | repos\tutorials-master\persistence-modules\hibernate-jpa-3\src\main\java\com\baeldung\hibernate\union\dto\PersonDto.java | 1 |
请完成以下Java代码 | public void setSummary (java.lang.String Summary)
{
set_Value (COLUMNNAME_Summary, Summary);
}
/** Get Zusammenfassung.
@return Textual summary of this request
*/
@Override
public java.lang.String getSummary ()
{
return (java.lang.String)get_Value(COLUMNNAME_Summary);
}
/** Set Mitteilung.
@param ... | @Override
public void setTextMsg (java.lang.String TextMsg)
{
set_Value (COLUMNNAME_TextMsg, TextMsg);
}
/** Get Mitteilung.
@return Text Message
*/
@Override
public java.lang.String getTextMsg ()
{
return (java.lang.String)get_Value(COLUMNNAME_TextMsg);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_SchedulerLog.java | 1 |
请完成以下Java代码 | public void validateBTM(final I_C_BPartner partner)
{
final IMsgBL msgBL = Services.get(IMsgBL.class);
final String btm = partner.getBTM();
final boolean hasNarcoticPermission = partner.isPharmaCustomerNarcoticsPermission() || partner.isPharmaVendorNarcoticsPermission();
if (Check.isEmpty(btm))
{
if (ha... | // If the partner doesn't have permissions, BTM is not relevant.
return;
}
final boolean isValidBTM = PharmaModulo11Validator.isValid(btm);
if (!isValidBTM)
{
final ITranslatableString invalidBTMMessage = msgBL.getTranslatableMsgText(ERR_InvalidBTM, btm);
throw new AdempiereException(invalidBTMMess... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma\src\main\java\de\metas\vertical\pharma\model\interceptor\C_BPartner.java | 1 |
请完成以下Java代码 | private @Nullable Authentication authentication(Map<String, Object> metadata) {
byte[] authenticationMetadata = (byte[]) metadata.get("authentication");
if (authenticationMetadata == null) {
return null;
}
ByteBuf rawAuthentication = ByteBufAllocator.DEFAULT.buffer();
try {
rawAuthentication.writeBytes(... | String username = rawUsername.toString(StandardCharsets.UTF_8);
ByteBuf rawPassword = AuthMetadataCodec.readPassword(rawAuthentication);
String password = rawPassword.toString(StandardCharsets.UTF_8);
return UsernamePasswordAuthenticationToken.unauthenticated(username, password);
}
private Authentication beare... | repos\spring-security-main\rsocket\src\main\java\org\springframework\security\rsocket\authentication\AuthenticationPayloadExchangeConverter.java | 1 |
请完成以下Java代码 | public boolean isAuthorizationEnabled() {
return wrappedConfiguration.isAuthorizationEnabled();
}
@Override
public String getAuthorizationCheckRevokes() {
return wrappedConfiguration.getAuthorizationCheckRevokes();
}
@Override
protected InputStream getMyBatisXmlConfigurationSteam() {
String st... | String mappingsFileTemplate = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"\n" +
"<!DOCTYPE configuration PUBLIC \"-//mybatis.org//DTD Config 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-config.dtd\">\n" +
"\n" +
"<configuration>\n" +
" <settings>\n" +
" <setting na... | repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\webapp\impl\db\QuerySessionFactory.java | 1 |
请完成以下Java代码 | public class ValidFromToMatchesQueryFilter<T> implements IQueryFilter<T>, ISqlQueryFilter
{
private final String validFromColumnName;
private final String validToColumnName;
private final Date dateValue;
private boolean sqlBuilt;
private String sqlWhereClause = null;
private List<Object> sqlParams = null;
publ... | this.sqlParams = sqlParams.build();
this.sqlBuilt = true;
}
@Override
public boolean accept(final T model)
{
final Date validFrom = getDate(model, validFromColumnName);
if (validFrom != null && validFrom.compareTo(dateValue) > 0)
{
return false;
}
final Date validTo = getDate(model, validToColumnNa... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\ValidFromToMatchesQueryFilter.java | 1 |
请完成以下Java代码 | public void setUserMember(String userId) {
this.userId = userId;
}
@CamundaQueryParam("groupMember")
public void setGroupMember(String groupId) {
this.groupId = groupId;
}
@CamundaQueryParam(value = "includingGroupsOfUser", converter = BooleanConverter.class)
public void setIncludingGroupsOfUser(B... | if (nameLike != null) {
query.tenantNameLike(nameLike);
}
if (userId != null) {
query.userMember(userId);
}
if (groupId != null) {
query.groupMember(groupId);
}
if (Boolean.TRUE.equals(includingGroupsOfUser)) {
query.includingGroupsOfUser(true);
}
}
@Override
p... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\identity\TenantQueryDto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public GetBearerRequest toGetBearerRequest()
{
return GetBearerRequest.builder()
.grantType("client_credentials")
.clientId(clientId)
.clientSecret(clientSecret)
.build();
}
public void updateBearer(@NonNull final String bearer, @NonNull final Instant validUntil)
{
this.bearer = beare... | {
return bearer == null || Instant.now().isAfter(validUntil);
}
@NonNull
public String getBearerNotNull()
{
if (bearer == null)
{
throw new RuntimeException("AuthToken.bearer is null!");
}
return bearer;
}
}
} | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-shopware6\src\main\java\de\metas\camel\externalsystems\shopware6\api\ShopwareClient.java | 2 |
请在Spring Boot框架中完成以下Java代码 | class KafkaStreamsConfig {
@Value("${kafka.topics.iot}")
private String iotTopicName;
@Bean
public Serde<IotSensorData> iotSerde() {
return Serdes.serdeFrom(new JsonSerializer<>(), new JsonDeserializer<>(IotSensorData.class));
}
@Bean
public KStream<String, IotSensorData> iotStream... | public KStream<String, IotSensorData> iotBrancher(StreamsBuilder streamsBuilder) {
KStream<String, IotSensorData> stream = streamsBuilder.stream(iotTopicName, Consumed.with(Serdes.String(), iotSerde()));
new KafkaStreamBrancher<String, IotSensorData>()
.branch((key, value) -> "temp".equ... | repos\tutorials-master\spring-kafka-2\src\main\java\com\baeldung\spring\kafka\kafkasplitting\KafkaStreamsConfig.java | 2 |
请完成以下Java代码 | public String toString()
{
return MoreObjects.toStringHelper(this)
.add("rfqResponsesProducerFactory", rfqResponsesProducerFactory)
.add("rfqResponsePublisher", rfqResponsePublisher)
.toString();
}
@Override
public IRfQResponseProducer newRfQResponsesProducerFor(final I_C_RfQ rfq)
{
Check.assumeNo... | // TODO: implement custom providers
return new DefaultRfQResponseRankingStrategy();
}
@Override
public IRfQResponsePublisher getRfQResponsePublisher()
{
return rfqResponsePublisher;
}
@Override
public IRfQConfiguration addRfQResponsePublisher(final IRfQResponsePublisher publisher)
{
rfqResponsePublisher... | repos\metasfresh-new_dawn_uat\backend\de.metas.rfq\src\main\java\de\metas\rfq\impl\RfQConfiguration.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public I_C_InvoiceLine createInvoiceLine(final String trxName)
{
return InterfaceWrapperHelper.create(Env.getCtx(), I_C_InvoiceLine.class, trxName);
}
@Override
public List<I_C_LandedCost> retrieveLandedCosts(
final I_C_InvoiceLine invoiceLine, final String whereClause,
final String trxName)
{
final Lis... | finally
{
DB.close(rs, pstmt);
}
return list;
} // getLandedCost
@Override
public I_C_LandedCost createLandedCost(String trxName)
{
return new MLandedCost(Env.getCtx(), 0, trxName);
}
@Override
public List<I_C_InvoiceTax> retrieveTaxes(org.compiere.model.I_C_Invoice invoice)
{
final MInvoice inv... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\service\impl\InvoiceDAO.java | 2 |
请完成以下Java代码 | private I_M_HU_PI_Item_Product extractHUPIItemProductOrNull(@NonNull final IHUPackingAware huPackingAware)
{
final HUPIItemProductId piItemProductId = HUPIItemProductId.ofRepoIdOrNull(huPackingAware.getM_HU_PI_Item_Product_ID());
return piItemProductId != null
? piPIItemProductBL.getRecordById(piItemProductId)... | if (qtyTUs == null)
{
return;
}
final BigDecimal capacity = calculateLUCapacity(record);
if (capacity == null)
{
return;
}
final BigDecimal qtyLUs = qtyTUs.divide(capacity, RoundingMode.UP);
record.setQtyLU(qtyLUs);
}
@Override
public void validateLUQty(final BigDecimal luQty)
{
final int ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\adempiere\gui\search\impl\HUPackingAwareBL.java | 1 |
请完成以下Java代码 | public Criteria andProductCategoryIdNotIn(List<Long> values) {
addCriterion("product_category_id not in", values, "productCategoryId");
return (Criteria) this;
}
public Criteria andProductCategoryIdBetween(Long value1, Long value2) {
addCriterion("product_category_id... | this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\UmsMemberProductCategoryRelationExample.java | 1 |
请完成以下Java代码 | public final class OrderId
{
@JsonProperty("gatewayId") @NonNull private final ShipperGatewayId shipperGatewayId;
@JsonProperty("orderId") @NonNull private final String orderIdAsString;
@JsonIgnore @Nullable private Integer orderIdAsInt = null; // lazy
@JsonCreator
private OrderId(
@JsonProperty("gatewayId") @... | public int getOrderIdAsInt()
{
if (orderIdAsInt == null)
{
try
{
orderIdAsInt = Integer.parseInt(orderIdAsString);
}
catch (final Exception ex)
{
throw new IllegalArgumentException("orderId shall be integer but it was: " + orderIdAsString, ex);
}
}
return orderIdAsInt;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.spi\src\main\java\de\metas\shipper\gateway\spi\model\OrderId.java | 1 |
请完成以下Java代码 | public class EmptyBodyFilter extends AbstractEmptyBodyFilter {
@Override
public HttpServletRequestWrapper wrapRequest(HttpServletRequest req, boolean isBodyEmpty, PushbackInputStream requestBody) {
return new HttpServletRequestWrapper(req) {
@Override
public ServletInputStream getInputStream() thr... | public synchronized void mark(int readlimit) {
inputStream.mark(readlimit);
}
@Override
public synchronized void reset() throws IOException {
inputStream.reset();
}
@Override
public boolean markSupported() {
return inputSt... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\filter\EmptyBodyFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PurchaseRowChangeRequest
{
@Getter(AccessLevel.PRIVATE)
Quantity qtyToPurchase;
@Getter(AccessLevel.PRIVATE)
BigDecimal qtyToPurchaseWithoutUOM;
ZonedDateTime purchaseDatePromised;
@Builder
private PurchaseRowChangeRequest(
final BigDecimal qtyToPurchaseWithoutUOM,
final Quantity qtyToPurcha... | {
final ZonedDateTime datePromised = fieldChangeRequest.getValueAsZonedDateTime();
Check.assumeNotNull(datePromised, "Parameter datePromised is not null for {}", fieldChangeRequest);
builder.purchaseDatePromised(datePromised);
}
else
{
throw new AdempiereException("Field " + fieldName + " is no... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\sales\purchasePlanning\view\PurchaseRowChangeRequest.java | 2 |
请完成以下Java代码 | public boolean isBlacklisted(final int workpackageProcessorId)
{
return blacklist.containsKey(workpackageProcessorId);
}
public void addToBlacklist(final int packageProcessorId, String packageProcessorClassname, Exception e)
{
final ConfigurationException exception = ConfigurationException.wrapIfNeeded(e);
f... | final BlackListItem blacklistItem = blacklist.get(workpackageProcessorId);
if (blacklistItem != null)
{
blacklistItem.incrementHitCount();
throw new ConfigurationException("Already blacklisted: " + blacklistItem, blacklistItem.getException());
}
}
public List<BlackListItem> getItems()
{
return new Arr... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\processor\impl\WorkpackageProcessorBlackList.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void process() {
template.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
// We use MySQL 8 InnoDB.
// The default isolation level for InnoDB is REPEATABLE READ, therefore
// we need to switch to READ_COMMITTED to reveal how Hibernate session-level
... | });
// Direct fetching via findById(), find() and get() doesn't trigger a SELECT
// It loads the author directly from Persistence Context
Author authorA2 = authorRepository.findById(1L).orElseThrow();
System.out.println("\nAuthor A2: " + a... | repos\Hibernate-SpringBoot-master\HibernateSpringBootSessionRepeatableReads\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class C_Workplace
{
private final IPickingSlotBL pickingSlotBL = Services.get(IPickingSlotBL.class);
public C_Workplace()
{
Services.get(IProgramaticCalloutProvider.class).registerAnnotatedCallout(this);
}
@CalloutMethod(columnNames = I_C_Workplace.COLUMNNAME_M_Warehouse_ID)
public void resetPickingSlo... | final PickingSlotId pickingSlotId = PickingSlotId.ofRepoIdOrNull(workplace.getM_PickingSlot_ID());
if (pickingSlotId == null)
{
return;
}
final I_M_PickingSlot pickingSlot = pickingSlotBL.getById(pickingSlotId);
if (pickingSlot.getM_Warehouse_ID() != workplace.getM_Warehouse_ID())
{
throw new Adempi... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\workplace\interceptor\C_Workplace.java | 2 |
请完成以下Java代码 | public void setRemote_Addr (final @Nullable java.lang.String Remote_Addr)
{
set_ValueNoCheck (COLUMNNAME_Remote_Addr, Remote_Addr);
}
@Override
public java.lang.String getRemote_Addr()
{
return get_ValueAsString(COLUMNNAME_Remote_Addr);
}
@Override
public void setRemote_Host (final @Nullable java.lang.St... | public java.lang.String getRemote_Host()
{
return get_ValueAsString(COLUMNNAME_Remote_Host);
}
@Override
public void setWebSession (final @Nullable java.lang.String WebSession)
{
set_ValueNoCheck (COLUMNNAME_WebSession, WebSession);
}
@Override
public java.lang.String getWebSession()
{
return get_Val... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Session.java | 1 |
请完成以下Java代码 | public void createVariable(boolean isAdmin, CreateTaskVariablePayload createTaskVariablePayload) {
if (!isAdmin) {
assertCanModifyTask(getInternalTask(createTaskVariablePayload.getTaskId()));
}
taskVariablesValidator.handleCreateTaskVariablePayload(createTaskVariablePayload);
... | private void assertVariableExists(UpdateTaskVariablePayload updateTaskVariablePayload) {
Map<String, VariableInstance> variables = taskService.getVariableInstancesLocal(
updateTaskVariablePayload.getTaskId()
);
if (variables == null) {
throw new IllegalStateException("Va... | repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-task-runtime-impl\src\main\java\org\activiti\runtime\api\impl\TaskRuntimeHelper.java | 1 |
请完成以下Java代码 | public void setC_AcctSchema_ID (int C_AcctSchema_ID)
{
if (C_AcctSchema_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_AcctSchema_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_AcctSchema_ID, Integer.valueOf(C_AcctSchema_ID));
}
/** Get Accounting Schema.
@return Rules for accounting
*/
public int getC_Ac... | {
set_Value (COLUMNNAME_E_Expense_Acct, Integer.valueOf(E_Expense_Acct));
}
/** Get Employee Expense.
@return Account for Employee Expenses
*/
public int getE_Expense_Acct ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_E_Expense_Acct);
if (ii == null)
return 0;
return ii.intValue();
}
public ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_BP_Employee_Acct.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void publishProductChangedEvent(final ProductId productId)
{
final MSV3ServerConfig serverConfig = getServerConfig();
final PZN pzn = getPZNByProductId(productId);
final int qtyOnHand = getQtyOnHand(serverConfig, productId);
final MSV3StockAvailability item = MSV3StockAvailability.builder()
.pzn(p... | .pzn(pzn)
.bpartnerId(oldBPartnerId.getRepoId())
.delete(true)
.build());
}
eventBuilder.item(MSV3ProductExclude.builder()
.pzn(pzn)
.bpartnerId(newBPartnerId.getRepoId())
.build());
msv3ServerPeerService.publishProductExcludes(eventBuilder.build());
}
public void publishProductExc... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.server-peer-metasfresh\src\main\java\de\metas\vertical\pharma\msv3\server\peer\metasfresh\services\MSV3StockAvailabilityService.java | 2 |
请完成以下Java代码 | public DefaultSyncHttpGraphQlClientBuilder header(String name, String... values) {
this.restClientBuilder.defaultHeader(name, values);
return this;
}
@Override
public DefaultSyncHttpGraphQlClientBuilder headers(Consumer<HttpHeaders> headersConsumer) {
this.restClientBuilder.defaultHeaders(headersConsumer);
... | return new DefaultHttpSyncGraphQlClient(graphQlClient, restClient, getBuilderInitializer());
}
/**
* Default {@link HttpSyncGraphQlClient} implementation.
*/
private static class DefaultHttpSyncGraphQlClient
extends AbstractDelegatingGraphQlClient implements HttpSyncGraphQlClient {
private final RestClie... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\client\DefaultSyncHttpGraphQlClientBuilder.java | 1 |
请完成以下Java代码 | public String getEntityType ()
{
return (String)get_Value(COLUMNNAME_EntityType);
}
/** Set Comment/Help.
@param Help
Comment or Hint
*/
public void setHelp (String Help)
{
set_Value (COLUMNNAME_Help, Help);
}
/** Get Comment/Help.
@return Comment or Hint
*/
public String getHelp ()
{
re... | public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Sequence.
@param SeqNo
Method of ordering records; lowest number comes first
*/
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Sequence.
@r... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_ModelValidator.java | 1 |
请完成以下Java代码 | public class PaymentIdentification1 {
@XmlElement(name = "InstrId")
protected String instrId;
@XmlElement(name = "EndToEndId", required = true)
protected String endToEndId;
/**
* Gets the value of the instrId property.
*
* @return
* possible object is
* {@link Str... | }
/**
* Gets the value of the endToEndId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEndToEndId() {
return endToEndId;
}
/**
* Sets the value of the endToEndId property.
*
* @param value
... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\PaymentIdentification1.java | 1 |
请完成以下Java代码 | public RequestEntity<?> convert(OAuth2UserRequest userRequest) {
ClientRegistration clientRegistration = userRequest.getClientRegistration();
HttpMethod httpMethod = getHttpMethod(clientRegistration);
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON... | request = new RequestEntity<>(headers, httpMethod, uri);
}
return request;
}
private HttpMethod getHttpMethod(ClientRegistration clientRegistration) {
if (AuthenticationMethod.FORM
.equals(clientRegistration.getProviderDetails().getUserInfoEndpoint().getAuthenticationMethod())) {
return HttpMethod.POST;... | repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\userinfo\OAuth2UserRequestEntityConverter.java | 1 |
请完成以下Java代码 | public static JsonRawMaterialsIssueLineStep of(RawMaterialsIssueStep step, JsonOpts jsonOpts)
{
final JsonRawMaterialsIssueLineStepBuilder builder = builder()
.id(String.valueOf(step.getId().getRepoId()))
.isAlternativeIssue(step.isAlternativeIssue())
.productId(String.valueOf(step.getProductId().getRepo... | .negativeTolerance(step.getScaleTolerance().getNegativeTolerance().toBigDecimal())
.positiveTolerance(step.getScaleTolerance().getPositiveTolerance().toBigDecimal())
.build();
builder.scaleTolerance(jsonScaleTolerance);
}
return builder.build();
}
@Value
@Builder
public static class JsonScaleTol... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\workflows_api\activity_handlers\issue\json\JsonRawMaterialsIssueLineStep.java | 1 |
请完成以下Java代码 | public int getM_AttributeSetInstance_ID()
{
return get_ValueAsInt(COLUMNNAME_M_AttributeSetInstance_ID);
}
@Override
public void setM_Product_ID (final int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
else
set_Value (COLUMNNAME_M_Product_ID, M_Product_ID);
}
@... | final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyDeliveredInUOM);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setQtyEntered (final BigDecimal QtyEntered)
{
set_Value (COLUMNNAME_QtyEntered, QtyEntered);
}
@Override
public BigDecimal getQtyEntered()
{
final BigDecimal bd =... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\model\X_C_CallOrderSummary.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void confirmDelivery(String orderId, String expressNo, String userId) {
// 构造受理上下文
OrderProcessContext<String> context = buildContext(orderId, userId, expressNo, ProcessReqEnum.ConfirmDelivery);
// 受理下单请求
processEngine.process(context);
}
@Override
public void confir... | private <T> OrderProcessContext<String> buildContext(String orderId, String userId, T reqData, ProcessReqEnum processReqEnum) {
OrderProcessContext context = new OrderProcessContext();
// 受理请求
OrderProcessReq req = new OrderProcessReq();
req.setProcessReqEnum(processReqEnum);
re... | repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Order\src\main\java\com\gaoxi\order\service\OrderServiceImpl.java | 2 |
请完成以下Java代码 | public static boolean dbTypeIsMySql(DbType dbType) {
return dbTypeIf(dbType, DbType.MYSQL, DbType.MARIADB, DbType.CLICK_HOUSE, DbType.SQLITE);
}
public static boolean dbTypeIsOracle(DbType dbType) {
return dbTypeIf(dbType, DbType.ORACLE, DbType.ORACLE_12C, DbType.DM);
}
/**
* 是否是达... | return DataBaseConstant.DB_TYPE_SQLSERVER;
}else if(dbTypeIsPostgre(dbType)){
return DataBaseConstant.DB_TYPE_POSTGRESQL;
}
return DataBaseConstant.DB_TYPE_MYSQL;
}
/**
* 根据枚举类 获取数据库方言字符串
* @param dbType
* @return
*/
public static String getDbDialect... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\dynamic\db\DbTypeUtils.java | 1 |
请完成以下Java代码 | protected void invokeVariableLifecycleListenersUpdate(CoreVariableInstance variableInstance, AbstractVariableScope sourceScope) {
invokeVariableLifecycleListenersUpdate(variableInstance, sourceScope, getVariableInstanceLifecycleListeners());
}
protected void invokeVariableLifecycleListenersUpdate(CoreVariableI... | @Override
public void removeVariableLocal(String variableName) {
removeVariableLocal(variableName, getSourceActivityVariableScope());
}
protected AbstractVariableScope getSourceActivityVariableScope() {
return this;
}
protected void removeVariableLocal(String variableName, AbstractVariableScope sour... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\core\variable\scope\AbstractVariableScope.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BPartnerQueryService
{
public BPartnerQuery createQuery(@NonNull final OrgAndBPartnerCompositeLookupKeyList queryLookupKeys)
{
return createBPartnerQuery(queryLookupKeys.getCompositeLookupKeys(), queryLookupKeys.getOrgId());
}
public BPartnerQuery createQueryFailIfNotExists(
@NonNull final BPartn... | return query.build();
}
private static void addKeyToQueryBuilder(final BPartnerCompositeLookupKey bpartnerLookupKey, final BPartnerQueryBuilder queryBuilder)
{
final JsonExternalId jsonExternalId = bpartnerLookupKey.getJsonExternalId();
if (jsonExternalId != null)
{
queryBuilder.externalId(JsonConverters.f... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\utils\BPartnerQueryService.java | 2 |
请完成以下Java代码 | public void log(final String message, final Throwable e)
{
if (e == null)
{
log.warn(message);
}
log.error(message, e);
} // log
/**
* Log debug
*
* @param message message
*/
@Override
public void log(String message)
{ | log.debug(message);
} // log
@Override
public String getServletName()
{
return NAME;
}
@Override
public String getServletInfo()
{
return "Server Monitor";
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\serverRoot\de.metas.adempiere.adempiere.serverRoot.base\src\main\java-legacy\org\adempiere\serverRoot\servlet\ServerMonitor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | class VetController {
private final VetRepository vetRepository;
public VetController(VetRepository vetRepository) {
this.vetRepository = vetRepository;
}
@GetMapping("/vets.html")
public String showVetList(@RequestParam(defaultValue = "1") int page, Model model) {
// Here we are returning an object of type... | int pageSize = 5;
Pageable pageable = PageRequest.of(page - 1, pageSize);
return vetRepository.findAll(pageable);
}
@GetMapping({ "/vets" })
public @ResponseBody Vets showResourcesVetList() {
// Here we are returning an object of type 'Vets' rather than a collection of Vet
// objects so it is simpler for JS... | repos\spring-petclinic-main\src\main\java\org\springframework\samples\petclinic\vet\VetController.java | 2 |
请完成以下Java代码 | public int getM_Demand_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Demand_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name... | public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
}
/** Get Process Now.
@return Proce... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Demand.java | 1 |
请完成以下Java代码 | public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Processed.
@param Processed
The document has... | }
/** Get Details.
@return Details */
public String getTextDetails ()
{
return (String)get_Value(COLUMNNAME_TextDetails);
}
/** Set Text Message.
@param TextMsg
Text Message
*/
public void setTextMsg (String TextMsg)
{
set_Value (COLUMNNAME_TextMsg, TextMsg);
}
/** Get Text Message.
@retu... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_B_Topic.java | 1 |
请完成以下Java代码 | public String getScript() {
return script;
}
/**
* @see Builder#scopeContainer(VariableContainer)
*/
public VariableContainer getScopeContainer() {
return scopeContainer;
}
/**
* @see Builder#inputVariableContainer(VariableContainer)
*/
public VariableContai... | /**
* @see Builder#traceEnhancer(ScriptTraceEnhancer)
*/
public ScriptTraceEnhancer getTraceEnhancer() {
return traceEnhancer;
}
@Override
public String toString() {
return new StringJoiner(", ", ScriptEngineRequest.class.getSimpleName() + "[", "]")
.add("langu... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\scripting\ScriptEngineRequest.java | 1 |
请完成以下Java代码 | public void setM_ProductBOM_ID (int M_ProductBOM_ID)
{
if (M_ProductBOM_ID < 1)
set_Value (COLUMNNAME_M_ProductBOM_ID, null);
else
set_Value (COLUMNNAME_M_ProductBOM_ID, Integer.valueOf(M_ProductBOM_ID));
}
/** Get BOM Product.
@return Bill of Material Component Product
*/
public int getM_ProductB... | if (M_Product_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_Product_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID));
}
/** Get Product.
@return Product, Service, Item
*/
public int getM_Product_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Product_BOM.java | 1 |
请完成以下Java代码 | public int getDoc_User_ID()
{
return getCreatedBy();
} // getDoc_User_ID
/**
* Get Document Approval Amount
*
* @return DR amount
*/
@Override
public BigDecimal getApprovalAmt()
{
return getTotalDr();
} // getApprovalAmt
/**
* Document Status is Complete or Closed
*
* @return true if C... | private static void setAmtPrecision(final I_GL_Journal journal)
{
final AcctSchemaId acctSchemaId = AcctSchemaId.ofRepoIdOrNull(journal.getC_AcctSchema_ID());
if (acctSchemaId == null)
{
return;
}
final AcctSchema as = Services.get(IAcctSchemaDAO.class).getById(acctSchemaId);
final CurrencyPrecision pr... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\model\MJournal.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PickingJobWarehouseService
{
@NonNull private final IWarehouseBL warehouseBL = Services.get(IWarehouseBL.class);
@NonNull private final WorkplaceService workplaceService;
public String getLocatorNameById(final LocatorId locatorId)
{
return warehouseBL.getLocatorById(locatorId).getValue();
}
publi... | public Optional<Workplace> getWorkplaceByUserId(@NonNull final UserId userId)
{
return workplaceService.getWorkplaceByUserId(userId);
}
public Optional<WarehouseId> getWarehouseIdByUserId(@NonNull final UserId userId)
{
return workplaceService.getWarehouseIdByUserId(userId);
}
public Set<LocatorId> getPickF... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\external\warehouse\PickingJobWarehouseService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public static class SessionExpirationProperties {
private int maxInactiveIntervalSeconds;
public int getMaxInactiveIntervalSeconds() {
return this.maxInactiveIntervalSeconds;
}
public void setMaxInactiveIntervalSeconds(int maxInactiveIntervalSeconds) {
this.maxInactiveIntervalSeconds = maxInactiveInter... | public void setName(String name) {
this.name = name;
}
}
public static class SessionSerializerProperties {
private String beanName;
public String getBeanName() {
return this.beanName;
}
public void setBeanName(String beanName) {
this.beanName = beanName;
}
}
} | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\configuration\SpringSessionProperties.java | 2 |
请完成以下Java代码 | public void setNestedProcessInstanceId(String nestedProcessInstanceId) {
this.nestedProcessInstanceId = nestedProcessInstanceId;
}
@Override
public String getNestedProcessInstanceId() {
return nestedProcessInstanceId;
}
public void setLinkedProcessInstanceId(String linkedProcessIns... | super.toString() +
"nestedProcessDefinitionId='" +
nestedProcessDefinitionId +
'\'' +
", nestedProcessInstanceId='" +
nestedProcessInstanceId +
'\'' +
", linkedProcessInstanceId='" +
linkedProcessInstanceId +
'\'... | repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-process-runtime-impl\src\main\java\org\activiti\runtime\api\event\impl\ProcessStartedEventImpl.java | 1 |
请完成以下Java代码 | static void updatePriceAndTax(@NonNull final I_C_Invoice_Candidate ic, @NonNull final PriceAndTax priceAndTax)
{
//
// Pricing System & Currency
if (priceAndTax.getPricingSystemId() != null)
{
ic.setM_PricingSystem_ID(priceAndTax.getPricingSystemId().getRepoId());
}
if (priceAndTax.getPriceListVersionId... | // Tax
if (priceAndTax.getTaxIncluded() != null)
{
ic.setIsTaxIncluded(priceAndTax.getTaxIncluded());
}
if (priceAndTax.getTaxId() != null)
{
ic.setC_Tax_ID(priceAndTax.getTaxId().getRepoId());
}
//
// Compensation group
if (priceAndTax.getCompensationGroupBaseAmt() != null)
{
ic.setGrou... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\IInvoiceCandInvalidUpdater.java | 1 |
请完成以下Java代码 | public CurrencyConversionContext getCurrencyConversionContext(@NonNull final I_M_InOut inout)
{
final CurrencyConversionContext conversionCtx = currencyBL.createCurrencyConversionContext(
inout.getDateAcct().toInstant(),
(CurrencyConversionTypeId)null,
ClientId.ofRepoId(inout.getAD_Client_ID()),
OrgI... | .excludeDocStatuses(ImmutableSet.of(DocStatus.Voided, DocStatus.Reversed))
.build();
return inOutDAO.retrieveByQuery(query).collect(ImmutableSet.toImmutableSet());
}
@Override
public void setShipperId(@NonNull final I_M_InOut inout)
{
inout.setM_Shipper_ID(ShipperId.toRepoId(findShipperId(inout)));
}
pr... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\inout\impl\InOutBL.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.