instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public static boolean equals(@Nullable final DocBaseType o1, @Nullable final DocBaseType o2) {return Objects.equals(o1, o2);} @JsonValue public String getCode() { return code; } public boolean isSOTrx() { return isSalesOrder() || isShipment() || isSalesInvoice() || isSalesCreditMemo() || isARReceipt(); } public String getTableName() { if(isShipment() || isReceipt() || isARReceipt()) return I_M_InOut.Table_Name; else if(isSalesOrder() || isPurchaseOrder()) return I_C_Order.Table_Name; else if(isSalesInvoice() || isPurchaseInvoice() || isPurchaseCreditMemo()) return I_C_Invoice.Table_Name; else throw new AdempiereException("No known tableName found for DocBaseType " + code);
} public boolean isSalesOrder() {return SalesOrder.equals(this);} public boolean isPurchaseOrder() {return PurchaseOrder.equals(this);} public boolean isSalesInvoice() { return SalesInvoice.equals(this); } public boolean isPurchaseInvoice() { return PurchaseInvoice.equals(this); } public boolean isSalesCreditMemo() { return SalesCreditMemo.equals(this); } public boolean isPurchaseCreditMemo() { return PurchaseCreditMemo.equals(this); } public boolean isDunningDoc(){return DunningDoc.equals((this));} public boolean isShipment(){ return Shipment.equals(this); } public boolean isARReceipt(){ return ARReceipt.equals(this); } public boolean isReceipt(){ return MaterialReceipt.equals(this); } public boolean isShipperTransportation(){ return ShipperTransportation.equals(this); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\document\DocBaseType.java
1
请完成以下Java代码
private IQueryBuilder<I_ES_FTS_Index_Queue> queryForTag(@Nullable final String processingTag) { return queryBL.createQueryBuilderOutOfTrx(I_ES_FTS_Index_Queue.class) .addEqualsFilter(I_ES_FTS_Index_Queue.COLUMNNAME_ProcessingTag, processingTag); } public void markAsProcessed(@NonNull final String processingTag) { queryForTag(processingTag) .create() .updateDirectly() .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_Processed, true) .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_Updated, SystemTime.asInstant()) .execute(); } public void markAsError(@NonNull final String processingTag, @NonNull final AdIssueId adIssueId) { queryForTag(processingTag) .create() .updateDirectly() .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_Processed, true)
.addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_IsError, true) .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_AD_Issue_ID, adIssueId) .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_Updated, SystemTime.asInstant()) .execute(); } public void untag(final String processingTag) { queryForTag(processingTag) .create() .updateDirectly() .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_ProcessingTag, null) .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_Processed, false) .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_IsError, false) .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_AD_Issue_ID, null) .addSetColumnValue(I_ES_FTS_Index_Queue.COLUMNNAME_Updated, SystemTime.asInstant()) .execute(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.elasticsearch\src\main\java\de\metas\fulltextsearch\indexer\queue\ModelToIndexRepository.java
1
请完成以下Java代码
public final class DocumentLayoutElementLineDescriptor { public static final Builder builder() { return new Builder(); } private final String internalName; private final List<DocumentLayoutElementDescriptor> elements; private DocumentLayoutElementLineDescriptor(@NonNull final Builder builder) { internalName = builder.internalName; elements = ImmutableList.copyOf(builder.buildElements()); } @Override public String toString() { return MoreObjects.toStringHelper(this) .omitNullValues() .add("internalName", internalName) .add("elements", elements.isEmpty() ? null : elements) .toString(); } public List<DocumentLayoutElementDescriptor> getElements() { return elements; } public static final class Builder { private static final Logger logger = LogManager.getLogger(DocumentLayoutElementLineDescriptor.Builder.class); private String internalName; private final List<DocumentLayoutElementDescriptor.Builder> elementsBuilders = new ArrayList<>(); private Builder() { } @Override public String toString() { return MoreObjects.toStringHelper(this) .omitNullValues() .add("internalName", internalName) .add("elements-count", elementsBuilders.size()) .toString(); } public DocumentLayoutElementLineDescriptor build() { final DocumentLayoutElementLineDescriptor result = new DocumentLayoutElementLineDescriptor(this); logger.trace("Built {} for {}", result, this); return result; } private List<DocumentLayoutElementDescriptor> buildElements() { return elementsBuilders .stream() .filter(elementBuilder -> checkValid(elementBuilder)) .map(elementBuilder -> elementBuilder.build()) .filter(element -> checkValid(element)) .collect(GuavaCollectors.toImmutableList()); } private final boolean checkValid(final DocumentLayoutElementDescriptor.Builder elementBuilder) { if (elementBuilder.isConsumed()) { logger.trace("Skip adding {} to {} because it's already consumed", elementBuilder, this); return false; } if (elementBuilder.isEmpty()) {
logger.trace("Skip adding {} to {} because it's empty", elementBuilder, this); return false; } return true; } private final boolean checkValid(final DocumentLayoutElementDescriptor element) { if (element.isEmpty()) { logger.trace("Skip adding {} to {} because it does not have fields", element, this); return false; } return true; } public Builder setInternalName(final String internalName) { this.internalName = internalName; return this; } public Builder addElement(final DocumentLayoutElementDescriptor.Builder elementBuilder) { elementsBuilders.add(elementBuilder); return this; } public boolean hasElements() { return !elementsBuilders.isEmpty(); } public Stream<DocumentLayoutElementDescriptor.Builder> streamElementBuilders() { return elementsBuilders.stream(); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\DocumentLayoutElementLineDescriptor.java
1
请完成以下Java代码
public Collection<Property> getProperties() { return propertyCollection.get(this); } public static void registerType(ModelBuilder modelBuilder) { ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFileItemDefinition.class, CMMN_ELEMENT_CASE_FILE_ITEM_DEFINITION) .namespaceUri(CMMN11_NS) .extendsType(CmmnElement.class) .instanceProvider(new ModelTypeInstanceProvider<CaseFileItemDefinition>() { public CaseFileItemDefinition newInstance(ModelTypeInstanceContext instanceContext) { return new CaseFileItemDefinitionImpl(instanceContext); } }); nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) .build(); definitionTypeAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_DEFINITION_TYPE) .defaultValue("http://www.omg.org/spec/CMMN/DefinitionType/Unspecified")
.build(); structureAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_STRUCTURE_REF) .build(); // TODO: The Import does not have an id attribute! // importRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_IMPORT_REF) // .qNameAttributeReference(Import.class) // .build(); SequenceBuilder sequenceBuilder = typeBuilder.sequence(); propertyCollection = sequenceBuilder.elementCollection(Property.class) .build(); typeBuilder.build(); } }
repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\CaseFileItemDefinitionImpl.java
1
请完成以下Java代码
public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof DocActionItem) { final DocActionItem other = (DocActionItem)obj; return Objects.equal(value, other.value); } else { return false; }
} @Override public String getValue() { return value; } @Override public String getDescription() { return description; } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\document\engine\impl\AbstractDocumentBL.java
1
请完成以下Java代码
protected final Comparator<I_M_HU_Item> createItemsComparator() { return IHandlingUnitsDAO.HU_ITEMS_COMPARATOR; } /** * Retrieves a list of {@link I_M_HU_Item}s with ordering according to {@link #ITEM_TYPE_ORDERING}. */ @Override protected final List<I_M_HU_Item> retrieveItems(final IContextAware ctx, final I_M_HU hu) { final IQueryBuilder<I_M_HU_Item> queryBuilder = queryBL.createQueryBuilder(I_M_HU_Item.class, ctx) .addEqualsFilter(I_M_HU_Item.COLUMN_M_HU_ID, hu.getM_HU_ID()) .addOnlyActiveRecordsFilter(); final List<I_M_HU_Item> items = queryBuilder
.create() .list() .stream() .peek(item -> item.setM_HU(hu)) // Make sure item.getM_HU() will return our HU .sorted(createItemsComparator()) .collect(Collectors.toList()); return items; } @Override protected Object mkKey(final I_M_HU_Item item) { return item.getM_HU_Item_ID(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\HUItemsLocalCache.java
1
请完成以下Java代码
public void setPP_Order(final org.eevolution.model.I_PP_Order PP_Order) { set_ValueFromPO(COLUMNNAME_PP_Order_ID, org.eevolution.model.I_PP_Order.class, PP_Order); } @Override public void setPP_Order_ID (final int PP_Order_ID) { if (PP_Order_ID < 1) set_Value (COLUMNNAME_PP_Order_ID, null); else set_Value (COLUMNNAME_PP_Order_ID, PP_Order_ID); } @Override public int getPP_Order_ID() { return get_ValueAsInt(COLUMNNAME_PP_Order_ID); } @Override public org.eevolution.model.I_PP_Order_Candidate getPP_OrderLine_Candidate() { return get_ValueAsPO(COLUMNNAME_PP_OrderLine_Candidate_ID, org.eevolution.model.I_PP_Order_Candidate.class); } @Override public void setPP_OrderLine_Candidate(final org.eevolution.model.I_PP_Order_Candidate PP_OrderLine_Candidate) { set_ValueFromPO(COLUMNNAME_PP_OrderLine_Candidate_ID, org.eevolution.model.I_PP_Order_Candidate.class, PP_OrderLine_Candidate); } @Override public void setPP_OrderLine_Candidate_ID (final int PP_OrderLine_Candidate_ID) { if (PP_OrderLine_Candidate_ID < 1) set_Value (COLUMNNAME_PP_OrderLine_Candidate_ID, null); else set_Value (COLUMNNAME_PP_OrderLine_Candidate_ID, PP_OrderLine_Candidate_ID); } @Override public int getPP_OrderLine_Candidate_ID() { return get_ValueAsInt(COLUMNNAME_PP_OrderLine_Candidate_ID); } @Override
public org.compiere.model.I_S_Resource getPP_Plant() { return get_ValueAsPO(COLUMNNAME_PP_Plant_ID, org.compiere.model.I_S_Resource.class); } @Override public void setPP_Plant(final org.compiere.model.I_S_Resource PP_Plant) { set_ValueFromPO(COLUMNNAME_PP_Plant_ID, org.compiere.model.I_S_Resource.class, PP_Plant); } @Override public void setPP_Plant_ID (final int PP_Plant_ID) { if (PP_Plant_ID < 1) set_Value (COLUMNNAME_PP_Plant_ID, null); else set_Value (COLUMNNAME_PP_Plant_ID, PP_Plant_ID); } @Override public int getPP_Plant_ID() { return get_ValueAsInt(COLUMNNAME_PP_Plant_ID); } @Override public void setPP_Product_Planning_ID (final int PP_Product_Planning_ID) { if (PP_Product_Planning_ID < 1) set_Value (COLUMNNAME_PP_Product_Planning_ID, null); else set_Value (COLUMNNAME_PP_Product_Planning_ID, PP_Product_Planning_ID); } @Override public int getPP_Product_Planning_ID() { return get_ValueAsInt(COLUMNNAME_PP_Product_Planning_ID); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java-gen\de\metas\material\dispo\model\X_MD_Candidate_Dist_Detail.java
1
请完成以下Java代码
public void downloadNow(final InputStream content, final String contentType, final String filename) { getCurrentInstance().downloadNow(content, contentType, filename); } @Override public void invokeLater(final int windowNo, final Runnable runnable) { getCurrentInstance().invokeLater(windowNo, runnable); } @Override public Thread createUserThread(final Runnable runnable, final String threadName) { return getCurrentInstance().createUserThread(runnable, threadName); } @Override public String getClientInfo() { return getCurrentInstance().getClientInfo(); } /** * This method does nothing. * * @deprecated please check out the deprecation notice in {@link IClientUIInstance#hideBusyDialog()}. */ @Deprecated @Override public void hideBusyDialog() { // nothing } @Override
public void showWindow(final Object model) { getCurrentInstance().showWindow(model); } @Override public void executeLongOperation(final Object component, final Runnable runnable) { getCurrentInstance().executeLongOperation(component, runnable); } @Override public IClientUIInvoker invoke() { return getCurrentInstance().invoke(); } @Override public IClientUIAsyncInvoker invokeAsync() { return getCurrentInstance().invokeAsync(); } @Override public void showURL(String url) { getCurrentInstance().showURL(url); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\adempiere\form\AbstractClientUI.java
1
请在Spring Boot框架中完成以下Java代码
public class ElementPermission implements Permission { public static ElementPermission ofReadWriteFlag(final ElementResource resource, final boolean readWrite) { final ImmutableSet.Builder<Access> accesses = ImmutableSet.builder(); // READ access: this is implied if we are here accesses.add(Access.READ); // WRITE access: if (readWrite) { accesses.add(Access.WRITE); } return new ElementPermission(resource, accesses.build()); } public static ElementPermission none(final ElementResource resource) { return new ElementPermission(resource, ImmutableSet.of()); } @NonNull ElementResource resource; @Getter(AccessLevel.PRIVATE) @NonNull ImmutableSet<Access> accesses; private ElementPermission( @NonNull final ElementResource resource, @NonNull final ImmutableSet<Access> accesses) { this.resource = resource; this.accesses = accesses; } public int getElementId() { return resource.getElementId(); } @Override public boolean hasAccess(final Access access) { return accesses.contains(access); } public boolean hasReadAccess() { return accesses.contains(Access.READ); } public boolean hasWriteAccess() { return accesses.contains(Access.WRITE); } @Nullable
public Boolean getReadWriteBoolean() { if (hasAccess(Access.WRITE)) { return Boolean.TRUE; } else if (hasAccess(Access.READ)) { return Boolean.FALSE; } else { return null; } } @Override public ElementPermission mergeWith(final Permission permissionFrom) { final ElementPermission elementPermissionFrom = PermissionInternalUtils.checkCompatibleAndCastToTarget(this, permissionFrom); return withAccesses(ImmutableSet.<Access>builder() .addAll(this.accesses) .addAll(elementPermissionFrom.accesses) .build()); } private ElementPermission withAccesses(@NonNull final ImmutableSet<Access> accesses) { return !Objects.equals(this.accesses, accesses) ? new ElementPermission(this.resource, accesses) : this; } public ElementPermission withResource(@NonNull final ElementResource resource) { return !Objects.equals(this.resource, resource) ? new ElementPermission(resource, this.accesses) : this; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\permissions\ElementPermission.java
2
请完成以下Java代码
public Iterator<I_M_HU_PI_Attribute> iterator() { return list.iterator(); } public boolean hasActiveAttribute(@NonNull final AttributeId attributeId) { final I_M_HU_PI_Attribute piAttribute = getByAttributeIdOrNull(attributeId); return piAttribute != null && piAttribute.isActive(); } public I_M_HU_PI_Attribute getByAttributeId(final AttributeId attributeId) { final I_M_HU_PI_Attribute piAttribute = getByAttributeIdOrNull(attributeId); if (piAttribute == null) { throw new AdempiereException("No " + attributeId + " found. Available attributeIds are: " + getAttributeIds()); } return piAttribute; } public Optional<I_M_HU_PI_Attribute> getByAttributeIdIfExists(final AttributeId attributeId) { final I_M_HU_PI_Attribute piAttribute = getByAttributeIdOrNull(attributeId); return Optional.ofNullable(piAttribute); } private I_M_HU_PI_Attribute getByAttributeIdOrNull(final AttributeId attributeId) { return attributesByAttributeId.get(attributeId); } public PIAttributes addIfAbsent(@NonNull final PIAttributes from) { if (from.isEmpty()) { return this; } if (this.isEmpty()) { return from; } final LinkedHashMap<AttributeId, I_M_HU_PI_Attribute> piAttributesNew = new LinkedHashMap<>(attributesByAttributeId); from.attributesByAttributeId.forEach(piAttributesNew::putIfAbsent); return of(piAttributesNew.values()); }
public int getSeqNoByAttributeId(final AttributeId attributeId, final int seqNoIfNotFound) { final I_M_HU_PI_Attribute piAttribute = getByAttributeIdOrNull(attributeId); if (piAttribute == null) { return seqNoIfNotFound; } return piAttribute.getSeqNo(); } public ImmutableSet<AttributeId> getAttributeIds() { return attributesByAttributeId.keySet(); } public boolean isEmpty() { return attributesByAttributeId.isEmpty(); } public boolean isUseInASI(@NonNull final AttributeId attributeId) { return getByAttributeId(attributeId).isUseInASI(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\PIAttributes.java
1
请完成以下Java代码
private static void updateRecord(final I_C_POS_Journal record, final POSCashJournal from) { record.setC_POS_ID(from.getTerminalId().getRepoId()); record.setDateTrx(Timestamp.from(from.getDateTrx())); record.setC_Currency_ID(from.getCurrencyId().getRepoId()); record.setCashBeginningBalance(from.getCashBeginningBalance().toBigDecimal()); record.setCashEndingBalance(from.getCashEndingBalance().toBigDecimal()); record.setOpeningNote(from.getOpeningNote()); record.setClosingNote(from.getClosingNote()); record.setIsClosed(from.isClosed()); } private static void updateRecord(final I_C_POS_JournalLine record, final POSCashJournalLine from) { record.setType(from.getType().getCode()); record.setAmount(from.getAmount().toBigDecimal()); record.setCashier_ID(from.getCashierId().getRepoId()); record.setDescription(from.getDescription()); record.setC_POS_Order_ID(from.getPosOrderAndPaymentId() != null ? from.getPosOrderAndPaymentId().getOrderId().getRepoId() : -1); record.setC_POS_Payment_ID(from.getPosOrderAndPaymentId() != null ? from.getPosOrderAndPaymentId().getPaymentId().getRepoId() : -1); } public POSCashJournal changeJournalById(@NonNull final POSCashJournalId cashJournalId, @NonNull final Consumer<POSCashJournal> updater) { final I_C_POS_Journal record = retrieveRecordById(cashJournalId); final List<I_C_POS_JournalLine> lineRecords = retrieveLineRecordsByJournalId(cashJournalId); final POSCashJournal journal = fromRecord(record, lineRecords); updater.accept(journal); updateRecord(record, journal); InterfaceWrapperHelper.save(record); final ImmutableList<POSCashJournalLine> lines = journal.getLines(); for (int i = 0; i < lines.size(); i++) { final POSCashJournalLine line = lines.get(i);
I_C_POS_JournalLine lineRecord = i < lineRecords.size() ? lineRecords.get(i) : null; if (lineRecord == null) { lineRecord = InterfaceWrapperHelper.newInstance(I_C_POS_JournalLine.class); lineRecord.setC_POS_Journal_ID(record.getC_POS_Journal_ID()); } lineRecord.setAD_Org_ID(record.getAD_Org_ID()); updateRecord(lineRecord, line); InterfaceWrapperHelper.save(lineRecord); } for (int i = lines.size(); i < lineRecords.size(); i++) { InterfaceWrapperHelper.delete(lineRecords.get(i)); } return journal; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSCashJournalRepository.java
1
请在Spring Boot框架中完成以下Java代码
public class AttributesIncludedTabDataField { @NonNull AttributeId attributeId; @NonNull AttributeValueType valueType; @Nullable String valueString; @Nullable BigDecimal valueNumber; @Nullable LocalDate valueDate; @Nullable AttributeValueId valueItemId; @SuppressWarnings("unused") public static class AttributesIncludedTabDataFieldBuilder { AttributesIncludedTabDataFieldBuilder clearValues() { valueString(null); valueNumber(null); valueDate(null); valueItemId(null); return this; } } public boolean isNullValues() { return (valueString == null || valueString.isEmpty()) && valueNumber == null && valueDate == null && valueItemId == null; } public static boolean equals(@Nullable AttributesIncludedTabDataField field1, @Nullable AttributesIncludedTabDataField field2) { return Objects.equals(field1, field2); } public AttributesIncludedTabDataField withDateValue(@Nullable LocalDate valueDate) { Check.assumeEquals(valueType, AttributeValueType.DATE, "Expected DATE type: {}", this); return toBuilder().clearValues().valueDate(valueDate).build();
} public AttributesIncludedTabDataField withListValue(@Nullable String valueString, @Nullable AttributeValueId valueItemId) { Check.assumeEquals(valueType, AttributeValueType.LIST, "Expected list type: {}", this); return toBuilder().clearValues().valueString(valueString).valueItemId(valueItemId).build(); } public AttributesIncludedTabDataField withNumberValue(@Nullable Integer valueInt) { return withNumberValue(valueInt != null ? BigDecimal.valueOf(valueInt) : null); } public AttributesIncludedTabDataField withNumberValue(@Nullable BigDecimal valueNumber) { Check.assumeEquals(valueType, AttributeValueType.NUMBER, "Expected NUMBER type: {}", this); return toBuilder().clearValues().valueNumber(valueNumber).build(); } public AttributesIncludedTabDataField withStringValue(@Nullable String valueString) { Check.assumeEquals(valueType, AttributeValueType.STRING, "Expected STRING type: {}", this); return toBuilder().clearValues().valueString(valueString).build(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\attributes_included_tab\data\AttributesIncludedTabDataField.java
2
请在Spring Boot框架中完成以下Java代码
public class UserNotificationsGroup { public static UserNotificationsGroup.UserNotificationsGroupBuilder prepareDefault() { return UserNotificationsGroup.builder().groupInternalName(DEFAULT_GroupInternalName); } private static NotificationGroupName DEFAULT_GroupInternalName = NotificationGroupName.of("default"); @NonNull NotificationGroupName groupInternalName; @NonNull ImmutableSet<NotificationType> notificationTypes; @Builder private UserNotificationsGroup( @NonNull final NotificationGroupName groupInternalName, @Singular final Set<NotificationType> notificationTypes) { this.groupInternalName = groupInternalName; this.notificationTypes = ImmutableSet.copyOf(notificationTypes); } public boolean isNotifyUserInCharge() { return notificationTypes.contains(NotificationType.NotifyUserInCharge); } public boolean isNotifyByEMail() { return notificationTypes.contains(NotificationType.EMail); } public boolean isNotifyByInternalMessage() {
return notificationTypes.contains(NotificationType.Notice); } public boolean hasAnyNotificationTypesExceptUserInCharge() { return hasAnyNotificationTypesExcept(NotificationType.NotifyUserInCharge); } public boolean hasAnyNotificationTypesExcept(final NotificationType typeToExclude) { final int notificationTypesCount = notificationTypes.size(); if (notificationTypesCount <= 0) { return false; } else if (notificationTypesCount == 1) { return !notificationTypes.contains(typeToExclude); } else // notificationTypesCount > 1 { return true; } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\notification\UserNotificationsGroup.java
2
请完成以下Java代码
public void setPricePrecision (int PricePrecision) { set_Value (COLUMNNAME_PricePrecision, Integer.valueOf(PricePrecision)); } /** Get Price Precision. @return Precision (number of decimals) for the Price */ public int getPricePrecision () { Integer ii = (Integer)get_Value(COLUMNNAME_PricePrecision); if (ii == null) return 0; return ii.intValue(); } /** Set Standard Price. @param PriceStd Standard Price */ public void setPriceStd (BigDecimal PriceStd) { set_Value (COLUMNNAME_PriceStd, PriceStd); } /** Get Standard Price. @return Standard Price */ public BigDecimal getPriceStd () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PriceStd); if (bd == null) return Env.ZERO; return bd; } /** Set Processed. @param Processed The document has been processed */ public void setProcessed (boolean Processed) { set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed)); } /** Get Processed. @return The document has been processed */ public boolean isProcessed () { Object oo = get_Value(COLUMNNAME_Processed); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Process Now. @param Processing Process Now */ public void setProcessing (boolean Processing) { set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); } /** Get Process Now. @return Process Now */ public boolean isProcessing () { Object oo = get_Value(COLUMNNAME_Processing); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Product Key. @param ProductValue Key of the Product */ public void setProductValue (String ProductValue) { set_Value (COLUMNNAME_ProductValue, ProductValue);
} /** Get Product Key. @return Key of the Product */ public String getProductValue () { return (String)get_Value(COLUMNNAME_ProductValue); } /** Set Valid from. @param ValidFrom Valid from including this date (first day) */ public void setValidFrom (Timestamp ValidFrom) { set_Value (COLUMNNAME_ValidFrom, ValidFrom); } /** Get Valid from. @return Valid from including this date (first day) */ public Timestamp getValidFrom () { return (Timestamp)get_Value(COLUMNNAME_ValidFrom); } /** Set UOM Code. @param X12DE355 UOM EDI X12 Code */ public void setX12DE355 (String X12DE355) { set_Value (COLUMNNAME_X12DE355, X12DE355); } /** Get UOM Code. @return UOM EDI X12 Code */ public String getX12DE355 () { return (String)get_Value(COLUMNNAME_X12DE355); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_PriceList.java
1
请完成以下Java代码
public class Blog implements Serializable { @CssSelector(selector = "#mainBox > main > div.blog-content-box > div.article-header-box > div > div.article-info-box > div > span.time", dateFormat = "yyyy年MM月dd日 HH:mm:ss") private Date publishDate; @CssSelector(selector = "main > div.blog-content-box > div.article-header-box > div.article-header>div.article-title-box > h1", resultType = SelectType.TEXT) private String title; @CssSelector(selector = "main > div.blog-content-box > div.article-header-box > div.article-header>div.article-info-box > div > div > span.read-count", resultType = SelectType.TEXT) private String readCountStr; private int readCount; @CssSelector(selector = "#article_content",resultType = SelectType.TEXT) private String content; @CssSelector(selector = "body > div.tool-box > ul > li:nth-child(1) > button > p",resultType = SelectType.TEXT) private int likeCount; /** * 暂时不支持自动解析列表的功能,所以加个中间变量,需要二次解析下 */ @CssSelector(selector = "#mainBox > main > div.comment-box > div.comment-list-container > div.comment-list-box",resultType = SelectType.HTML) private String comentTmp; private String url; private String urlMd5; private List<String> comment; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public Date getPublishDate() { return publishDate; } public String getReadCountStr() { return readCountStr; } public void setReadCountStr(String readCountStr) { this.readCountStr = readCountStr; } public void setPublishDate(Date publishDate) { this.publishDate = publishDate; } public int getReadCount() { return readCount; } public void setReadCount(int readCount) { this.readCount = readCount; }
public String getContent() { return content; } public void setContent(String content) { this.content = content; } public int getLikeCount() { return likeCount; } public void setLikeCount(int likeCount) { this.likeCount = likeCount; } public String getComentTmp() { return comentTmp; } public void setComentTmp(String comentTmp) { this.comentTmp = comentTmp; } public List<String> getComment() { return comment; } public void setComment(List<String> comment) { this.comment = comment; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getUrlMd5() { return urlMd5; } public void setUrlMd5(String urlMd5) { this.urlMd5 = urlMd5; } @Override public String toString() { return "Blog{" + "title='" + title + '\'' + ", publishDate=" + publishDate + ", readCountStr='" + readCountStr + '\'' + ", readCount=" + readCount + ", content='" + content + '\'' + ", likeCount=" + likeCount + ", comentTmp='" + comentTmp + '\'' + ", url='" + url + '\'' + ", comment=" + comment + '}'; } }
repos\spring-boot-quick-master\quick-vw-crawler\src\main\java\com\crawler\vw\entity\Blog.java
1
请在Spring Boot框架中完成以下Java代码
public class PersonServiceImpl implements PersonService { private static final Logger logger = LoggerFactory.getLogger(PersonServiceImpl.class); private static ThreadLocalRandom random = ThreadLocalRandom.current(); static { random.ints(); } @Override @SentinelResource(entryType = EntryType.IN) public Result semaphore(String arg) { Person person = new Person(); person.setAge(18); person.setId(2L); person.setName("名称semaphore"); person.setAddress("地址semaphore"); logger.info(JSON.toJSONString(person)); return Result.success(person); } @Override public Result thread(String arg) { // 资源的唯一标识 String resourceName = "testSentinel"; int time = random.nextInt(700); Entry entry = null; String retVal; try { entry = SphU.entry(resourceName, EntryType.IN); Thread.sleep(time); if (time > 690) {
throw new RuntimeException("耗时太长啦"); } retVal = "passed"; } catch (BlockException e) { // logger.error("请求拒绝 {}", e.getMessage(), e); retVal = "blocked"; } catch (Exception e) { // logger.error("异常 {}", e.getMessage(), e); // 异常数统计埋点 Tracer.trace(e); throw new RuntimeException(e); } finally { if (entry != null) { entry.exit(); } } return Result.success(retVal + "::" + time); } }
repos\spring-boot-student-master\spring-boot-student-sentinel\src\main\java\com\xiaolyuh\service\impl\PersonServiceImpl.java
2
请完成以下Java代码
public void setValue(String value) { this.value = value; } public String getNamespacePrefix() { return namespacePrefix; } public void setNamespacePrefix(String namespacePrefix) { this.namespacePrefix = namespacePrefix; } public String getNamespace() { return namespace; } public void setNamespace(String namespace) { this.namespace = namespace; } @Override public String toString() { StringBuilder sb = new StringBuilder();
if (namespacePrefix != null) { sb.append(namespacePrefix); if (name != null) sb.append(":").append(name); } else sb.append(name); if (value != null) sb.append("=").append(value); return sb.toString(); } public ExtensionAttribute clone() { ExtensionAttribute clone = new ExtensionAttribute(); clone.setValues(this); return clone; } public void setValues(ExtensionAttribute otherAttribute) { setName(otherAttribute.getName()); setValue(otherAttribute.getValue()); setNamespacePrefix(otherAttribute.getNamespacePrefix()); setNamespace(otherAttribute.getNamespace()); } }
repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\ExtensionAttribute.java
1
请在Spring Boot框架中完成以下Java代码
public class Player implements Serializable { private static final long serialVersionUID = 1L; @Id private Long id; private String name; private String city; private int age; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) {
this.name = name; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } @Override public String toString() { return "User{" + "id=" + id + ", name=" + name + ", city=" + city + ", age=" + age + '}'; } }
repos\Hibernate-SpringBoot-master\SpringBootPayaraMySqlKickoffApplication\src\main\java\com\jpa\model\Player.java
2
请在Spring Boot框架中完成以下Java代码
public class JerseyConfig extends ResourceConfig { public JerseyConfig(CarsODataJPAServiceFactory serviceFactory, EntityManagerFactory emf) { ODataApplication app = new ODataApplication(); app .getClasses() .forEach( c -> { // Avoid using the default RootLocator, as we want // a Spring Managed one if ( !ODataRootLocator.class.isAssignableFrom(c)) { register(c); } }); register(new CarsRootLocator(serviceFactory)); register( new EntityManagerFilter(emf)); } /** * This filter handles the EntityManager transaction lifecycle. * @author Philippe * */ @Provider public static class EntityManagerFilter implements ContainerRequestFilter, ContainerResponseFilter { private static final Logger log = LoggerFactory.getLogger(EntityManagerFilter.class); public static final String EM_REQUEST_ATTRIBUTE = EntityManagerFilter.class.getName() + "_ENTITY_MANAGER"; private final EntityManagerFactory emf; @Context private HttpServletRequest httpRequest; public EntityManagerFilter(EntityManagerFactory emf) { this.emf = emf; } @Override public void filter(ContainerRequestContext ctx) { log.info("[I60] >>> filter"); EntityManager em = this.emf.createEntityManager(); httpRequest.setAttribute(EM_REQUEST_ATTRIBUTE, em); // Start a new transaction unless we have a simple GET if (!"GET".equalsIgnoreCase(ctx.getMethod())) { em.getTransaction() .begin(); } } @Override
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) { log.info("[I68] <<< filter"); EntityManager em = (EntityManager) httpRequest.getAttribute(EM_REQUEST_ATTRIBUTE); if (!"GET".equalsIgnoreCase(requestContext.getMethod())) { EntityTransaction t = em.getTransaction(); if (t.isActive()) { if (!t.getRollbackOnly()) { t.commit(); } } } em.close(); } } @Path("/") public static class CarsRootLocator extends ODataRootLocator { private CarsODataJPAServiceFactory serviceFactory; public CarsRootLocator(CarsODataJPAServiceFactory serviceFactory) { this.serviceFactory = serviceFactory; } @Override public ODataServiceFactory getServiceFactory() { return this.serviceFactory; } } }
repos\tutorials-master\apache-olingo\src\main\java\com\baeldung\examples\olingo2\JerseyConfig.java
2
请完成以下Java代码
public class Interface extends BaseElement { protected String name; protected String implementationRef; protected List<Operation> operations = new ArrayList<Operation>(); public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImplementationRef() { return implementationRef; } public void setImplementationRef(String implementationRef) { this.implementationRef = implementationRef; } public List<Operation> getOperations() { return operations; } public void setOperations(List<Operation> operations) { this.operations = operations; } public Interface clone() { Interface clone = new Interface();
clone.setValues(this); return clone; } public void setValues(Interface otherElement) { super.setValues(otherElement); setName(otherElement.getName()); setImplementationRef(otherElement.getImplementationRef()); operations = new ArrayList<Operation>(); if (otherElement.getOperations() != null && !otherElement.getOperations().isEmpty()) { for (Operation operation : otherElement.getOperations()) { operations.add(operation.clone()); } } } }
repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\Interface.java
1
请完成以下Java代码
public void setM_CommodityNumber_ID (int M_CommodityNumber_ID) { if (M_CommodityNumber_ID < 1) set_ValueNoCheck (COLUMNNAME_M_CommodityNumber_ID, null); else set_ValueNoCheck (COLUMNNAME_M_CommodityNumber_ID, Integer.valueOf(M_CommodityNumber_ID)); } @Override public int getM_CommodityNumber_ID() { return get_ValueAsInt(COLUMNNAME_M_CommodityNumber_ID); } @Override public void setName (java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } @Override public java.lang.String getName() { return (java.lang.String)get_Value(COLUMNNAME_Name); } @Override public void setSeqNo (int SeqNo) { set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); }
@Override public int getSeqNo() { return get_ValueAsInt(COLUMNNAME_SeqNo); } @Override public void setValue (java.lang.String Value) { set_Value (COLUMNNAME_Value, Value); } @Override public java.lang.String getValue() { return (java.lang.String)get_Value(COLUMNNAME_Value); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\fresh\model\X_M_CommodityNumber.java
1
请完成以下Java代码
public int getAD_DesktopWorkbench_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_AD_DesktopWorkbench_ID); if (ii == null) return 0; return ii.intValue(); } public I_AD_Workbench getAD_Workbench() throws RuntimeException { return (I_AD_Workbench)MTable.get(getCtx(), I_AD_Workbench.Table_Name) .getPO(getAD_Workbench_ID(), get_TrxName()); } /** Set Workbench. @param AD_Workbench_ID Collection of windows, reports */ public void setAD_Workbench_ID (int AD_Workbench_ID) { if (AD_Workbench_ID < 1) set_Value (COLUMNNAME_AD_Workbench_ID, null); else set_Value (COLUMNNAME_AD_Workbench_ID, Integer.valueOf(AD_Workbench_ID)); } /** Get Workbench. @return Collection of windows, reports */ public int getAD_Workbench_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_AD_Workbench_ID); if (ii == null) return 0; return ii.intValue(); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() {
return new KeyNamePair(get_ID(), String.valueOf(getAD_Workbench_ID())); } /** 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. @return Method of ordering records; lowest number comes first */ public int getSeqNo () { Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo); if (ii == null) return 0; return ii.intValue(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_DesktopWorkbench.java
1
请完成以下Java代码
public Object getPersistentState() { Map<String, Object> persistentState = new HashMap<String, Object>(); persistentState.put("name", name); persistentState.put("type", type); return persistentState; } public int getRevisionNext() { return revision+1; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getType() { return type;
} public void setType(String type) { this.type = type; } public int getRevision() { return revision; } public void setRevision(int revision) { this.revision = revision; } @Override public String toString() { return this.getClass().getSimpleName() + "[id=" + id + ", revision=" + revision + ", name=" + name + ", type=" + type + "]"; } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\GroupEntity.java
1
请完成以下Java代码
public ITableCacheConfigBuilder setTemplate(final ITableCacheConfig template) { this.template = template; return this; } @Override public ITableCacheConfigBuilder setEnabled(final boolean enabled) { this.enabled = enabled; return this; } public boolean isEnabled() { if (enabled != null) { return enabled; } if (template != null) { return template.isEnabled(); } throw new IllegalStateException("Cannot get IsEnabled"); } @Override public ITableCacheConfigBuilder setTrxLevel(final TrxLevel trxLevel) { this.trxLevel = trxLevel; return this; } public TrxLevel getTrxLevel() { if (trxLevel != null) { return trxLevel; } if (template != null) { return template.getTrxLevel(); } throw new IllegalStateException("Cannot get TrxLevel"); } @Override public ITableCacheConfigBuilder setCacheMapType(final CacheMapType cacheMapType) { this.cacheMapType = cacheMapType; return this; } public CacheMapType getCacheMapType() { if (cacheMapType != null) { return cacheMapType; } if (template != null) { return template.getCacheMapType(); } throw new IllegalStateException("Cannot get CacheMapType"); } public int getInitialCapacity() { if (initialCapacity > 0) { return initialCapacity; } else if (template != null) { return template.getInitialCapacity(); } throw new IllegalStateException("Cannot get InitialCapacity"); } @Override public ITableCacheConfigBuilder setInitialCapacity(final int initialCapacity) { this.initialCapacity = initialCapacity; return this;
} public int getMaxCapacity() { if (maxCapacity > 0) { return maxCapacity; } else if (template != null) { return template.getMaxCapacity(); } return -1; } @Override public ITableCacheConfigBuilder setMaxCapacity(final int maxCapacity) { this.maxCapacity = maxCapacity; return this; } public int getExpireMinutes() { if (expireMinutes > 0 || expireMinutes == ITableCacheConfig.EXPIREMINUTES_Never) { return expireMinutes; } else if (template != null) { return template.getExpireMinutes(); } throw new IllegalStateException("Cannot get ExpireMinutes"); } @Override public ITableCacheConfigBuilder setExpireMinutes(final int expireMinutes) { this.expireMinutes = expireMinutes; return this; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\model\impl\TableCacheConfigBuilder.java
1
请在Spring Boot框架中完成以下Java代码
public String getCaseDefinitionId() { return caseDefinitionId; } public void setCaseDefinitionId(String caseDefinitionId) { this.caseDefinitionId = caseDefinitionId; } @ApiModelProperty(example = "http://localhost:8182/cmmn-repository/case-definitions/timerCase%3A1%3A4") public String getCaseDefinitionUrl() { return caseDefinitionUrl; } public void setCaseDefinitionUrl(String caseDefinitionUrl) { this.caseDefinitionUrl = caseDefinitionUrl; } @ApiModelProperty(example = "7") public String getPlanItemInstanceId() { return planItemInstanceId; } public void setPlanItemInstanceId(String planItemInstanceId) { this.planItemInstanceId = planItemInstanceId; } @ApiModelProperty(example = "scriptTask1") public String getElementId() { return elementId; } public void setElementId(String elementId) { this.elementId = elementId; } @ApiModelProperty(example = "Script task") public String getElementName() { return elementName; } public void setElementName(String elementName) { this.elementName = elementName; } public void setHandlerType(String handlerType) { this.handlerType = handlerType; } @ApiModelProperty(example = "cmmn-trigger-timer") public String getHandlerType() { return handlerType; } @ApiModelProperty(example = "3") public Integer getRetries() { return retries; } public void setRetries(Integer retries) { this.retries = retries; } @ApiModelProperty(example = "null") public String getExceptionMessage() { return exceptionMessage; } public void setExceptionMessage(String exceptionMessage) {
this.exceptionMessage = exceptionMessage; } @ApiModelProperty(example = "2023-06-04T22:05:05.474+0000") public Date getDueDate() { return dueDate; } public void setDueDate(Date dueDate) { this.dueDate = dueDate; } @ApiModelProperty(example = "2023-06-03T22:05:05.474+0000") public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } @ApiModelProperty(example = "node1") public String getLockOwner() { return lockOwner; } public void setLockOwner(String lockOwner) { this.lockOwner = lockOwner; } @ApiModelProperty(example = "2023-06-03T22:05:05.474+0000") public Date getLockExpirationTime() { return lockExpirationTime; } public void setLockExpirationTime(Date lockExpirationTime) { this.lockExpirationTime = lockExpirationTime; } public void setTenantId(String tenantId) { this.tenantId = tenantId; } @ApiModelProperty(example = "null") public String getTenantId() { return tenantId; } }
repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\management\JobResponse.java
2
请在Spring Boot框架中完成以下Java代码
public class UserRouter { @Bean public RouterFunction<ServerResponse> userListRouterFunction() { return RouterFunctions.route(RequestPredicates.GET("/users2/list"), new HandlerFunction<ServerResponse>() { @Override public Mono<ServerResponse> handle(ServerRequest request) { // 查询列表 List<UserVO> result = new ArrayList<>(); result.add(new UserVO().setId(1).setUsername("yudaoyuanma")); result.add(new UserVO().setId(2).setUsername("woshiyutou")); result.add(new UserVO().setId(3).setUsername("chifanshuijiao")); // 返回列表 return ServerResponse.ok().bodyValue(result); } }); } @Bean public RouterFunction<ServerResponse> userGetRouterFunction() { return RouterFunctions.route(RequestPredicates.GET("/users2/get"), new HandlerFunction<ServerResponse>() {
@Override public Mono<ServerResponse> handle(ServerRequest request) { // 获得编号 Integer id = request.queryParam("id") .map(s -> StringUtils.isEmpty(s) ? null : Integer.valueOf(s)).get(); // 查询用户 UserVO user = new UserVO().setId(id).setUsername(UUID.randomUUID().toString()); // 返回列表 return ServerResponse.ok().bodyValue(user); } }); } @Bean public RouterFunction<ServerResponse> demoRouterFunction() { return route(GET("/users2/demo"), request -> ok().bodyValue("demo")); } }
repos\SpringBoot-Labs-master\lab-27\lab-27-webflux-01\src\main\java\cn\iocoder\springboot\lab27\springwebflux\controller\UserRouter.java
2
请在Spring Boot框架中完成以下Java代码
public class UserController { @Autowired private User1Mapper user1Mapper; @Autowired private User2Mapper user2Mapper; @RequestMapping("/getUsers") public List<User> getUsers() { List<User> users=user1Mapper.getAll(); return users; } @RequestMapping("/getUser") public User getUser(Long id) { User user=user2Mapper.getOne(id); return user; }
@RequestMapping("/add") public void save(User user) { user2Mapper.insert(user); } @RequestMapping(value="update") public void update(User user) { user2Mapper.update(user); } @RequestMapping(value="/delete/{id}") public void delete(@PathVariable("id") Long id) { user1Mapper.delete(id); } }
repos\spring-boot-leaning-master\2.x_42_courses\第 3-2 课: 如何优雅的使用 MyBatis XML 配置版\spring-boot-multi-mybatis-xml\src\main\java\com\neo\web\UserController.java
2
请在Spring Boot框架中完成以下Java代码
public UserDetailsBuilder accountExpired(boolean accountExpired) { this.user.accountExpired(accountExpired); return this; } /** * Defines if the account is locked or not. Default is false. * @param accountLocked true if the account is locked, false otherwise * @return the {@link UserDetailsBuilder} for method chaining (i.e. to populate * additional attributes for this user) */ public UserDetailsBuilder accountLocked(boolean accountLocked) { this.user.accountLocked(accountLocked); return this; } /** * Defines if the credentials are expired or not. Default is false. * @param credentialsExpired true if the credentials are expired, false otherwise * @return the {@link UserDetailsBuilder} for method chaining (i.e. to populate * additional attributes for this user) */
public UserDetailsBuilder credentialsExpired(boolean credentialsExpired) { this.user.credentialsExpired(credentialsExpired); return this; } /** * Defines if the account is disabled or not. Default is false. * @param disabled true if the account is disabled, false otherwise * @return the {@link UserDetailsBuilder} for method chaining (i.e. to populate * additional attributes for this user) */ public UserDetailsBuilder disabled(boolean disabled) { this.user.disabled(disabled); return this; } UserDetails build() { return this.user.build(); } } }
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\authentication\configurers\provisioning\UserDetailsManagerConfigurer.java
2
请完成以下Java代码
public String getName() { return name; } public void setName(String name) { this.name = name; } public String getTenantId() { return tenantId; } public void setTenantId(String tenantId) { this.tenantId = tenantId; } public String getProcessEngineName() { return processEngineName; }
public void setProcessEngineName(String processEngineName) { this.processEngineName = processEngineName; } public List<String> getProcessResourceNames() { return processResourceNames; } public void setProcessResourceNames(List<String> processResourceNames) { this.processResourceNames = processResourceNames; } public Map<String, String> getProperties() { return properties; } public void setProperties(Map<String, String> properties) { this.properties = properties; } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\application\impl\metadata\ProcessArchiveXmlImpl.java
1
请完成以下Java代码
public String getMimeType() { return mimeType; } /** * Sets the value of the mimeType property. * * @param value * allowed object is * {@link String } * */ public void setMimeType(String value) { this.mimeType = value; } /** * Gets the value of the viewer property. * * @return * possible object is * {@link String } * */ public String getViewer() {
return viewer; } /** * Sets the value of the viewer property. * * @param value * allowed object is * {@link String } * */ public void setViewer(String value) { this.viewer = value; } }
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\DocumentType.java
1
请完成以下Java代码
public int getAD_Relation_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_AD_Relation_ID); if (ii == null) return 0; return ii.intValue(); } public org.compiere.model.I_AD_RelationType getAD_RelationType() throws RuntimeException { return (org.compiere.model.I_AD_RelationType)MTable.get(getCtx(), org.compiere.model.I_AD_RelationType.Table_Name) .getPO(getAD_RelationType_ID(), get_TrxName()); } /** Set Relation Type. @param AD_RelationType_ID Relation Type */ public void setAD_RelationType_ID (int AD_RelationType_ID) { if (AD_RelationType_ID < 1) set_ValueNoCheck (COLUMNNAME_AD_RelationType_ID, null); else set_ValueNoCheck (COLUMNNAME_AD_RelationType_ID, Integer.valueOf(AD_RelationType_ID)); } /** Get Relation Type. @return Relation Type */ public int getAD_RelationType_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_AD_RelationType_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Beschreibung. @param Description Optional short description of the record */ public void setDescription (String Description) { set_Value (COLUMNNAME_Description, Description); } /** Get Beschreibung. @return Optional short description of the record */ public String getDescription () { return (String)get_Value(COLUMNNAME_Description); } /** Set Quell-Datensatz-ID. @param Record_Source_ID Quell-Datensatz-ID */ public void setRecord_Source_ID (int Record_Source_ID) { if (Record_Source_ID < 1) set_Value (COLUMNNAME_Record_Source_ID, null); else set_Value (COLUMNNAME_Record_Source_ID, Integer.valueOf(Record_Source_ID)); } /** Get Quell-Datensatz-ID. @return Quell-Datensatz-ID */ public int getRecord_Source_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_Record_Source_ID); if (ii == null) return 0; return ii.intValue();
} /** Set Ziel-Datensatz-ID. @param Record_Target_ID Ziel-Datensatz-ID */ public void setRecord_Target_ID (int Record_Target_ID) { if (Record_Target_ID < 1) set_Value (COLUMNNAME_Record_Target_ID, null); else set_Value (COLUMNNAME_Record_Target_ID, Integer.valueOf(Record_Target_ID)); } /** Get Ziel-Datensatz-ID. @return Ziel-Datensatz-ID */ public int getRecord_Target_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_Record_Target_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Reihenfolge. @param SeqNo Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst */ public void setSeqNo (int SeqNo) { set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); } /** Get Reihenfolge. @return Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst */ public int getSeqNo () { Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo); if (ii == null) return 0; return ii.intValue(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Relation.java
1
请完成以下Java代码
public void setMostRecentTriggerTimestamp (final java.sql.Timestamp MostRecentTriggerTimestamp) { set_Value (COLUMNNAME_MostRecentTriggerTimestamp, MostRecentTriggerTimestamp); } @Override public java.sql.Timestamp getMostRecentTriggerTimestamp() { return get_ValueAsTimestamp(COLUMNNAME_MostRecentTriggerTimestamp); } @Override public void setM_Product_Order_ID (final int M_Product_Order_ID) { if (M_Product_Order_ID < 1) set_Value (COLUMNNAME_M_Product_Order_ID, null); else set_Value (COLUMNNAME_M_Product_Order_ID, M_Product_Order_ID); } @Override public int getM_Product_Order_ID() { return get_ValueAsInt(COLUMNNAME_M_Product_Order_ID); } @Override public void setPointsBase_Forecasted (final BigDecimal PointsBase_Forecasted) { set_Value (COLUMNNAME_PointsBase_Forecasted, PointsBase_Forecasted); } @Override public BigDecimal getPointsBase_Forecasted() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_PointsBase_Forecasted); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setPointsBase_Invoiceable (final BigDecimal PointsBase_Invoiceable) { set_Value (COLUMNNAME_PointsBase_Invoiceable, PointsBase_Invoiceable); } @Override public BigDecimal getPointsBase_Invoiceable() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_PointsBase_Invoiceable); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setPointsBase_Invoiced (final BigDecimal PointsBase_Invoiced) { set_Value (COLUMNNAME_PointsBase_Invoiced, PointsBase_Invoiced); } @Override
public BigDecimal getPointsBase_Invoiced() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_PointsBase_Invoiced); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setPOReference (final @Nullable java.lang.String POReference) { set_Value (COLUMNNAME_POReference, POReference); } @Override public java.lang.String getPOReference() { return get_ValueAsString(COLUMNNAME_POReference); } @Override public void setQty (final BigDecimal Qty) { set_Value (COLUMNNAME_Qty, Qty); } @Override public BigDecimal getQty() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty); return bd != null ? bd : BigDecimal.ZERO; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\commission\model\X_C_Commission_Instance.java
1
请完成以下Java代码
public String getExpressionString() { return EXPRESSION_STRING; } @Override public String getFormatedExpressionString() { return EXPRESSION_STRING; } @Override public Set<CtxName> getParameters() { return ImmutableSet.of(); } @Override public Date evaluate(final Evaluatee ctx, final OnVariableNotFound onVariableNotFound) throws ExpressionEvaluationException
{ return de.metas.common.util.time.SystemTime.asDate(); } @Override public boolean isNoResult(final Object result) { return result == null; } @Override public boolean isNullExpression() { return false; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\impl\SysDateDateExpression.java
1
请完成以下Java代码
private void runURLRequest(String cache, String ID) { String thisURL = null; for(int i=0; i<cacheURLs.length; i++) { try { thisURL = "http://" + cacheURLs[i] + "/cache/Service?Cache=" + cache + "&ID=" + ID; URL url = new URL(thisURL); Proxy thisProxy = Proxy.NO_PROXY; URLConnection urlConn = url.openConnection(thisProxy); urlConn.setUseCaches(false); urlConn.connect(); Reader stream = new java.io.InputStreamReader( urlConn.getInputStream()); StringBuffer srvOutput = new StringBuffer(); try { int c; while ( (c=stream.read()) != -1 ) srvOutput.append( (char)c ); } catch (Exception E2) { E2.printStackTrace(); } } catch (IOException E) { if (log!=null) log.warn("Can't clean cache at:" + thisURL + " be carefull, your deployment server may use invalid or old cache data!"); } } } /**
* Converts JNP URL to http URL for cache cleanup * @param JNPURL String with JNP URL from Context * @return clean servername */ public static String convertJNPURLToCacheURL(String JNPURL) { if (JNPURL.indexOf("jnp://")>=0) { JNPURL = JNPURL.substring(JNPURL.indexOf("jnp://")+6); } if (JNPURL.indexOf(':')>=0) { JNPURL = JNPURL.substring(0,JNPURL.indexOf(':')); } if (JNPURL.length()>0) { return JNPURL; } else { return null; } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\cm\CacheHandler.java
1
请完成以下Java代码
public void setMSV3_Typ (java.lang.String MSV3_Typ) { set_Value (COLUMNNAME_MSV3_Typ, MSV3_Typ); } /** Get Typ. @return Typ */ @Override public java.lang.String getMSV3_Typ () { return (java.lang.String)get_Value(COLUMNNAME_MSV3_Typ); } /** Set MSV3_VerfuegbarkeitAnteil. @param MSV3_VerfuegbarkeitAnteil_ID MSV3_VerfuegbarkeitAnteil */ @Override public void setMSV3_VerfuegbarkeitAnteil_ID (int MSV3_VerfuegbarkeitAnteil_ID) { if (MSV3_VerfuegbarkeitAnteil_ID < 1) set_ValueNoCheck (COLUMNNAME_MSV3_VerfuegbarkeitAnteil_ID, null); else set_ValueNoCheck (COLUMNNAME_MSV3_VerfuegbarkeitAnteil_ID, Integer.valueOf(MSV3_VerfuegbarkeitAnteil_ID)); } /** Get MSV3_VerfuegbarkeitAnteil. @return MSV3_VerfuegbarkeitAnteil */ @Override public int getMSV3_VerfuegbarkeitAnteil_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_MSV3_VerfuegbarkeitAnteil_ID); if (ii == null) return 0; return ii.intValue(); } @Override public de.metas.vertical.pharma.vendor.gateway.msv3.model.I_MSV3_VerfuegbarkeitsantwortArtikel getMSV3_VerfuegbarkeitsantwortArtikel() throws RuntimeException
{ return get_ValueAsPO(COLUMNNAME_MSV3_VerfuegbarkeitsantwortArtikel_ID, de.metas.vertical.pharma.vendor.gateway.msv3.model.I_MSV3_VerfuegbarkeitsantwortArtikel.class); } @Override public void setMSV3_VerfuegbarkeitsantwortArtikel(de.metas.vertical.pharma.vendor.gateway.msv3.model.I_MSV3_VerfuegbarkeitsantwortArtikel MSV3_VerfuegbarkeitsantwortArtikel) { set_ValueFromPO(COLUMNNAME_MSV3_VerfuegbarkeitsantwortArtikel_ID, de.metas.vertical.pharma.vendor.gateway.msv3.model.I_MSV3_VerfuegbarkeitsantwortArtikel.class, MSV3_VerfuegbarkeitsantwortArtikel); } /** Set VerfuegbarkeitsantwortArtikel. @param MSV3_VerfuegbarkeitsantwortArtikel_ID VerfuegbarkeitsantwortArtikel */ @Override public void setMSV3_VerfuegbarkeitsantwortArtikel_ID (int MSV3_VerfuegbarkeitsantwortArtikel_ID) { if (MSV3_VerfuegbarkeitsantwortArtikel_ID < 1) set_ValueNoCheck (COLUMNNAME_MSV3_VerfuegbarkeitsantwortArtikel_ID, null); else set_ValueNoCheck (COLUMNNAME_MSV3_VerfuegbarkeitsantwortArtikel_ID, Integer.valueOf(MSV3_VerfuegbarkeitsantwortArtikel_ID)); } /** Get VerfuegbarkeitsantwortArtikel. @return VerfuegbarkeitsantwortArtikel */ @Override public int getMSV3_VerfuegbarkeitsantwortArtikel_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_MSV3_VerfuegbarkeitsantwortArtikel_ID); if (ii == null) return 0; return ii.intValue(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.vendor.gateway.msv3\src\main\java-gen\de\metas\vertical\pharma\vendor\gateway\msv3\model\X_MSV3_VerfuegbarkeitAnteil.java
1
请完成以下Java代码
public void voidIt() { getActivities().forEach(PPOrderRoutingActivity::voidIt); } public void reportProgress(final PPOrderActivityProcessReport report) { getActivityById(report.getActivityId()).reportProgress(report); } public void completeActivity(final PPOrderRoutingActivityId activityId) { getActivityById(activityId).completeIt(); } public void closeActivity(final PPOrderRoutingActivityId activityId) { getActivityById(activityId).closeIt(); } public void uncloseActivity(final PPOrderRoutingActivityId activityId)
{ getActivityById(activityId).uncloseIt(); } @NonNull public RawMaterialsIssueStrategy getIssueStrategyForRawMaterialsActivity() { return activities.stream() .filter(activity -> activity.getType() == PPRoutingActivityType.RawMaterialsIssue) .findFirst() .map(PPOrderRoutingActivity::getRawMaterialsIssueStrategy) .orElse(RawMaterialsIssueStrategy.DEFAULT); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\api\PPOrderRouting.java
1
请完成以下Java代码
public boolean isVirtualColumn(final String columnName) { return getPOInfo().isVirtualColumn(columnName); } @Override public boolean isKeyColumnName(final String columnName) { return getPOInfo().isKey(columnName); } @Override public Object getValue(final String propertyName, final int idx, final Class<?> returnType) { return po.get_Value(idx); } @Override public Object getValue(final String propertyName, final Class<?> returnType) { return po.get_Value(propertyName); } @Override public boolean setValue(final String columnName, final Object value) { final Object valueToSet = POWrapper.checkZeroIdValue(columnName, value); final POInfo poInfo = po.getPOInfo(); if (!poInfo.isColumnUpdateable(columnName)) { // If the column is not updateable we need to use set_ValueNoCheck // because else is not consistent with how the generated classes were created // see org.adempiere.util.ModelClassGenerator.createColumnMethods return po.set_ValueNoCheck(columnName, valueToSet); } else { return po.set_ValueOfColumn(columnName, valueToSet); } } @Override public boolean setValueNoCheck(String propertyName, Object value) { return po.set_ValueOfColumn(propertyName, value); } @Override public Object getReferencedObject(final String propertyName, final Method interfaceMethod) throws Exception { final Class<?> returnType = interfaceMethod.getReturnType(); return po.get_ValueAsPO(propertyName, returnType); } @Override public void setValueFromPO(final String idPropertyName, final Class<?> parameterType, final Object value) { po.set_ValueFromPO(idPropertyName, parameterType, value); }
@Override public boolean invokeEquals(final Object[] methodArgs) { if (methodArgs == null || methodArgs.length != 1) { throw new IllegalArgumentException("Invalid method arguments to be used for equals(): " + methodArgs); } return po.equals(methodArgs[0]); } @Override public Object invokeParent(final Method method, final Object[] methodArgs) throws Exception { return method.invoke(po, methodArgs); } @Override public boolean isCalculated(final String columnName) { return getPOInfo().isCalculated(columnName); } @Override public boolean hasColumnName(final String columnName) { return getPOInfo().hasColumnName(columnName); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\wrapper\POModelInternalAccessor.java
1
请完成以下Java代码
protected static boolean similar(float[] A, float[] B) { final float eta = 1e-2f; for (int i = 0; i < A.length; i++) if (Math.abs(A[i] - B[i]) > eta) return false; return true; } protected static Object deepCopy(Object object) { if (object == null) { return null; } try { ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject(object); oos.flush(); oos.close(); bos.close(); byte[] byteData = bos.toByteArray(); ByteArrayInputStream bais = new ByteArrayInputStream(byteData); return new ObjectInputStream(bais).readObject(); } catch (Exception e) { throw new RuntimeException(e); } } }
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\hmm\HiddenMarkovModel.java
1
请完成以下Java代码
public static void registerType(ModelBuilder modelBuilder) { ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(DecisionTable.class, DMN_ELEMENT_DECISION_TABLE) .namespaceUri(LATEST_DMN_NS) .extendsType(Expression.class) .instanceProvider(new ModelTypeInstanceProvider<DecisionTable>() { public DecisionTable newInstance(ModelTypeInstanceContext instanceContext) { return new DecisionTableImpl(instanceContext); } }); hitPolicyAttribute = typeBuilder.namedEnumAttribute(DMN_ATTRIBUTE_HIT_POLICY, HitPolicy.class) .defaultValue(HitPolicy.UNIQUE) .build(); aggregationAttribute = typeBuilder.enumAttribute(DMN_ATTRIBUTE_AGGREGATION, BuiltinAggregator.class) .build(); preferredOrientationAttribute = typeBuilder.namedEnumAttribute(DMN_ATTRIBUTE_PREFERRED_ORIENTATION, DecisionTableOrientation.class) .defaultValue(DecisionTableOrientation.Rule_as_Row) .build();
outputLabelAttribute = typeBuilder.stringAttribute(DMN_ATTRIBUTE_OUTPUT_LABEL) .build(); SequenceBuilder sequenceBuilder = typeBuilder.sequence(); inputCollection = sequenceBuilder.elementCollection(Input.class) .build(); outputCollection = sequenceBuilder.elementCollection(Output.class) .required() .build(); ruleCollection = sequenceBuilder.elementCollection(Rule.class) .build(); typeBuilder.build(); } }
repos\camunda-bpm-platform-master\model-api\dmn-model\src\main\java\org\camunda\bpm\model\dmn\impl\instance\DecisionTableImpl.java
1
请完成以下Java代码
public class AbstractEntityFields implements EntityFields { private UUID id; private long createdTime; private UUID tenantId; private UUID customerId; private String name; private Long version; public AbstractEntityFields(UUID id, long createdTime, UUID tenantId, UUID customerId, String name, Long version) { this.id = id; this.createdTime = createdTime; this.tenantId = tenantId; this.customerId = checkId(customerId); this.name = name; this.version = version; } public AbstractEntityFields() { } public AbstractEntityFields(UUID id, long createdTime, UUID tenantId, String name, Long version) { this(id, createdTime, tenantId, null, name, version); } public AbstractEntityFields(UUID id, long createdTime, UUID tenantId, UUID customerId, Long version) { this(id, createdTime, tenantId, customerId, null, version); } public AbstractEntityFields(UUID id, long createdTime, String name, Long version) {
this(id, createdTime, null, name, version); } public AbstractEntityFields(UUID id, long createdTime, UUID tenantId) { this(id, createdTime, tenantId, null, null, null); } protected UUID checkId(UUID id) { return id == null || id.equals(EntityId.NULL_UUID) ? null : id; } @Override public UUID getCustomerId() { return checkId(customerId); } }
repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\edqs\fields\AbstractEntityFields.java
1
请完成以下Java代码
protected Transformer getFormattingTransformer() { try { Transformer transformer = formattingTemplates.newTransformer(); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); return transformer; } catch (TransformerConfigurationException e) { throw LOG.unableToCreateTransformer(e); } } /** * Returns a configured transformer to write XML as is. *
* @return the XML configured transformer * @throws SpinXmlElementException if no new transformer can be created */ protected Transformer getTransformer() { TransformerFactory transformerFactory = domXmlDataFormat.getTransformerFactory(); try { Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); return transformer; } catch (TransformerConfigurationException e) { throw LOG.unableToCreateTransformer(e); } } }
repos\camunda-bpm-platform-master\spin\dataformat-xml-dom\src\main\java\org\camunda\spin\impl\xml\dom\format\DomXmlDataFormatWriter.java
1
请完成以下Java代码
public ImmutableSet<LocatorId> getLocatorIds(@NonNull final Collection<HuId> huIds) { final List<I_M_HU> hus = handlingUnitsRepo.getByIds(huIds); final ImmutableSet<Integer> locatorIds = hus .stream() .map(I_M_HU::getM_Locator_ID) .filter(locatorId -> locatorId > 0) .collect(ImmutableSet.toImmutableSet()); return warehouseBL.getLocatorIdsByRepoId(locatorIds); } @Override public Optional<HuId> getHUIdByValueOrExternalBarcode(@NonNull final ScannedCode scannedCode) { return Optionals.firstPresentOfSuppliers( () -> getHUIdByValue(scannedCode.getAsString()), () -> getByExternalBarcode(scannedCode) ); } private Optional<HuId> getHUIdByValue(final String value) { final HuId huId = HuId.ofHUValueOrNull(value);
return huId != null && existsById(huId) ? Optional.of(huId) : Optional.empty(); } private Optional<HuId> getByExternalBarcode(@NonNull final ScannedCode scannedCode) { return handlingUnitsRepo.createHUQueryBuilder() .setOnlyActiveHUs(true) .setOnlyTopLevelHUs() .addOnlyWithAttribute(AttributeConstants.ATTR_ExternalBarcode, scannedCode.getAsString()) .firstIdOnly(); } @Override public Set<HuPackingMaterialId> getHUPackingMaterialIds(@NonNull final HuId huId) { return handlingUnitsRepo.retrieveAllItemsNoCache(Collections.singleton(huId)) .stream() .map(item -> HuPackingMaterialId.ofRepoIdOrNull(item.getM_HU_PackingMaterial_ID())) .filter(Objects::nonNull) .collect(Collectors.toSet()); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\HandlingUnitsBL.java
1
请在Spring Boot框架中完成以下Java代码
public void updateEntities(I id) { updated = 0; PageLink pageLink = new PageLink(DEFAULT_LIMIT); boolean hasNext = true; while (hasNext) { PageData<D> entities = findEntities(id, pageLink); for (D entity : entities.getData()) { updateEntity(entity); } updated += entities.getData().size(); hasNext = entities.hasNext(); if (hasNext) { log.info("{}: {} entities updated so far...", getName(), updated); pageLink = pageLink.nextPageLink(); } else { if (updated > DEFAULT_LIMIT || forceReportTotal()) { log.info("{}: {} total entities updated.", getName(), updated); } } } }
public void updateEntities() { updateEntities(null); } protected boolean forceReportTotal() { return false; } protected abstract String getName(); protected abstract PageData<D> findEntities(I id, PageLink pageLink); protected abstract void updateEntity(D entity); }
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\install\update\PaginatedUpdater.java
2
请完成以下Java代码
public Quantity getQtyScheduledForPicking(@NonNull final de.metas.inoutcandidate.model.I_M_ShipmentSchedule shipmentScheduleRecord) { return shipmentScheduleBL.getQtyScheduledForPicking(shipmentScheduleRecord); } @Override public Quantity getQtyRemainingToScheduleForPicking(@NonNull final de.metas.inoutcandidate.model.I_M_ShipmentSchedule shipmentScheduleRecord) { return shipmentScheduleBL.getQtyRemainingToScheduleForPicking(shipmentScheduleRecord); } @Override public void flagForRecompute(@NonNull final Set<ShipmentScheduleId> shipmentScheduleIds) { if (shipmentScheduleIds.isEmpty()) {return;} final IShipmentScheduleInvalidateBL invalidSchedulesService = Services.get(IShipmentScheduleInvalidateBL.class); invalidSchedulesService.flagForRecompute(shipmentScheduleIds); } @Override public ShipmentScheduleLoadingCache<I_M_ShipmentSchedule> newLoadingCache() { return shipmentScheduleBL.newLoadingCache(I_M_ShipmentSchedule.class); }
@Nullable @Override public ProjectId extractSingleProjectIdOrNull(@NonNull final List<ShipmentScheduleWithHU> candidates) { final Set<ProjectId> projectIdsFromShipmentSchedules = candidates.stream() .map(ShipmentScheduleWithHU::getProjectId) .filter(Objects::nonNull) .collect(Collectors.toSet()); if (projectIdsFromShipmentSchedules.size() == 1) { return projectIdsFromShipmentSchedules.iterator().next(); } return null; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\shipmentschedule\api\impl\HUShipmentScheduleBL.java
1
请在Spring Boot框架中完成以下Java代码
public Map<String, User> getUsers() { return usersCache; } public Mono<User> findByUserIdWithDefer(String id) { return fetchFromCache(id).switchIfEmpty(Mono.defer(() -> fetchFromFile(id))); } public Mono<User> findByUserIdWithoutDefer(String id) { return fetchFromCache(id).switchIfEmpty(fetchFromFile(id)); } private Mono<User> fetchFromCache(String id) { User user = usersCache.get(id); if (user != null) { LOG.info("Fetched user {} from cache", id); return Mono.just(user); } return Mono.empty(); } private Mono<User> fetchFromFile(String id) {
try { File file = new ClassPathResource("users.json").getFile(); String usersData = new String(Files.readAllBytes(file.toPath())); List<User> users = objectMapper.readValue(usersData, new TypeReference<List<User>>() { }); User user = users.stream() .filter(u -> u.getId() .equalsIgnoreCase(id)) .findFirst() .get(); usersCache.put(user.getId(), user); LOG.info("Fetched user {} from file", id); return Mono.just(user); } catch (IOException e) { return Mono.error(e); } } }
repos\tutorials-master\spring-reactive-modules\spring-reactive-4\src\main\java\com\baeldung\switchIfEmpty\service\UserService.java
2
请完成以下Java代码
public void init(final FilterConfig filterConfig) throws ServletException { } @Override public void destroy() { } @Override public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRequest = (HttpServletRequest)request; final AuthResolution authResolution = getAuthResolution(httpRequest); if (authResolution.isDoNotAuthenticate()) { chain.doFilter(request, response); } else { final HttpServletResponse httpResponse = (HttpServletResponse)response; try { userAuthTokenService.run( () -> extractTokenStringIfAvailable(httpRequest), authResolution, () -> { extractAdLanguage(httpRequest).ifPresent(Env::setAD_Language); chain.doFilter(httpRequest, httpResponse); }); } catch (final UserNotAuthorizedException ex) { httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, ex.getLocalizedMessage()); } } } private AuthResolution getAuthResolution(@NonNull final HttpServletRequest httpRequest) { // don't check auth for OPTIONS method calls because this causes troubles on chrome preflight checks if ("OPTIONS".equals(httpRequest.getMethod())) { return AuthResolution.DO_NOT_AUTHENTICATE; } return configuration.getAuthResolution(httpRequest).orElse(AuthResolution.AUTHENTICATION_REQUIRED); } @Nullable private static String extractTokenStringIfAvailable(final HttpServletRequest httpRequest) { // // Check Authorization header first { final String authorizationString = StringUtils.trimBlankToNull(httpRequest.getHeader(HEADER_Authorization));
if (authorizationString != null) { if (authorizationString.startsWith("Token ")) { return authorizationString.substring(5).trim(); } else if (authorizationString.startsWith("Basic ")) { final String userAndTokenString = new String(DatatypeConverter.parseBase64Binary(authorizationString.substring(5).trim())); final int index = userAndTokenString.indexOf(':'); return userAndTokenString.substring(index + 1); } else { return authorizationString; } } } // // Check apiKey query parameter { return StringUtils.trimBlankToNull(httpRequest.getParameter(QUERY_PARAM_API_KEY)); } } @VisibleForTesting Optional<String> extractAdLanguage(@NonNull final HttpServletRequest httpRequest) { final String acceptLanguageHeader = StringUtils.trimBlankToNull(httpRequest.getHeader(HEADER_AcceptLanguage)); final ADLanguageList availableLanguages = languageDAO.retrieveAvailableLanguages(); final String adLanguage = availableLanguages.getAD_LanguageFromHttpAcceptLanguage(acceptLanguageHeader, availableLanguages.getBaseADLanguage()); return Optional.ofNullable(adLanguage); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.util.web\src\main\java\de\metas\util\web\security\UserAuthTokenFilter.java
1
请完成以下Java代码
private synchronized void addRow(final ProductsProposalRow row) { rowIdsOrderedAndFiltered.add(0, row.getId()); // add first rowIdsOrdered.add(0, row.getId()); // add first rowsById.put(row.getId(), row); } public synchronized void removeRowsByIds(@NonNull final Set<DocumentId> rowIds) { rowIdsOrderedAndFiltered.removeAll(rowIds); rowIdsOrdered.removeAll(rowIds); rowIds.forEach(rowsById::remove); } public synchronized ProductsProposalViewFilter getFilter() { return filter; }
public synchronized void filter(@NonNull final ProductsProposalViewFilter filter) { if (Objects.equals(this.filter, filter)) { return; } this.filter = filter; rowIdsOrderedAndFiltered = rowIdsOrdered .stream() .filter(rowId -> rowsById.get(rowId).isMatching(filter)) .collect(Collectors.toCollection(ArrayList::new)); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\products_proposal\model\ProductsProposalRowsData.java
1
请完成以下Java代码
public void repackage(File destination, Libraries libraries, @Nullable FileTime lastModifiedTime) throws IOException { Assert.isTrue(destination != null && !destination.isDirectory(), "Invalid destination"); getLayout(); // get layout early destination = destination.getAbsoluteFile(); File source = getSource(); if (isAlreadyPackaged() && source.equals(destination)) { return; } File workingSource = source; if (source.equals(destination)) { workingSource = getBackupFile(); workingSource.delete(); renameFile(source, workingSource); } destination.delete(); try { try (JarFile sourceJar = new JarFile(workingSource)) { repackage(sourceJar, destination, libraries, lastModifiedTime); } } finally { if (!this.backupSource && !source.equals(workingSource)) { deleteFile(workingSource); } } } private void repackage(JarFile sourceJar, File destination, Libraries libraries, @Nullable FileTime lastModifiedTime) throws IOException {
try (JarWriter writer = new JarWriter(destination, lastModifiedTime)) { write(sourceJar, libraries, writer, lastModifiedTime != null); } if (lastModifiedTime != null) { destination.setLastModified(lastModifiedTime.toMillis()); } } private void renameFile(File file, File dest) { if (!file.renameTo(dest)) { throw new IllegalStateException("Unable to rename '" + file + "' to '" + dest + "'"); } } private void deleteFile(File file) { if (!file.delete()) { throw new IllegalStateException("Unable to delete '" + file + "'"); } } }
repos\spring-boot-4.0.1\loader\spring-boot-loader-tools\src\main\java\org\springframework\boot\loader\tools\Repackager.java
1
请在Spring Boot框架中完成以下Java代码
public void initEntityManagers() { if (eventSubscriptionEntityManager == null) { eventSubscriptionEntityManager = new EventSubscriptionEntityManagerImpl(this, eventSubscriptionDataManager); } } // getters and setters // ////////////////////////////////////////////////////// public EventSubscriptionServiceConfiguration getIdentityLinkServiceConfiguration() { return this; } public EventSubscriptionService getEventSubscriptionService() { return eventSubscriptionService; } public EventSubscriptionServiceConfiguration setEventSubscriptionService(EventSubscriptionService eventSubscriptionService) { this.eventSubscriptionService = eventSubscriptionService; return this; } public EventSubscriptionDataManager getEventSubscriptionDataManager() { return eventSubscriptionDataManager; } public EventSubscriptionServiceConfiguration setEventSubscriptionDataManager(EventSubscriptionDataManager eventSubscriptionDataManager) { this.eventSubscriptionDataManager = eventSubscriptionDataManager; return this; } public EventSubscriptionEntityManager getEventSubscriptionEntityManager() { return eventSubscriptionEntityManager; } public EventSubscriptionServiceConfiguration setEventSubscriptionEntityManager(EventSubscriptionEntityManager eventSubscriptionEntityManager) { this.eventSubscriptionEntityManager = eventSubscriptionEntityManager; return this; }
@Override public ObjectMapper getObjectMapper() { return objectMapper; } @Override public EventSubscriptionServiceConfiguration setObjectMapper(ObjectMapper objectMapper) { this.objectMapper = objectMapper; return this; } public Duration getEventSubscriptionLockTime() { return eventSubscriptionLockTime; } public EventSubscriptionServiceConfiguration setEventSubscriptionLockTime(Duration eventSubscriptionLockTime) { this.eventSubscriptionLockTime = eventSubscriptionLockTime; return this; } public String getLockOwner() { return lockOwner; } public EventSubscriptionServiceConfiguration setLockOwner(String lockOwner) { this.lockOwner = lockOwner; return this; } }
repos\flowable-engine-main\modules\flowable-eventsubscription-service\src\main\java\org\flowable\eventsubscription\service\EventSubscriptionServiceConfiguration.java
2
请完成以下Java代码
public void composeDecisionResults(final ELExecutionContext executionContext) { List<Map<String, Object>> ruleResults = new ArrayList<>(executionContext.getRuleResults().values()); // sort on predefined list(s) of output values ruleResults.sort(new Comparator<Object>() { boolean noOutputValuesPresent = true; @SuppressWarnings("unchecked") @Override public int compare(Object o1, Object o2) { CompareToBuilder compareToBuilder = new CompareToBuilder(); for (Map.Entry<String, List<Object>> entry : executionContext.getOutputValues().entrySet()) { List<Object> outputValues = entry.getValue(); if (outputValues != null && !outputValues.isEmpty()) { noOutputValuesPresent = false; compareToBuilder.append(((Map<String, Object>) o1).get(entry.getKey()), ((Map<String, Object>) o2).get(entry.getKey()), new OutputOrderComparator<>(outputValues.toArray(new Comparable[outputValues.size()]))); } } if (!noOutputValuesPresent) { return compareToBuilder.toComparison(); } else { if (CommandContextUtil.getDmnEngineConfiguration().isStrictMode()) {
throw new FlowableException(String.format("HitPolicy %s violated; no output values present.", getHitPolicyName())); } else { executionContext.getAuditContainer().setValidationMessage( String.format("HitPolicy %s violated; no output values present. Setting first valid result as final result.", getHitPolicyName())); } return 0; } } }); if (!ruleResults.isEmpty()) { executionContext.getAuditContainer().addDecisionResultObject(ruleResults.get(0)); } } }
repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\hitpolicy\HitPolicyPriority.java
1
请完成以下Java代码
public PublicKeyCredentialRequestOptionsBuilder rpId(String rpId) { this.rpId = rpId; return this; } /** * Sets the {@link #getAllowCredentials()} property * @param allowCredentials the allowed credentials * @return the {@link PublicKeyCredentialRequestOptionsBuilder} */ public PublicKeyCredentialRequestOptionsBuilder allowCredentials( List<PublicKeyCredentialDescriptor> allowCredentials) { Assert.notNull(allowCredentials, "allowCredentials cannot be null"); this.allowCredentials = allowCredentials; return this; } /** * Sets the {@link #getUserVerification()} property. * @param userVerification the user verification * @return the {@link PublicKeyCredentialRequestOptionsBuilder} */ public PublicKeyCredentialRequestOptionsBuilder userVerification(UserVerificationRequirement userVerification) { this.userVerification = userVerification; return this; } /** * Sets the {@link #getExtensions()} property * @param extensions the extensions * @return the {@link PublicKeyCredentialRequestOptionsBuilder} */ public PublicKeyCredentialRequestOptionsBuilder extensions(AuthenticationExtensionsClientInputs extensions) { this.extensions = extensions; return this; } /** * Allows customizing the {@link PublicKeyCredentialRequestOptionsBuilder}
* @param customizer the {@link Consumer} used to customize the builder * @return the {@link PublicKeyCredentialRequestOptionsBuilder} */ public PublicKeyCredentialRequestOptionsBuilder customize( Consumer<PublicKeyCredentialRequestOptionsBuilder> customizer) { customizer.accept(this); return this; } /** * Builds a new {@link PublicKeyCredentialRequestOptions} * @return a new {@link PublicKeyCredentialRequestOptions} */ public PublicKeyCredentialRequestOptions build() { if (this.challenge == null) { this.challenge = Bytes.random(); } return new PublicKeyCredentialRequestOptions(this.challenge, this.timeout, this.rpId, this.allowCredentials, this.userVerification, this.extensions); } } }
repos\spring-security-main\webauthn\src\main\java\org\springframework\security\web\webauthn\api\PublicKeyCredentialRequestOptions.java
1
请完成以下Java代码
public static List<String> splitCommaSeparatedList(String text) { if (text == null || text.isEmpty()) { return Collections.emptyList(); } Matcher matcher = pattern.matcher(text); List<String> parts = new ArrayList<String>(); while(matcher.find()) { parts.add(matcher.group().trim()); } return parts; } /** * Joins a list of Strings to a comma separated single String. * * @param list the list to join * @return the resulting comma separated string or null if the list is null */ public static String joinCommaSeparatedList(List<String> list) { return joinList(list, ", "); } public static List<String> splitListBySeparator(String text, String separator) { String[] result = new String[]{}; if (text != null) { result = text.split(separator); } return new ArrayList<String>(Arrays.asList(result)); } public static String joinList(List<String> list, String separator) { if (list == null) { return null; }
int size = list.size(); if (size == 0) { return ""; } else if (size == 1) { return list.get(0); } else { StringBuilder builder = new StringBuilder(size * 8); builder.append(list.get(0)); for (Object element : list.subList(1, size)) { builder.append(separator); builder.append(element); } return builder.toString(); } } }
repos\camunda-bpm-platform-master\model-api\xml-model\src\main\java\org\camunda\bpm\model\xml\impl\util\StringUtil.java
1
请完成以下Java代码
public static Optional<DocumentFilter> findExisting(@Nullable final DocumentFilterList filters) { return filters != null && !filters.isEmpty() ? filters.getFilterById(FILTER_ID) : Optional.empty(); } /** * @param huIds huIds may be empty, but not null. Empty means that <b>no</b> HU will be matched. */ public static DocumentFilter createFilter(@NonNull final Collection<HuId> huIds) { final HUIdsFilterData filterData = HUIdsFilterData.ofHUIds(huIds); return DocumentFilter.singleParameterFilter(FILTER_ID, FILTER_PARAM_Data, Operator.EQUAL, filterData); } public static DocumentFilter createFilter(@NonNull final IHUQueryBuilder huQuery) { final HUIdsFilterData filterData = HUIdsFilterData.ofHUQuery(huQuery); return DocumentFilter.singleParameterFilter(FILTER_ID, FILTER_PARAM_Data, Operator.EQUAL, filterData); } public static DocumentFilter createFilter(@NonNull final HUIdsFilterData filterData) { return DocumentFilter.singleParameterFilter(FILTER_ID, FILTER_PARAM_Data, Operator.EQUAL, filterData); } static HUIdsFilterData extractFilterData(@NonNull final DocumentFilter huIdsFilter) { if (isNotHUIdsFilter(huIdsFilter)) { throw new AdempiereException("Not an HUIds filter: " + huIdsFilter);
} final HUIdsFilterData huIdsFilterData = (HUIdsFilterData)huIdsFilter.getParameter(FILTER_PARAM_Data).getValue(); if (huIdsFilterData == null) { throw new AdempiereException("No " + HUIdsFilterData.class + " found for " + huIdsFilter); } return huIdsFilterData; } public static Optional<HUIdsFilterData> extractFilterData(@Nullable final DocumentFilterList filters) { return findExisting(filters).map(HUIdsFilterHelper::extractFilterData); } public static boolean isNotHUIdsFilter(final DocumentFilter filter) { return !FILTER_ID.equals(filter.getFilterId()); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\filter\HUIdsFilterHelper.java
1
请完成以下Java代码
public void createTask(TaskDto taskDto) { ProcessEngine engine = getProcessEngine(); TaskService taskService = engine.getTaskService(); Task newTask = taskService.newTask(taskDto.getId()); taskDto.updateTask(newTask); try { taskService.saveTask(newTask); } catch (NotValidException e) { throw new InvalidRequestException(Status.BAD_REQUEST, e, "Could not save task: " + e.getMessage()); } } @Override public TaskReportResource getTaskReportResource() { return new TaskReportResourceImpl(getProcessEngine()); } private List<TaskDto> getVariablesForTasks(ProcessEngine engine,
List<Task> matchingTasks, boolean withTaskVariablesInReturn, boolean withCommentAndAttachments) { TaskService taskService = engine.getTaskService(); List<TaskDto> tasks = new ArrayList<TaskDto>(); for (Task task : matchingTasks) { VariableMap taskVariables; if (withTaskVariablesInReturn) { taskVariables = taskService.getVariablesTyped(task.getId(), true); } else { taskVariables = taskService.getVariablesLocalTyped(task.getId(), true); } Map<String, VariableValueDto> taskVariablesDto = VariableValueDto.fromMap(taskVariables); if (withCommentAndAttachments) { tasks.add(TaskWithAttachmentAndCommentDto.fromEntity(task, taskVariablesDto)); } else { tasks.add(TaskWithVariablesDto.fromEntity(task, taskVariablesDto)); } } return tasks; } }
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\TaskRestServiceImpl.java
1
请完成以下Java代码
public void setIsManadatoryParams (boolean IsManadatoryParams) { set_Value (COLUMNNAME_IsManadatoryParams, Boolean.valueOf(IsManadatoryParams)); } /** Get Mandatory Parameters. @return Mandatory Parameters */ @Override public boolean isManadatoryParams () { Object oo = get_Value(COLUMNNAME_IsManadatoryParams); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Display All Parameters. @param IsShowAllParams Display All Parameters */ @Override public void setIsShowAllParams (boolean IsShowAllParams) { set_Value (COLUMNNAME_IsShowAllParams, Boolean.valueOf(IsShowAllParams)); } /** Get Display All Parameters. @return Display All Parameters */ @Override public boolean isShowAllParams () { Object oo = get_Value(COLUMNNAME_IsShowAllParams); if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Name. @param Name Alphanumeric identifier of the entity */ @Override public void setName (java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ @Override public java.lang.String getName () { return (java.lang.String)get_Value(COLUMNNAME_Name); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_UserQuery.java
1
请完成以下Java代码
public static Process getProcess(String processDefinitionId) { if (Context.getCommandContext() == null) { throw new FlowableException("Cannot get process model: no current command context is active"); } else if (CommandContextUtil.getProcessEngineConfiguration() == null) { return Flowable5Util.getFlowable5CompatibilityHandler().getProcessDefinitionProcessObject(processDefinitionId); } else { DeploymentManager deploymentManager = CommandContextUtil.getProcessEngineConfiguration().getDeploymentManager(); // This will check the cache in the findDeployedProcessDefinitionById and resolveProcessDefinition method ProcessDefinition processDefinitionEntity = deploymentManager.findDeployedProcessDefinitionById(processDefinitionId); return deploymentManager.resolveProcessDefinition(processDefinitionEntity).getProcess(); } } public static BpmnModel getBpmnModel(String processDefinitionId) { if (CommandContextUtil.getProcessEngineConfiguration() == null) { return Flowable5Util.getFlowable5CompatibilityHandler().getProcessDefinitionBpmnModel(processDefinitionId); } else { DeploymentManager deploymentManager = CommandContextUtil.getProcessEngineConfiguration().getDeploymentManager(); // This will check the cache in the findDeployedProcessDefinitionById and resolveProcessDefinition method ProcessDefinition processDefinitionEntity = deploymentManager.findDeployedProcessDefinitionById(processDefinitionId); return deploymentManager.resolveProcessDefinition(processDefinitionEntity).getBpmnModel(); } } public static BpmnModel getBpmnModelFromCache(String processDefinitionId) {
ProcessDefinitionCacheEntry cacheEntry = CommandContextUtil.getProcessEngineConfiguration().getProcessDefinitionCache().get(processDefinitionId); if (cacheEntry != null) { return cacheEntry.getBpmnModel(); } return null; } public static boolean isProcessDefinitionSuspended(String processDefinitionId) { ProcessDefinitionEntity processDefinition = getProcessDefinitionFromDatabase(processDefinitionId); return processDefinition.isSuspended(); } public static ProcessDefinitionEntity getProcessDefinitionFromDatabase(String processDefinitionId) { ProcessDefinitionEntityManager processDefinitionEntityManager = CommandContextUtil.getProcessEngineConfiguration().getProcessDefinitionEntityManager(); ProcessDefinitionEntity processDefinition = processDefinitionEntityManager.findById(processDefinitionId); if (processDefinition == null) { throw new FlowableObjectNotFoundException("No process definition found with id " + processDefinitionId); } return processDefinition; } }
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\util\ProcessDefinitionUtil.java
1
请完成以下Java代码
private boolean notify(final MADBoilerPlate text, final MRGroupProspect prospect) { boolean ok = true; try { if (CCM_NotificationType_EMail.equals(p_CCM_NotificationType)) { notifyEMail(text, prospect); } else if (CCM_NotificationType_Letter.equals(p_CCM_NotificationType)) { notifyLetter(text, prospect); } else { throw new AdempiereException("@NotSupported@ @CCM_NotificationType@ - " + p_CCM_NotificationType); } } catch (Exception e) { addLog(prospect.toString() + ": Error: " + e.getLocalizedMessage()); ok = false; if (LogManager.isLevelFine()) { e.printStackTrace(); } } return ok; } private void notifyEMail(final MADBoilerPlate text, final MRGroupProspect prospect) { MADBoilerPlate.sendEMail(new IEMailEditor() { @Override public Object getBaseObject() { return prospect; } @Override public int getAD_Table_ID() { return X_R_Group.Table_ID; } @Override public int getRecord_ID() { return prospect.getR_Group_ID(); } @Override public EMail sendEMail(I_AD_User from, String toEmail, String subject, final BoilerPlateContext attributes) { final Mailbox mailbox = mailService.findMailbox(MailboxQuery.builder() .clientId(getClientId()) .orgId(getOrgId())
.adProcessId(getProcessInfo().getAdProcessId()) .fromUserId(UserId.ofRepoId(from.getAD_User_ID())) .build()); return mailService.sendEMail(EMailRequest.builder() .mailbox(mailbox) .toList(toEMailAddresses(toEmail)) .subject(text.getSubject()) .message(text.getTextSnippetParsed(attributes)) .html(true) .build()); } }); } private void notifyLetter(MADBoilerPlate text, MRGroupProspect prospect) { throw new UnsupportedOperationException(); } private List<MRGroupProspect> getProspects(int R_Group_ID) { final String whereClause = MRGroupProspect.COLUMNNAME_R_Group_ID + "=?"; return new Query(getCtx(), MRGroupProspect.Table_Name, whereClause, get_TrxName()) .setParameters(R_Group_ID) .list(MRGroupProspect.class); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\letters\report\AD_BoilderPlate_SendToGroup.java
1
请完成以下Java代码
static HandlerFilterFunction<ServerResponse, ServerResponse> setStatus(int statusCode) { return setStatus(new HttpStatusHolder(null, statusCode)); } static HandlerFilterFunction<ServerResponse, ServerResponse> setStatus(HttpStatusCode statusCode) { return setStatus(new HttpStatusHolder(statusCode, null)); } @Shortcut static HandlerFilterFunction<ServerResponse, ServerResponse> setStatus(HttpStatusHolder statusCode) { return ofResponseProcessor(AfterFilterFunctions.setStatus(statusCode)); } static HandlerFilterFunction<ServerResponse, ServerResponse> uri(String uri) { return ofRequestProcessor(BeforeFilterFunctions.uri(uri));
} @Shortcut static HandlerFilterFunction<ServerResponse, ServerResponse> uri(URI uri) { return ofRequestProcessor(BeforeFilterFunctions.uri(uri)); } class FilterSupplier extends SimpleFilterSupplier { public FilterSupplier() { super(FilterFunctions.class); } } }
repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\filter\FilterFunctions.java
1
请在Spring Boot框架中完成以下Java代码
public void putInternalId(EntityId externalId, EntityId internalId) { log.debug("[{}][{}] Local cache put: {}", externalId.getEntityType(), externalId.getId(), internalId); externalToInternalIdMap.put(externalId, internalId); } public void registerResult(EntityType entityType, boolean created) { EntityTypeLoadResult result = results.computeIfAbsent(entityType, EntityTypeLoadResult::new); if (created) { result.setCreated(result.getCreated() + 1); } else { result.setUpdated(result.getUpdated() + 1); } } public void registerDeleted(EntityType entityType) { EntityTypeLoadResult result = results.computeIfAbsent(entityType, EntityTypeLoadResult::new); result.setDeleted(result.getDeleted() + 1); } public void addRelations(Collection<EntityRelation> values) { relations.addAll(values); } public void addReferenceCallback(EntityId externalId, ThrowingRunnable tr) { if (tr != null) { referenceCallbacks.put(externalId, tr);
} } public void addEventCallback(ThrowingRunnable tr) { if (tr != null) { eventCallbacks.add(tr); } } public void registerNotFound(EntityId externalId) { notFoundIds.add(externalId); } public boolean isNotFound(EntityId externalId) { return notFoundIds.contains(externalId); } }
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\sync\vc\data\EntitiesImportCtx.java
2
请在Spring Boot框架中完成以下Java代码
public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) { if (!(ex instanceof XxlJobException)) { logger.error("WebExceptionResolver:{}", ex); } // if json boolean isJson = false; if (handler instanceof HandlerMethod) { HandlerMethod method = (HandlerMethod)handler; ResponseBody responseBody = method.getMethodAnnotation(ResponseBody.class); if (responseBody != null) { isJson = true; } } // error result ReturnT<String> errorResult = new ReturnT<String>(ReturnT.FAIL_CODE, ex.toString().replaceAll("\n", "<br/>")); // response ModelAndView mv = new ModelAndView(); if (isJson) {
try { response.setContentType("application/json;charset=utf-8"); response.getWriter().print(JacksonUtil.writeValueAsString(errorResult)); } catch (IOException e) { logger.error(e.getMessage(), e); } return mv; } else { mv.addObject("exceptionMsg", errorResult.getMsg()); mv.setViewName("/common/common.exception"); return mv; } } }
repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-xxljob\src\main\java\com\xxl\job\admin\controller\resolver\WebExceptionResolver.java
2
请完成以下Java代码
public R execute() { if (!isRequestValid()) { throw new RuntimeException("The request is invalid"); } return (R) connector.execute(this); } /** * Allows subclasses to provide custom validation logic of the * request parameters. * @return true if the request parameters are valid. */ protected boolean isRequestValid() { return true; } public void setRequestParameters(Map<String, Object> params) { for (Entry<String, Object> param : params.entrySet()) { setRequestParameter(param.getKey(), param.getValue()); } } /** * Sets a request parameter on the request * @param name the name of the parameter * @param value the value of the parameter */ public void setRequestParameter(String name, Object value) { requestParameters.put(name, value);
} /** * @return the parameters as handed in to the request. */ public Map<String, Object> getRequestParameters() { return requestParameters; } @SuppressWarnings("unchecked") public <V> V getRequestParameter(String name) { return (V) requestParameters.get(name); } }
repos\camunda-bpm-platform-master\connect\core\src\main\java\org\camunda\connect\impl\AbstractConnectorRequest.java
1
请完成以下Java代码
public int getK_Category_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_K_Category_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.
@return Alphanumeric identifier of the entity */ 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()); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_K_Category.java
1
请完成以下Java代码
public int toIntOr(final int fallbackValue) { return toOptionalInt() .orElse(fallbackValue); } private OptionalInt toOptionalInt() { OptionalInt valueInt = this.valueInt; if (valueInt == null) { valueInt = this.valueInt = parseOptionalInt(); } return valueInt; } private OptionalInt parseOptionalInt() { try { return OptionalInt.of(Integer.parseInt(value)); } catch (final Exception ex) { return OptionalInt.empty(); } } @Nullable public AdWindowId toAdWindowIdOrNull() { return AdWindowId.ofRepoIdOrNull(toIntOr(-1)); } public AdWindowId toAdWindowId() { return AdWindowId.ofRepoId(toInt());
} public boolean isInt() { return toOptionalInt().isPresent(); } public DocumentId toDocumentId() { return DocumentId.of(value); } public static boolean equals(@Nullable final WindowId id1, @Nullable final WindowId id2) { return Objects.equals(id1, id2); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\datatypes\WindowId.java
1
请完成以下Java代码
private static void clearAuthentication(Authentication authentication) { ProcessEngine processEngine = Cockpit.getProcessEngine(authentication.getProcessEngineName()); if(processEngine != null) { processEngine.getIdentityService().clearAuthentication(); } } private static void authenticateProcessEngine(Authentication authentication) { ProcessEngine processEngine = Cockpit.getProcessEngine(authentication.getProcessEngineName()); if (processEngine != null) { String userId = authentication.getIdentityId(); List<String> groupIds = null; List<String> tenantIds = null; if (authentication instanceof UserAuthentication) { UserAuthentication userAuthentication = (UserAuthentication) authentication; groupIds = userAuthentication.getGroupIds(); tenantIds = userAuthentication.getTenantIds(); } processEngine.getIdentityService().setAuthentication(userId, groupIds, tenantIds); } }
public static <T> T runWithoutAuthentication(SecurityAction<T> action, ProcessEngine processEngine) throws IOException, ServletException { final IdentityService identityService = processEngine.getIdentityService(); org.camunda.bpm.engine.impl.identity.Authentication currentAuth = identityService.getCurrentAuthentication(); try { identityService.clearAuthentication(); return action.execute(); } finally { identityService.setAuthentication(currentAuth); } } public static interface SecurityAction<T> { public T execute() throws IOException, ServletException; } }
repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\webapp\impl\security\SecurityActions.java
1
请完成以下Java代码
private static class AllocableHU { private final IHUStorageFactory storageFactory; @Getter private final I_M_HU topLevelHU; private final ProductId productId; private Quantity _storageQty; private Quantity qtyAllocated; public AllocableHU( final IHUStorageFactory storageFactory, final I_M_HU topLevelHU, final ProductId productId) { this.storageFactory = storageFactory; this.topLevelHU = topLevelHU; this.productId = productId; } public Quantity getQtyAvailableToAllocate() { final Quantity qtyStorage = getStorageQty(); return qtyAllocated != null ? qtyStorage.subtract(qtyAllocated) : qtyStorage; } private Quantity getStorageQty() { Quantity storageQty = this._storageQty; if (storageQty == null) { storageQty = this._storageQty = storageFactory.getStorage(topLevelHU).getProductStorage(productId).getQty(); } return storageQty; } public void addQtyAllocated(@NonNull final Quantity qtyAllocatedToAdd)
{ final Quantity newQtyAllocated = this.qtyAllocated != null ? this.qtyAllocated.add(qtyAllocatedToAdd) : qtyAllocatedToAdd; final Quantity storageQty = getStorageQty(); if (newQtyAllocated.isGreaterThan(storageQty)) { throw new AdempiereException("Over-allocating is not allowed") .appendParametersToMessage() .setParameter("this.qtyAllocated", this.qtyAllocated) .setParameter("newQtyAllocated", newQtyAllocated) .setParameter("storageQty", storageQty); } this.qtyAllocated = newQtyAllocated; } } private static class AllocableHUsList implements Iterable<AllocableHU> { private final ImmutableList<AllocableHU> hus; private AllocableHUsList(@NonNull final ImmutableList<AllocableHU> hus) {this.hus = hus;} @Override public @NonNull Iterator<AllocableHU> iterator() {return hus.iterator();} } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\distribution\ddorder\movement\schedule\plan\DDOrderMovePlanCreateCommand.java
1
请完成以下Java代码
public void setPreparationTime_1 (final @Nullable java.sql.Timestamp PreparationTime_1) { set_Value (COLUMNNAME_PreparationTime_1, PreparationTime_1); } @Override public java.sql.Timestamp getPreparationTime_1() { return get_ValueAsTimestamp(COLUMNNAME_PreparationTime_1); } @Override public void setPreparationTime_2 (final @Nullable java.sql.Timestamp PreparationTime_2) { set_Value (COLUMNNAME_PreparationTime_2, PreparationTime_2); } @Override public java.sql.Timestamp getPreparationTime_2() { return get_ValueAsTimestamp(COLUMNNAME_PreparationTime_2); } @Override public void setPreparationTime_3 (final @Nullable java.sql.Timestamp PreparationTime_3) { set_Value (COLUMNNAME_PreparationTime_3, PreparationTime_3); } @Override public java.sql.Timestamp getPreparationTime_3() { return get_ValueAsTimestamp(COLUMNNAME_PreparationTime_3); } @Override public void setPreparationTime_4 (final @Nullable java.sql.Timestamp PreparationTime_4) { set_Value (COLUMNNAME_PreparationTime_4, PreparationTime_4); } @Override public java.sql.Timestamp getPreparationTime_4() { return get_ValueAsTimestamp(COLUMNNAME_PreparationTime_4); } @Override public void setPreparationTime_5 (final @Nullable java.sql.Timestamp PreparationTime_5) { set_Value (COLUMNNAME_PreparationTime_5, PreparationTime_5); } @Override public java.sql.Timestamp getPreparationTime_5() { return get_ValueAsTimestamp(COLUMNNAME_PreparationTime_5); } @Override public void setPreparationTime_6 (final @Nullable java.sql.Timestamp PreparationTime_6) { set_Value (COLUMNNAME_PreparationTime_6, PreparationTime_6); } @Override public java.sql.Timestamp getPreparationTime_6()
{ return get_ValueAsTimestamp(COLUMNNAME_PreparationTime_6); } @Override public void setPreparationTime_7 (final @Nullable java.sql.Timestamp PreparationTime_7) { set_Value (COLUMNNAME_PreparationTime_7, PreparationTime_7); } @Override public java.sql.Timestamp getPreparationTime_7() { return get_ValueAsTimestamp(COLUMNNAME_PreparationTime_7); } @Override public void setReminderTimeInMin (final int ReminderTimeInMin) { set_Value (COLUMNNAME_ReminderTimeInMin, ReminderTimeInMin); } @Override public int getReminderTimeInMin() { return get_ValueAsInt(COLUMNNAME_ReminderTimeInMin); } @Override public void setValidFrom (final java.sql.Timestamp ValidFrom) { set_Value (COLUMNNAME_ValidFrom, ValidFrom); } @Override public java.sql.Timestamp getValidFrom() { return get_ValueAsTimestamp(COLUMNNAME_ValidFrom); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java-gen\de\metas\purchasecandidate\model\X_C_BP_PurchaseSchedule.java
1
请在Spring Boot框架中完成以下Java代码
public AuthenticationManager resolve(HttpServletRequest context) { return this.authenticationManager; } } static final class NimbusJwtDecoderJwkSetUriFactoryBean implements FactoryBean<JwtDecoder> { private final String jwkSetUri; NimbusJwtDecoderJwkSetUriFactoryBean(String jwkSetUri) { this.jwkSetUri = jwkSetUri; } @Override public JwtDecoder getObject() { return NimbusJwtDecoder.withJwkSetUri(this.jwkSetUri).build(); } @Override public Class<?> getObjectType() { return JwtDecoder.class; } } static final class BearerTokenRequestMatcher implements RequestMatcher { private final BearerTokenResolver bearerTokenResolver; BearerTokenRequestMatcher(BearerTokenResolver bearerTokenResolver) { Assert.notNull(bearerTokenResolver, "bearerTokenResolver cannot be null"); this.bearerTokenResolver = bearerTokenResolver; } @Override public boolean matches(HttpServletRequest request) {
try { return this.bearerTokenResolver.resolve(request) != null; } catch (OAuth2AuthenticationException ex) { return false; } } } static final class BearerTokenAuthenticationRequestMatcher implements RequestMatcher { private final AuthenticationConverter authenticationConverter; BearerTokenAuthenticationRequestMatcher() { this.authenticationConverter = new BearerTokenAuthenticationConverter(); } BearerTokenAuthenticationRequestMatcher(AuthenticationConverter authenticationConverter) { Assert.notNull(authenticationConverter, "authenticationConverter cannot be null"); this.authenticationConverter = authenticationConverter; } @Override public boolean matches(HttpServletRequest request) { try { return this.authenticationConverter.convert(request) != null; } catch (OAuth2AuthenticationException ex) { return false; } } } }
repos\spring-security-main\config\src\main\java\org\springframework\security\config\http\OAuth2ResourceServerBeanDefinitionParser.java
2
请完成以下Java代码
private void assignSerialNumbersToCUs(final Set<HuId> cuIDs, final List<String> availableSerialNumbers) { final List<HuId> listOfCUIDs = ImmutableList.copyOf(cuIDs); final int numberOfCUs = listOfCUIDs.size(); for (int i = 0; i < numberOfCUs; i++) { if (availableSerialNumbers.isEmpty()) { return; } assignSerialNumberToCU(listOfCUIDs.get(i), availableSerialNumbers.remove(0)); } } private void assignSerialNumberToCU(final HuId huId, final String serialNo) { final I_M_HU hu = handlingUnitsRepo.getById(huId); final IContextAware ctxAware = getContextAware(hu); final IHUContext huContext = handlingUnitsBL.createMutableHUContext(ctxAware); final IAttributeStorage attributeStorage = getAttributeStorage(huContext, hu); Check.errorUnless(attributeStorage.hasAttribute(AttributeConstants.ATTR_SerialNo), "There is no SerialNo attribute {} defined for the handling unit {}", AttributeConstants.ATTR_SerialNo, hu); attributeStorage.setValue(AttributeConstants.ATTR_SerialNo, serialNo.trim()); attributeStorage.saveChangesIfNeeded(); } private boolean isAggregateHU(final HUEditorRow huRow) {
final I_M_HU hu = huRow.getM_HU(); return handlingUnitsBL.isAggregateHU(hu); } private final IAttributeStorage getAttributeStorage(final IHUContext huContext, final I_M_HU hu) { final IAttributeStorageFactory attributeStorageFactory = huContext.getHUAttributeStorageFactory(); final IAttributeStorage attributeStorage = attributeStorageFactory.getAttributeStorage(hu); return attributeStorage; } private final HUTransformService newHUTransformation() { return HUTransformService.builder() .referencedObjects(getContextDocumentLines()) .build(); } /** * @return context document/lines (e.g. the receipt schedules) */ private List<TableRecordReference> getContextDocumentLines() { if (view == null) { return ImmutableList.of(); } return view.getReferencingDocumentPaths() .stream() .map(referencingDocumentPath -> documentCollections.getTableRecordReference(referencingDocumentPath)) .collect(GuavaCollectors.toImmutableList()); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\process\WEBUIHUCreationWithSerialNumberService.java
1
请完成以下Java代码
public PageData<AiModelId> findIdsByTenantId(UUID tenantId, PageLink pageLink) { return DaoUtil.pageToPageData(aiModelRepository.findIdsByTenantId(tenantId, toPageRequest(pageLink)).map(AiModelId::new)); } private static PageRequest toPageRequest(PageLink pageLink) { Sort sort; SortOrder sortOrder = pageLink.getSortOrder(); if (sortOrder == null) { sort = Sort.by(Sort.Direction.ASC, "id"); } else { sort = JpaSort.unsafe( Sort.Direction.fromString(sortOrder.getDirection().name()), AiModelEntity.COLUMN_MAP.getOrDefault(sortOrder.getProperty(), sortOrder.getProperty()) ).and(Sort.by(Sort.Direction.ASC, "id")); } return PageRequest.of(pageLink.getPage(), pageLink.getPageSize(), sort); } @Override public AiModelId getExternalIdByInternal(AiModelId internalId) { return aiModelRepository.getExternalIdById(internalId.getId()).map(AiModelId::new).orElse(null); } @Override public Long countByTenantId(TenantId tenantId) { return aiModelRepository.countByTenantId(tenantId.getId()); } @Override public boolean deleteById(TenantId tenantId, AiModelId modelId) { return aiModelRepository.deleteByIdIn(Set.of(modelId.getId())) > 0; } @Override public Set<AiModelId> deleteByTenantId(TenantId tenantId) {
return aiModelRepository.deleteByTenantId(tenantId.getId()).stream() .map(AiModelId::new) .collect(toSet()); } @Override public boolean deleteByTenantIdAndId(TenantId tenantId, AiModelId modelId) { return aiModelRepository.deleteByTenantIdAndIdIn(tenantId.getId(), Set.of(modelId.getId())) > 0; } @Override public EntityType getEntityType() { return EntityType.AI_MODEL; } @Override protected Class<AiModelEntity> getEntityClass() { return AiModelEntity.class; } @Override protected JpaRepository<AiModelEntity, UUID> getRepository() { return aiModelRepository; } }
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\ai\JpaAiModelDao.java
1
请完成以下Java代码
public List<VariableInstanceEntity> findVariableInstancesByExecutionAndNames(String executionId, Collection<String> names) { Map<String, Object> params = new HashMap<>(2); params.put("executionId", executionId); params.put("names", names); return getDbSqlSession().selectList("selectVariableInstancesByExecutionAndNames", params); } public VariableInstanceEntity findVariableInstanceByTaskAndName(String taskId, String variableName) { Map<String, String> params = new HashMap<>(2); params.put("taskId", taskId); params.put("name", variableName); return (VariableInstanceEntity) getDbSqlSession().selectOne("selectVariableInstanceByTaskAndName", params); } @SuppressWarnings("unchecked") public List<VariableInstanceEntity> findVariableInstancesByTaskAndNames(String taskId, Collection<String> names) { Map<String, Object> params = new HashMap<>(2); params.put("taskId", taskId); params.put("names", names); return getDbSqlSession().selectList("selectVariableInstancesByTaskAndNames", params);
} @SuppressWarnings("unchecked") public List<VariableInstanceEntity> findVariableInstancesBySubScopeIdAndScopeType(String subScopeId, String scopeType) { Map<String, Object> params = new HashMap<>(2); params.put("subScopeId", subScopeId); params.put("scopeType", scopeType); return getDbSqlSession().selectList("selectVariableInstancesBySubScopeIdAndScopeType", params); } public void deleteVariableInstanceByTask(TaskEntity task) { Map<String, VariableInstanceEntity> variableInstances = task.getVariableInstanceEntities(); if (variableInstances != null) { for (VariableInstanceEntity variableInstance : variableInstances.values()) { variableInstance.delete(); } } } }
repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\VariableInstanceEntityManager.java
1
请完成以下Java代码
public static <T> void assertNotIn(String message, T obj, T... objs) { assertNotEmpty(message, obj); assertNotEmpty(message, objs); if (oConvertUtils.isIn(obj, objs)) { throw new JeecgBootAssertException(message); } } /** * 确保src大于des * * @param message * @param src * @param des * @author chenrui * @date 2018/9/19 15:30 */ public static void assertGt(String message, Number src, Number des) { if (oConvertUtils.isGt(src, des)) { return; } throw new JeecgBootAssertException(message); } /** * 确保src大于等于des * * @param message * @param src * @param des * @author chenrui * @date 2018/9/19 15:30 */ public static void assertGe(String message, Number src, Number des) { if (oConvertUtils.isGe(src, des)) { return; } throw new JeecgBootAssertException(message); } /** * 确保src小于des * * @param message * @param src * @param des * @author chenrui
* @date 2018/9/19 15:30 */ public static void assertLt(String message, Number src, Number des) { if (oConvertUtils.isGe(src, des)) { throw new JeecgBootAssertException(message); } } /** * 确保src小于等于des * * @param message * @param src * @param des * @author chenrui * @date 2018/9/19 15:30 */ public static void assertLe(String message, Number src, Number des) { if (oConvertUtils.isGt(src, des)) { throw new JeecgBootAssertException(message); } } }
repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\AssertUtils.java
1
请在Spring Boot框架中完成以下Java代码
public class MvcConfig implements WebMvcConfigurer { public MvcConfig() { super(); } // @Override public void configureMessageConverters(final List<HttpMessageConverter<?>> messageConverters) { final Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder(); builder.indentOutput(true) .dateFormat(new SimpleDateFormat("dd-MM-yyyy hh:mm")); }
@Override public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { configurer.defaultContentType(MediaType.APPLICATION_JSON); } @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**"); } @Override public void configureAsyncSupport(AsyncSupportConfigurer configurer) { configurer.setDefaultTimeout(750); } }
repos\tutorials-master\spring-web-modules\spring-rest-http\src\main\java\com\baeldung\config\MvcConfig.java
2
请完成以下Java代码
public void calcBeta() { beta = 0.0; for (Path p : rpath) { beta = logsumexp(beta, p.cost + p.rnode.beta, p == rpath.get(0)); } beta += cost; } /** * 计算节点期望 * * @param expected 输出期望 * @param Z 规范化因子 * @param size 标签个数 */ public void calcExpectation(double[] expected, double Z, int size) { double c = Math.exp(alpha + beta - cost - Z); for (int i = 0; fVector.get(i) != -1; i++) { int idx = fVector.get(i) + y; expected[idx] += c; }
for (Path p : lpath) { p.calcExpectation(expected, Z, size); } } public void clear() { x = y = 0; alpha = beta = cost = 0; prev = null; fVector = null; lpath.clear(); rpath.clear(); } }
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\crf\crfpp\Node.java
1
请完成以下Java代码
public final class Endpoint implements Serializable { public static final String INFO = "info"; public static final String HEALTH = "health"; public static final String LOGFILE = "logfile"; public static final String ENV = "env"; public static final String HTTPTRACE = "httptrace"; public static final String HTTPEXCHANGES = "httpexchanges"; public static final String THREADDUMP = "threaddump"; public static final String LIQUIBASE = "liquibase"; public static final String FLYWAY = "flyway"; public static final String ACTUATOR_INDEX = "actuator-index"; public static final String BEANS = "beans"; public static final String CONFIGPROPS = "configprops"; public static final String MAPPINGS = "mappings";
public static final String STARTUP = "startup"; private final String id; private final String url; private Endpoint(String id, String url) { Assert.hasText(id, "'id' must not be empty."); Assert.hasText(url, "'url' must not be empty."); this.id = id; this.url = url; } public static Endpoint of(String id, String url) { return new Endpoint(id, url); } }
repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\domain\values\Endpoint.java
1
请完成以下Java代码
public boolean isSeverityChanged() { if (alarm == null || old == null) { return false; } else { return !alarm.getSeverity().equals(old.getSeverity()); } } public boolean isAcknowledged() { if (alarm == null || old == null) { return false; } else { return alarm.isAcknowledged() != old.isAcknowledged(); } } public AlarmSeverity getOldSeverity() { return isSeverityChanged() ? old.getSeverity() : null;
} public boolean isPropagationChanged() { if (created) { return true; } if (alarm == null || old == null) { return false; } return (alarm.isPropagate() != old.isPropagate()) || (alarm.isPropagateToOwner() != old.isPropagateToOwner()) || (alarm.isPropagateToTenant() != old.isPropagateToTenant()) || (!alarm.getPropagateRelationTypes().equals(old.getPropagateRelationTypes())); } }
repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\alarm\AlarmApiCallResult.java
1
请完成以下Java代码
public final AdempiereProcessor getModel() { return p_model; } // getModel /** * Calculate Sleep ms * * @return miliseconds */ protected final long calculateSleep() { String frequencyType = p_model.getFrequencyType(); int frequency = p_model.getFrequency(); if (frequency < 1) { frequency = 1; } // final long typeSec; if (frequencyType == null) { typeSec = 300; // 5 minutes (default) } else if (X_R_RequestProcessor.FREQUENCYTYPE_Minute.equals(frequencyType)) { typeSec = 60; } else if (X_R_RequestProcessor.FREQUENCYTYPE_Hour.equals(frequencyType)) { typeSec = 3600; } else if (X_R_RequestProcessor.FREQUENCYTYPE_Day.equals(frequencyType)) { typeSec = 86400; } else // Unknown Frequency { typeSec = 600; // 10 min log.warn("Unknown FrequencyType=" + frequencyType + ". Using Frequency=" + typeSec + "seconds."); } // return typeSec * 1000 * frequency; // ms } // calculateSleep /** * Is Sleeping * * @return sleeping */ public final boolean isSleeping() { return sleeping.get(); } // isSleeping @Override public final String toString() { final boolean sleeping = isSleeping(); final StringBuilder sb = new StringBuilder(getName()) .append(",Prio=").append(getPriority()) .append(",").append(getThreadGroup()) .append(",Alive=").append(isAlive()) .append(",Sleeping=").append(sleeping) .append(",Last=").append(getDateLastRun()); if (sleeping) {
sb.append(",Next=").append(getDateNextRun(false)); } return sb.toString(); } public final Timestamp getStartTime() { final long startTimeMillis = this.serverStartTimeMillis; return startTimeMillis > 0 ? new Timestamp(startTimeMillis) : null; } public final AdempiereProcessorLog[] getLogs() { return p_model.getLogs(); } /** * Set the initial nap/sleep when server starts. * * Mainly this method is used by tests. * * @param initialNapSeconds */ public final void setInitialNapSeconds(final int initialNapSeconds) { Check.assume(initialNapSeconds >= 0, "initialNapSeconds >= 0"); this.m_initialNapSecs = initialNapSeconds; } protected final int getRunCount() { return p_runCount; } protected final Timestamp getStartWork() { return new Timestamp(workStartTimeMillis); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\serverRoot\de.metas.adempiere.adempiere.serverRoot.base\src\main\java-legacy\org\compiere\server\AdempiereServer.java
1
请完成以下Java代码
public KeyValues getLowCardinalityKeyValues(KafkaRecordReceiverContext context) { String groupId = context.getGroupId(); KeyValues keyValues = KeyValues.of( ListenerLowCardinalityTags.LISTENER_ID.withValue(context.getListenerId()), ListenerLowCardinalityTags.MESSAGING_SYSTEM.withValue("kafka"), ListenerLowCardinalityTags.MESSAGING_OPERATION.withValue("process"), ListenerLowCardinalityTags.MESSAGING_SOURCE_NAME.withValue(context.getSource()), ListenerLowCardinalityTags.MESSAGING_SOURCE_KIND.withValue("topic") ); if (StringUtils.hasText(groupId)) { keyValues = keyValues .and(ListenerLowCardinalityTags.MESSAGING_CONSUMER_GROUP.withValue(groupId)); } return keyValues; } @Override @NonNull public KeyValues getHighCardinalityKeyValues(KafkaRecordReceiverContext context) { String clientId = context.getClientId(); String consumerId = getConsumerId(context.getGroupId(), clientId); KeyValues keyValues = KeyValues.of( ListenerHighCardinalityTags.MESSAGING_PARTITION.withValue(context.getPartition()), ListenerHighCardinalityTags.MESSAGING_OFFSET.withValue(context.getOffset()) ); if (StringUtils.hasText(clientId)) { keyValues = keyValues .and(ListenerHighCardinalityTags.MESSAGING_CLIENT_ID.withValue(clientId)); } if (StringUtils.hasText(consumerId)) { keyValues = keyValues .and(ListenerHighCardinalityTags.MESSAGING_CONSUMER_ID.withValue(consumerId)); }
return keyValues; } @Override public String getContextualName(KafkaRecordReceiverContext context) { return context.getSource() + " process"; } private static @Nullable String getConsumerId(@Nullable String groupId, @Nullable String clientId) { if (StringUtils.hasText(groupId)) { if (StringUtils.hasText(clientId)) { return groupId + " - " + clientId; } return groupId; } return clientId; } } }
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\micrometer\KafkaListenerObservation.java
1
请完成以下Java代码
public I_C_Recurring getC_Recurring() throws RuntimeException { return (I_C_Recurring)MTable.get(getCtx(), I_C_Recurring.Table_Name) .getPO(getC_Recurring_ID(), get_TrxName()); } /** Set Recurring. @param C_Recurring_ID Recurring Document */ public void setC_Recurring_ID (int C_Recurring_ID) { if (C_Recurring_ID < 1) set_ValueNoCheck (COLUMNNAME_C_Recurring_ID, null); else set_ValueNoCheck (COLUMNNAME_C_Recurring_ID, Integer.valueOf(C_Recurring_ID)); } /** Get Recurring. @return Recurring Document */ public int getC_Recurring_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Recurring_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Recurring Run. @param C_Recurring_Run_ID Recurring Document Run */ public void setC_Recurring_Run_ID (int C_Recurring_Run_ID) { if (C_Recurring_Run_ID < 1) set_ValueNoCheck (COLUMNNAME_C_Recurring_Run_ID, null); else set_ValueNoCheck (COLUMNNAME_C_Recurring_Run_ID, Integer.valueOf(C_Recurring_Run_ID)); } /** Get Recurring Run. @return Recurring Document Run */ public int getC_Recurring_Run_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Recurring_Run_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Document Date. @param DateDoc Date of the Document */ public void setDateDoc (Timestamp DateDoc) { set_Value (COLUMNNAME_DateDoc, DateDoc); } /** Get Document Date. @return Date of the Document */ public Timestamp getDateDoc ()
{ return (Timestamp)get_Value(COLUMNNAME_DateDoc); } public I_GL_JournalBatch getGL_JournalBatch() throws RuntimeException { return (I_GL_JournalBatch)MTable.get(getCtx(), I_GL_JournalBatch.Table_Name) .getPO(getGL_JournalBatch_ID(), get_TrxName()); } /** Set Journal Batch. @param GL_JournalBatch_ID General Ledger Journal Batch */ public void setGL_JournalBatch_ID (int GL_JournalBatch_ID) { if (GL_JournalBatch_ID < 1) set_ValueNoCheck (COLUMNNAME_GL_JournalBatch_ID, null); else set_ValueNoCheck (COLUMNNAME_GL_JournalBatch_ID, Integer.valueOf(GL_JournalBatch_ID)); } /** Get Journal Batch. @return General Ledger Journal Batch */ public int getGL_JournalBatch_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_GL_JournalBatch_ID); if (ii == null) return 0; return ii.intValue(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Recurring_Run.java
1
请完成以下Java代码
public String getClassName() { return getParent().getClassName(); } @Override public boolean isDeserializable() { return getParent().isDeserializable(); } @Override public boolean isEnum() { return getParent().isEnum(); } @Override public Object getField(String fieldName) { return getParent().getField(fieldName); } @Override public List<String> getFieldNames() { return getParent().getFieldNames(); } @Override public boolean isIdentityField(String fieldName) { return getParent().isIdentityField(fieldName); } @Override public Object getObject() { return getParent().getObject(); }
@Override public WritablePdxInstance createWriter() { return this; } @Override public boolean hasField(String fieldName) { return getParent().hasField(fieldName); } }; } /** * Determines whether the given {@link String field name} is a {@link PropertyDescriptor property} * on the underlying, target {@link Object}. * * @param fieldName {@link String} containing the name of the field to match against * a {@link PropertyDescriptor property} from the underlying, target {@link Object}. * @return a boolean value that determines whether the given {@link String field name} * is a {@link PropertyDescriptor property} on the underlying, target {@link Object}. * @see #getFieldNames() */ @Override public boolean hasField(String fieldName) { return getFieldNames().contains(fieldName); } }
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\pdx\ObjectPdxInstanceAdapter.java
1
请完成以下Java代码
public class FinancialInstrumentQuantityChoice { @XmlElement(name = "Unit") protected BigDecimal unit; @XmlElement(name = "FaceAmt") protected BigDecimal faceAmt; @XmlElement(name = "AmtsdVal") protected BigDecimal amtsdVal; /** * Gets the value of the unit property. * * @return * possible object is * {@link BigDecimal } * */ public BigDecimal getUnit() { return unit; } /** * Sets the value of the unit property. * * @param value * allowed object is * {@link BigDecimal } * */ public void setUnit(BigDecimal value) { this.unit = value; } /** * Gets the value of the faceAmt property. * * @return * possible object is * {@link BigDecimal } * */ public BigDecimal getFaceAmt() { return faceAmt; } /** * Sets the value of the faceAmt property. * * @param value * allowed object is * {@link BigDecimal } * */
public void setFaceAmt(BigDecimal value) { this.faceAmt = value; } /** * Gets the value of the amtsdVal property. * * @return * possible object is * {@link BigDecimal } * */ public BigDecimal getAmtsdVal() { return amtsdVal; } /** * Sets the value of the amtsdVal property. * * @param value * allowed object is * {@link BigDecimal } * */ public void setAmtsdVal(BigDecimal value) { this.amtsdVal = value; } }
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\FinancialInstrumentQuantityChoice.java
1
请完成以下Java代码
public void remove() { internalScanner.remove(); } @Override public void setScriptScannerFactory(IScriptScannerFactory scriptScannerFactory) { internalScanner.setScriptScannerFactory(scriptScannerFactory); } @Override public IScriptScannerFactory getScriptScannerFactory() { return internalScanner.getScriptScannerFactory(); } @Override public IScriptScannerFactory getScriptScannerFactoryToUse() { return internalScanner.getScriptScannerFactoryToUse(); } @Override public IScriptFactory getScriptFactory() { return internalScanner.getScriptFactory(); } @Override public void setScriptFactory(IScriptFactory scriptFactory) {
internalScanner.setScriptFactory(scriptFactory); } @Override public IScriptFactory getScriptFactoryToUse() { return internalScanner.getScriptFactoryToUse(); } @Override public boolean hasNext() { return internalScanner.hasNext(); } @Override public IScript next() { return internalScanner.next(); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.base\src\main\java\de\metas\migration\scanner\impl\AbstractScriptDecoratorAdapter.java
1
请完成以下Java代码
public class BPartnerProductStats { public static BPartnerProductStats newInstance(final BPartnerId bpartnerId, final ProductId productId) { return builder() .bpartnerId(bpartnerId) .productId(productId) .build(); } @Setter(AccessLevel.PACKAGE) private int repoId; @NonNull private final BPartnerId bpartnerId; @NonNull private final ProductId productId; @Setter(AccessLevel.PACKAGE) private ZonedDateTime lastShipmentDate; @Setter(AccessLevel.PACKAGE) private ZonedDateTime lastReceiptDate; @Setter(AccessLevel.PACKAGE) private LastInvoiceInfo lastSalesInvoice; public Integer getLastReceiptInDays() { return calculateDaysFrom(getLastReceiptDate()); } public Integer getLastShipmentInDays() { return calculateDaysFrom(getLastShipmentDate()); } private static Integer calculateDaysFrom(final ZonedDateTime date) { if (date != null) { return (int)Duration.between(date, SystemTime.asZonedDateTime()).toDays(); } else { return null; } } 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 max(final ZonedDateTime date1, final ZonedDateTime date2) { if (date1 == null) { return date2; } else if (date2 == null) { return date1;
} else { return date1.isAfter(date2) ? date1 : date2; } } public void updateLastSalesInvoiceInfo(@NonNull final LastInvoiceInfo lastSalesInvoice) { if (lastSalesInvoice.isAfter(this.lastSalesInvoice)) { this.lastSalesInvoice = lastSalesInvoice; } } @Value @Builder public static class LastInvoiceInfo { @NonNull private InvoiceId invoiceId; @NonNull private LocalDate invoiceDate; @NonNull private Money price; 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.invoiceId.getRepoId(); } else // if(this.invoiceDate.compareTo(other.invoiceDate) < 0) { return false; } } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\bpartner\product\stats\BPartnerProductStats.java
1
请完成以下Java代码
public final class ALoginRes_sv extends ListResourceBundle { // TODO Run native2ascii to convert to plain ASCII !! /** Translation Content */ static final Object[][] contents = new String[][] { { "Connection", "Anslutning" }, { "Defaults", "Standardinst\u00e4llningar" }, { "Login", "ADempiere inloggning" }, { "File", "Fil" }, { "Exit", "Avsluta" }, { "Help", "Hj\u00e4lp" }, { "About", "Om" }, { "Host", "V\u00e4rddator" }, { "Database", "Databas" }, { "User", "Anv\u00e4ndarnamn" }, { "EnterUser", "Ange anv\u00e4ndarnamn" }, { "Password", "L\u00f6senord" }, { "EnterPassword", "Ange l\u00f6senord" }, { "Language", "Spr\u00e5k" }, { "SelectLanguage", "V\u00e4lj spr\u00e5k" }, { "Role", "Roll" }, { "Client", "Klient" }, { "Organization", "Organisation" }, { "Date", "Datum" },
{ "Warehouse", "Lager" }, { "Printer", "Skrivare" }, { "Connected", "Ansluten" }, { "NotConnected", "Ej ansluten" }, { "DatabaseNotFound", "Hittade inte databasen" }, { "UserPwdError", "Felaktig anv\u00e4ndare/l\u00f6senord" }, { "RoleNotFound", "Hittade inte rollen" }, { "Authorized", "Auktoriserad" }, { "Ok", "Ok" }, { "Cancel", "Avbryt" }, { "VersionConflict", "Versionskonflikt:" }, { "VersionInfo", "Server <> Klient" }, { "PleaseUpgrade", "Uppgradering n\u00f6dv\u00e4ndig" } }; /** * Get Contents * @return context */ public Object[][] getContents() { return contents; } // getContents } // ALoginRes
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\apps\ALoginRes_sv.java
1
请完成以下Java代码
public Mono<ArticleView> getArticle(String slug, Optional<User> currentUser) { return articleRepository.findBySlug(slug) .flatMap(article -> articleMapper.mapToArticleView(article, currentUser)); } public Mono<ArticleView> updateArticle(String slug, UpdateArticleRequest request, User currentUser) { return articleRepository.findBySlugOrFail(slug) .map(article -> updateArticle(request, currentUser, article)); } public Mono<Void> deleteArticle(String slug, User articleAuthor) { return articleRepository.findBySlug(slug) .flatMap(article -> { if (!article.isAuthor(articleAuthor)) { return Mono.error(new InvalidRequestException("Article", "only author can delete article")); } return articleRepository.deleteArticleBySlug(slug).then(); }); } public Mono<CommentView> addComment(String slug, CreateCommentRequest request, User currentUser) { return commentService.addComment(slug, request, currentUser); } public Mono<Void> deleteComment(String commentId, String slug, User user) { return commentService.deleteComment(commentId, slug, user); } public Mono<MultipleCommentsView> getComments(String slug, Optional<User> user) { return commentService.getComments(slug, user); } public Mono<ArticleView> favoriteArticle(String slug, User currentUser) { return articleRepository.findBySlug(slug) .map(article -> { currentUser.favorite(article);
return ArticleView.ofOwnArticle(article, currentUser); }); } public Mono<ArticleView> unfavoriteArticle(String slug, User currentUser) { return articleRepository.findBySlug(slug) .map(article -> { currentUser.unfavorite(article); return ArticleView.ofOwnArticle(article, currentUser); }); } private ArticleView updateArticle(UpdateArticleRequest request, User currentUser, Article article) { if (!article.isAuthor(currentUser)) { throw new InvalidRequestException("Article", "only author can update article"); } ofNullable(request.getBody()) .ifPresent(article::setBody); ofNullable(request.getDescription()) .ifPresent(article::setDescription); ofNullable(request.getTitle()) .ifPresent(article::setTitle); return ArticleView.ofOwnArticle(article, currentUser); } }
repos\realworld-spring-webflux-master\src\main\java\com\realworld\springmongo\article\ArticleFacade.java
1
请在Spring Boot框架中完成以下Java代码
public String getContentType() { return contentType; } public void setContentType(String contentType) { this.contentType = contentType; } public Attachment uploadDate(String uploadDate) { this.uploadDate = uploadDate; return this; } /** * Der Zeitstempel des Hochladens * @return uploadDate **/ @Schema(example = "2020-11-18T10:33:08.995Z", description = "Der Zeitstempel des Hochladens") public String getUploadDate() { return uploadDate; } public void setUploadDate(String uploadDate) { this.uploadDate = uploadDate; } public Attachment metadata(AttachmentMetadata metadata) { this.metadata = metadata; return this; } /** * Get metadata * @return metadata **/ @Schema(description = "") public AttachmentMetadata getMetadata() { return metadata; } public void setMetadata(AttachmentMetadata metadata) { this.metadata = metadata; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Attachment attachment = (Attachment) o; return Objects.equals(this._id, attachment._id) && Objects.equals(this.filename, attachment.filename) &&
Objects.equals(this.contentType, attachment.contentType) && Objects.equals(this.uploadDate, attachment.uploadDate) && Objects.equals(this.metadata, attachment.metadata); } @Override public int hashCode() { return Objects.hash(_id, filename, contentType, uploadDate, metadata); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Attachment {\n"); sb.append(" _id: ").append(toIndentedString(_id)).append("\n"); sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); sb.append(" contentType: ").append(toIndentedString(contentType)).append("\n"); sb.append(" uploadDate: ").append(toIndentedString(uploadDate)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-document-api\src\main\java\io\swagger\client\model\Attachment.java
2
请完成以下Java代码
public Object execute(CommandContext commandContext) { TaskEntity task = commandContext .getTaskEntityManager() .findTaskById(taskId); if (task == null) { throw new ActivitiObjectNotFoundException("Task '" + taskId + "' not found", Task.class); } if (task.getTaskDefinition() == null) { throw new ActivitiException("Task form definition for '" + taskId + "' not found"); } TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler(); if (taskFormHandler == null) { return null;
} FormEngine formEngine = commandContext .getProcessEngineConfiguration() .getFormEngines() .get(formEngineName); if (formEngine == null) { throw new ActivitiException("No formEngine '" + formEngineName + "' defined process engine configuration"); } TaskFormData taskForm = taskFormHandler.createTaskForm(task); return formEngine.renderTaskForm(taskForm); } }
repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\cmd\GetRenderedTaskFormCmd.java
1
请完成以下Java代码
private void putIntoContext(OrderProcessContext orderProcessContext, Map<ProductEntity, Integer> productEntityIntegerMap) { OrderInsertReq orderInsertReq = (OrderInsertReq) orderProcessContext.getOrderProcessReq().getReqData(); orderInsertReq.setProdEntityCountMap(productEntityIntegerMap); } /** * 构建Map<ProductEntity, Integer> * @param productEntityList * @param prodIdCountMap * @return */ private Map<ProductEntity, Integer> buildProductEntityIntegerMap(List<ProductEntity> productEntityList, Map<String, Integer> prodIdCountMap) { Map<ProductEntity, Integer> map = Maps.newHashMap(); if (CollectionUtils.isEmpty(productEntityList)) { return map; } for (ProductEntity productEntity : productEntityList) { Integer count = prodIdCountMap.get(productEntity.getId()); map.put(productEntity, count); } return map; } /** * 获取Context中的ProdIdCountMap * @param orderProcessContext 上下文 * @return ProdIdCountMap */ private Map<String, Integer> getProdIdCountMap(OrderProcessContext orderProcessContext) { OrderInsertReq orderInsertReq = (OrderInsertReq) orderProcessContext.getOrderProcessReq().getReqData(); return orderInsertReq.getProdIdCountMap(); } /** * 查询产品详情 * @param prodIdCountMap 产品ID-库存 映射 * @return 产品列表 */ private List<ProductEntity> queryProduct(Map<String, Integer> prodIdCountMap) { // 查询结果集 List<ProductEntity> productEntityList = Lists.newArrayList(); // 构建查询请求 List<ProdQueryReq> prodQueryReqList = buildProdQueryReq(prodIdCountMap); // 批量查询
for (ProdQueryReq prodQueryReq : prodQueryReqList) { List<ProductEntity> productEntitys = productService.findProducts(prodQueryReq).getData(); // 产品ID不存在 if (productEntitys.size() <= 0) { logger.error("查询产品详情时,上线中 & 产品ID=" + prodQueryReq.getId() + "的产品不存在!"); throw new CommonBizException(ExpCodeEnum.PRODUCT_NO_EXISTENT); } productEntityList.add(productEntitys.get(0)); } return productEntityList; } /** * 构建产品查询请求 * @param prodIdCountMap 产品ID-库存 映射 * @return 产品查询请求列表 */ private List<ProdQueryReq> buildProdQueryReq(Map<String, Integer> prodIdCountMap) { List<ProdQueryReq> prodQueryReqList = Lists.newArrayList(); for (String prodId : prodIdCountMap.keySet()) { ProdQueryReq prodQueryReq = new ProdQueryReq(); prodQueryReq.setId(prodId); // 必须是"上线中"的产品 prodQueryReq.setProdStateCode(ProdStateEnum.OPEN.getCode()); prodQueryReqList.add(prodQueryReq); } return prodQueryReqList; } }
repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Order\src\main\java\com\gaoxi\order\component\datatransfer\ProdCountMapTransferComponent.java
1
请完成以下Java代码
public @Nullable ResidentKeyRequirement getResidentKey() { return this.residentKey; } /** * The <a href= * "https://www.w3.org/TR/webauthn-3/#dom-authenticatorselectioncriteria-userverification">userVerification</a> * specifies the <a href="https://www.w3.org/TR/webauthn-3/#relying-party">Relying * Party</a>'s requirements regarding * <a href="https://www.w3.org/TR/webauthn-3/#user-verification">user verification</a> * for the <a href= * "https://w3c.github.io/webappsec-credential-management/#dom-credentialscontainer-create">create()</a> * operation. * @return the user verification requirement */ public @Nullable UserVerificationRequirement getUserVerification() { return this.userVerification; } /** * Creates a new {@link AuthenticatorSelectionCriteriaBuilder} * @return a new {@link AuthenticatorSelectionCriteriaBuilder} */ public static AuthenticatorSelectionCriteriaBuilder builder() { return new AuthenticatorSelectionCriteriaBuilder(); } /** * Creates a {@link AuthenticatorSelectionCriteria} * * @author Rob Winch * @since 6.4 */ public static final class AuthenticatorSelectionCriteriaBuilder { private @Nullable AuthenticatorAttachment authenticatorAttachment; private @Nullable ResidentKeyRequirement residentKey; private @Nullable UserVerificationRequirement userVerification; private AuthenticatorSelectionCriteriaBuilder() { } /**
* Sets the {@link #getAuthenticatorAttachment()} property. * @param authenticatorAttachment the authenticator attachment * @return the {@link AuthenticatorSelectionCriteriaBuilder} */ public AuthenticatorSelectionCriteriaBuilder authenticatorAttachment( AuthenticatorAttachment authenticatorAttachment) { this.authenticatorAttachment = authenticatorAttachment; return this; } /** * Sets the {@link #getResidentKey()} property. * @param residentKey the resident key * @return the {@link AuthenticatorSelectionCriteriaBuilder} */ public AuthenticatorSelectionCriteriaBuilder residentKey(ResidentKeyRequirement residentKey) { this.residentKey = residentKey; return this; } /** * Sets the {@link #getUserVerification()} property. * @param userVerification the user verification requirement * @return the {@link AuthenticatorSelectionCriteriaBuilder} */ public AuthenticatorSelectionCriteriaBuilder userVerification(UserVerificationRequirement userVerification) { this.userVerification = userVerification; return this; } /** * Builds a {@link AuthenticatorSelectionCriteria} * @return a new {@link AuthenticatorSelectionCriteria} */ public AuthenticatorSelectionCriteria build() { return new AuthenticatorSelectionCriteria(this.authenticatorAttachment, this.residentKey, this.userVerification); } } }
repos\spring-security-main\webauthn\src\main\java\org\springframework\security\web\webauthn\api\AuthenticatorSelectionCriteria.java
1
请在Spring Boot框架中完成以下Java代码
public class OrgMappingRepository { final IBPartnerDAO bPartnerDAO = Services.get(IBPartnerDAO.class); public OrgMappingId createOrgMappingForBPartner(@NonNull final I_C_BPartner bPartnerRecord) { final I_AD_Org_Mapping orgMapping = newInstance(I_AD_Org_Mapping.class); orgMapping.setAD_Org_ID(0); orgMapping.setAD_Table_ID(getTableId(I_C_BPartner.class)); orgMapping.setValue(bPartnerRecord.getValue()); save(orgMapping); return OrgMappingId.ofRepoId(orgMapping.getAD_Org_Mapping_ID()); } public OrgMappingId getCreateOrgMappingId(@NonNull final BPartnerLocation location) { final OrgMappingId orgMappingId = location.getOrgMappingId(); if (orgMappingId != null) { return orgMappingId; } final I_AD_Org_Mapping orgMapping = newInstance(I_AD_Org_Mapping.class); orgMapping.setAD_Org_ID(0); orgMapping.setAD_Table_ID(getTableId(I_C_BPartner_Location.class)); orgMapping.setValue(location.getName()); save(orgMapping); return OrgMappingId.ofRepoId(orgMapping.getAD_Org_Mapping_ID()); } public OrgMappingId getCreateOrgMappingId(@NonNull final BPartnerBankAccount existingBankAccountInInitialPartner) { final OrgMappingId orgMappingId = existingBankAccountInInitialPartner.getOrgMappingId(); if (orgMappingId != null) { return orgMappingId; } final I_AD_Org_Mapping orgMapping = newInstance(I_AD_Org_Mapping.class); orgMapping.setAD_Org_ID(0);
orgMapping.setAD_Table_ID(getTableId(I_C_BP_BankAccount.class)); orgMapping.setValue(existingBankAccountInInitialPartner.getIban()); save(orgMapping); return OrgMappingId.ofRepoId(orgMapping.getAD_Org_Mapping_ID()); } public OrgMappingId getCreateOrgMappingId(@NonNull final BPartnerContact contact) { final OrgMappingId orgMappingId = contact.getOrgMappingId(); if (orgMappingId != null) { return orgMappingId; } final I_AD_Org_Mapping orgMapping = newInstance(I_AD_Org_Mapping.class); orgMapping.setAD_Org_ID(0); orgMapping.setAD_Table_ID(getTableId(I_C_BP_BankAccount.class)); orgMapping.setValue(contact.getValue()); save(orgMapping); return OrgMappingId.ofRepoId(orgMapping.getAD_Org_Mapping_ID()); } public OrgMappingId getCreateOrgMappingId(@NonNull final BPartnerId bpartnerId) { final I_C_BPartner bPartnerRecord = bPartnerDAO.getById(bpartnerId); OrgMappingId orgMappingId = OrgMappingId.ofRepoIdOrNull(bPartnerRecord.getAD_Org_Mapping_ID()); if (orgMappingId == null) { orgMappingId = createOrgMappingForBPartner(bPartnerRecord); bPartnerRecord.setAD_Org_Mapping_ID(orgMappingId.getRepoId()); save(bPartnerRecord); } return orgMappingId; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\bpartner\repository\OrgMappingRepository.java
2
请完成以下Java代码
public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } @Override public String getOwner() { return owner; } public void setOwner(String owner) { this.owner = owner; } @Override public String getParentTaskId() { return parentTaskId; } public void setParentTaskId(String parentTaskId) { this.parentTaskId = parentTaskId; } @Override public Date getClaimTime() { return claimTime; } public void setClaimTime(Date claimTime) { this.claimTime = claimTime; } @Override public String getTenantId() { return tenantId; } public void setTenantId(String tenantId) { this.tenantId = tenantId; } @Override public Date getTime() { return getStartTime(); } @Override public Long getWorkTimeInMillis() { if (endTime == null || claimTime == null) { return null; } return endTime.getTime() - claimTime.getTime(); } @Override public Map<String, Object> getTaskLocalVariables() { Map<String, Object> variables = new HashMap<>(); if (queryVariables != null) {
for (HistoricVariableInstanceEntity variableInstance : queryVariables) { if (variableInstance.getId() != null && variableInstance.getTaskId() != null) { variables.put(variableInstance.getName(), variableInstance.getValue()); } } } return variables; } @Override public Map<String, Object> getProcessVariables() { Map<String, Object> variables = new HashMap<>(); if (queryVariables != null) { for (HistoricVariableInstanceEntity variableInstance : queryVariables) { if (variableInstance.getId() != null && variableInstance.getTaskId() == null) { variables.put(variableInstance.getName(), variableInstance.getValue()); } } } return variables; } public List<HistoricVariableInstanceEntity> getQueryVariables() { if (queryVariables == null && Context.getCommandContext() != null) { queryVariables = new HistoricVariableInitializingList(); } return queryVariables; } public void setQueryVariables(List<HistoricVariableInstanceEntity> queryVariables) { this.queryVariables = queryVariables; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("HistoricTaskInstanceEntity["); sb.append("id=").append(id); sb.append(", name=").append(name); sb.append("]"); return sb.toString(); } }
repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\HistoricTaskInstanceEntity.java
1
请完成以下Java代码
private final int getParentWindowNo() { final Integer parentWindowNo = _parentWindowNoSupplier.get(); return parentWindowNo == null ? Env.WINDOW_MAIN : parentWindowNo; } private final JFrame getParentFrame() { final int parentWindowNo = getParentWindowNo(); // No windowNo => use main window if (parentWindowNo < 0 || parentWindowNo == Env.WINDOW_None) { return Env.getWindow(Env.WINDOW_MAIN); } // Use particular window final JFrame frame = Env.getWindow(parentWindowNo); if (frame != null) { return frame; } // Fallback to main window (shall not happen) return Env.getWindow(Env.WINDOW_MAIN);
} /** Sets the menu where we shall add the info windows menu items */ public InfoWindowMenuBuilder setMenu(final JMenu menu) { assertNotBuilt(); Check.assumeNotNull(menu, "menu not null"); _menu = menu; return this; } private final JMenu getMenu() { Check.assumeNotNull(_menu, "menu not null"); return _menu; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\search\InfoWindowMenuBuilder.java
1
请完成以下Java代码
public static boolean removeAppender(ch.qos.logback.classic.Logger logger, String appenderName) { return Optional.ofNullable(logger) .map(it -> it.getAppender(appenderName)) .filter(appender -> appender.getName().equals(appenderName)) .map(appender -> { appender.stop(); return appender; }) .map(appender -> logger.detachAppender(appender)) .orElse(false); } /** * Removes the {@literal console} {@link Appender} from the given {@link Logger}. * * @param logger {@link Logger} from which to remove the {@literal console} {@link Appender}. * @return {@literal true} if the {@literal console} {@link Appender} was registered with * and successfully remove from the given {@link Logger}. * @see #removeAppender(ch.qos.logback.classic.Logger, String) */ public static boolean removeConsoleAppender(ch.qos.logback.classic.Logger logger) { return removeAppender(logger, CONSOLE_APPENDER_NAME); } /** * Removes the {@literal delegate} {@link Appender} from the given {@link Logger}. * * @param logger {@link Logger} from which to remove the {@literal delegate} {@link Appender}. * @return {@literal true} if the {@literal delegate} {@link Appender} was registered with * and successfully remove from the given {@link Logger}. * @see #removeAppender(ch.qos.logback.classic.Logger, String) */ public static boolean removeDelegateAppender(ch.qos.logback.classic.Logger logger) { return removeAppender(logger, DELEGATE_APPENDER_NAME); } /** * Converts an SLF4J {@link Logger} to a Logback {@link ch.qos.logback.classic.Logger}. * * @param logger SLF4J {@link Logger} to convert. * @return an {@link Optional} Logback {@link ch.qos.logback.classic.Logger} for the given SLF4J {@link Logger} * iff the SLF4J {@link Logger} is {@literal not-null} and is a Logback {@link ch.qos.logback.classic.Logger}.
* @see java.util.Optional * @see ch.qos.logback.classic.Logger * @see org.slf4j.Logger */ public static Optional<ch.qos.logback.classic.Logger> toLogbackLogger(Logger logger) { return slf4jLoggerToLogbackLoggerConverter.apply(logger); } private static String nullSafeLoggerName(Logger logger) { return logger != null ? logger.getName() : null; } private static Class<?> nullSafeType(Object obj) { return obj != null ? obj.getClass() : null; } private static String nullSafeTypeName(Class<?> type) { return type != null ? type.getName() : null; } private static String nullSafeTypeName(Object obj) { return nullSafeTypeName(nullSafeType(obj)); } private static String nullSafeTypeSimpleName(Class<?> type) { return type != null ? type.getSimpleName() : null; } private static String nullSafeTypeSimpleName(Object obj) { return nullSafeTypeSimpleName(nullSafeType(obj)); } }
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-starters\spring-geode-starter-logging\src\main\java\org\springframework\geode\logging\slf4j\logback\support\LogbackSupport.java
1
请在Spring Boot框架中完成以下Java代码
public void setIp(String ip) { this.ip = ip; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } @Override public String toString() { return "Cluster{" + "ip='" + ip + '\'' + ", path='" + path + '\'' + '}'; } } public String getEmail() { return email; } public void setEmail(String email) { this.email = email;
} public List<Cluster> getCluster() { return cluster; } public void setCluster(List<Cluster> cluster) { this.cluster = cluster; } @Override public String toString() { return "ServerProperties{" + "email='" + email + '\'' + ", cluster=" + cluster + '}'; } }
repos\spring-boot-master\profile-properties\src\main\java\com\mkyong\config\ServerProperties.java
2
请完成以下Java代码
public class MyFirstStrategy extends BasicCassandreStrategy { private final Logger logger = LoggerFactory.getLogger(MyFirstStrategy.class); @Override public Set<CurrencyPairDTO> getRequestedCurrencyPairs() { return Set.of(new CurrencyPairDTO(BTC, USDT)); } @Override public Optional<AccountDTO> getTradeAccount(Set<AccountDTO> accounts) { return accounts.stream() .filter(a -> "trade".equals(a.getName())) .findFirst(); } @Override public void onTickerUpdate(TickerDTO ticker) { logger.info("Received a new ticker : {}", ticker); if (new BigDecimal("56000").compareTo(ticker.getLast()) == -1) { if (canBuy(new CurrencyPairDTO(BTC, USDT), new BigDecimal("0.01"))) { PositionRulesDTO rules = PositionRulesDTO.builder() .stopGainPercentage(4f) .stopLossPercentage(25f) .build(); createLongPosition(new CurrencyPairDTO(BTC, USDT), new BigDecimal("0.01"), rules); }
} } @Override public void onPositionStatusUpdate(PositionDTO position) { if (position.getStatus() == OPENED) { logger.info("> New position opened : {}", position.getPositionId()); } if (position.getStatus() == CLOSED) { logger.info("> Position closed : {}", position.getDescription()); } } }
repos\tutorials-master\spring-boot-modules\spring-boot-cassandre\src\main\java\com\baeldung\trading\MyFirstStrategy.java
1
请完成以下Java代码
public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getGenre() { return genre; } public void setGenre(String genre) { this.genre = genre; } public int getAge() {
return age; } public void setAge(int age) { this.age = age; } public Boolean isBestSelling() { return bestSelling; } public void setBestSelling(Boolean bestSelling) { this.bestSelling = bestSelling; } @Override public String toString() { return "Author{" + "id=" + id + ", age=" + age + ", name=" + name + ", genre=" + genre + ", bestSelling=" + bestSelling + '}'; } }
repos\Hibernate-SpringBoot-master\HibernateSpringBootMapBooleanToYesNo\src\main\java\com\bookstore\entity\Author.java
1
请完成以下Java代码
public class Keyword { private String name; private int age; public Keyword() { this("John", 27); this.printMessage(); printInstance(this); } public Keyword(String name, int age) { this.name = name; this.age = age; } public void printMessage() { System.out.println("invoked by this"); } public void printInstance(Keyword thisKeyword) { System.out.println(thisKeyword); } public Keyword getCurrentInstance() { return this;
} class ThisInnerClass { boolean isInnerClass = true; public ThisInnerClass() { Keyword thisKeyword = Keyword.this; String outerString = Keyword.this.name; System.out.println(this.isInnerClass); } } @Override public String toString() { return "KeywordTest{" + "name='" + name + '\'' + ", age=" + age + '}'; } }
repos\tutorials-master\core-java-modules\core-java-lang-oop-types-3\src\main\java\com\baeldung\thiskeyword\Keyword.java
1
请在Spring Boot框架中完成以下Java代码
public class ApiResponse<T> { final private int statusCode; final private Map<String, List<String>> headers; final private T data; /** * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response */ public ApiResponse(int statusCode, Map<String, List<String>> headers) { this(statusCode, headers, null); } /** * @param statusCode The status code of HTTP response * @param headers The headers of HTTP response * @param data The object deserialized from response bod */ public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) { this.statusCode = statusCode;
this.headers = headers; this.data = data; } public int getStatusCode() { return statusCode; } public Map<String, List<String>> getHeaders() { return headers; } public T getData() { return data; } }
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-article-api\src\main\java\io\swagger\client\ApiResponse.java
2
请完成以下Java代码
public String toString() { StringBuffer sb = new StringBuffer ("X_AD_TaskInstance[") .append(get_ID()).append("]"); return sb.toString(); } /** Set OS Task. @param AD_Task_ID Operation System Task */ public void setAD_Task_ID (int AD_Task_ID) { if (AD_Task_ID < 1) set_Value (COLUMNNAME_AD_Task_ID, null); else set_Value (COLUMNNAME_AD_Task_ID, Integer.valueOf(AD_Task_ID)); } /** Get OS Task. @return Operation System Task */ public int getAD_Task_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_AD_Task_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Task Instance. @param AD_TaskInstance_ID Task Instance */ public void setAD_TaskInstance_ID (int AD_TaskInstance_ID) { if (AD_TaskInstance_ID < 1) set_ValueNoCheck (COLUMNNAME_AD_TaskInstance_ID, null); else
set_ValueNoCheck (COLUMNNAME_AD_TaskInstance_ID, Integer.valueOf(AD_TaskInstance_ID)); } /** Get Task Instance. @return Task Instance */ public int getAD_TaskInstance_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_AD_TaskInstance_ID); if (ii == null) return 0; return ii.intValue(); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), String.valueOf(getAD_TaskInstance_ID())); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_TaskInstance.java
1
请完成以下Java代码
public int getManufacturing_Warehouse_Group_ID() { return get_ValueAsInt(COLUMNNAME_Manufacturing_Warehouse_Group_ID); } /** * MRP_Exclude AD_Reference_ID=319 * Reference name: _YesNo */ public static final int MRP_EXCLUDE_AD_Reference_ID=319; /** Yes = Y */ public static final String MRP_EXCLUDE_Yes = "Y"; /** No = N */ public static final String MRP_EXCLUDE_No = "N"; @Override public void setMRP_Exclude (final @Nullable java.lang.String MRP_Exclude) { set_Value (COLUMNNAME_MRP_Exclude, MRP_Exclude); } @Override public java.lang.String getMRP_Exclude() { return get_ValueAsString(COLUMNNAME_MRP_Exclude); } @Override public void setName (final java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } @Override public java.lang.String getName() { return get_ValueAsString(COLUMNNAME_Name); } @Override public org.compiere.model.I_S_Resource getPP_Plant() { return get_ValueAsPO(COLUMNNAME_PP_Plant_ID, org.compiere.model.I_S_Resource.class); } @Override public void setPP_Plant(final org.compiere.model.I_S_Resource PP_Plant) { set_ValueFromPO(COLUMNNAME_PP_Plant_ID, org.compiere.model.I_S_Resource.class, PP_Plant); } @Override public void setPP_Plant_ID (final int PP_Plant_ID) { if (PP_Plant_ID < 1) set_Value (COLUMNNAME_PP_Plant_ID, null); else set_Value (COLUMNNAME_PP_Plant_ID, PP_Plant_ID); } @Override public int getPP_Plant_ID() { return get_ValueAsInt(COLUMNNAME_PP_Plant_ID); } @Override public void setReplenishmentClass (final @Nullable java.lang.String ReplenishmentClass) { set_Value (COLUMNNAME_ReplenishmentClass, ReplenishmentClass); } @Override public java.lang.String getReplenishmentClass() { return get_ValueAsString(COLUMNNAME_ReplenishmentClass); } @Override public void setSeparator (final java.lang.String Separator) {
set_Value (COLUMNNAME_Separator, Separator); } @Override public java.lang.String getSeparator() { return get_ValueAsString(COLUMNNAME_Separator); } @Override public void setValue (final java.lang.String Value) { set_Value (COLUMNNAME_Value, Value); } @Override public java.lang.String getValue() { return get_ValueAsString(COLUMNNAME_Value); } @Override public void setAD_User_ID (final int AD_User_ID) { if (AD_User_ID < 0) set_Value (COLUMNNAME_AD_User_ID, null); else set_Value (COLUMNNAME_AD_User_ID, AD_User_ID); } @Override public int getAD_User_ID() { return get_ValueAsInt(COLUMNNAME_AD_User_ID); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Warehouse.java
1
请完成以下Java代码
public int getC_Allotment_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Allotment_ID); if (ii == null) return 0; return ii.intValue(); } @Override public org.compiere.model.I_C_Location getC_Location() throws RuntimeException { return get_ValueAsPO(COLUMNNAME_C_Location_ID, org.compiere.model.I_C_Location.class); } @Override public void setC_Location(org.compiere.model.I_C_Location C_Location) { set_ValueFromPO(COLUMNNAME_C_Location_ID, org.compiere.model.I_C_Location.class, C_Location); } /** Set Anschrift. @param C_Location_ID Adresse oder Anschrift */ @Override public void setC_Location_ID (int C_Location_ID) { if (C_Location_ID < 1) set_Value (COLUMNNAME_C_Location_ID, null); else set_Value (COLUMNNAME_C_Location_ID, Integer.valueOf(C_Location_ID)); } /** Get Anschrift. @return Adresse oder Anschrift */ @Override public int getC_Location_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Location_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Name. @param Name Alphanumeric identifier of the entity */ @Override public void setName (java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name.
@return Alphanumeric identifier of the entity */ @Override public java.lang.String getName () { return (java.lang.String)get_Value(COLUMNNAME_Name); } /** Set Suchschlüssel. @param Value Suchschlüssel für den Eintrag im erforderlichen Format - muss eindeutig sein */ @Override public void setValue (java.lang.String Value) { set_Value (COLUMNNAME_Value, Value); } /** Get Suchschlüssel. @return Suchschlüssel für den Eintrag im erforderlichen Format - muss eindeutig sein */ @Override public java.lang.String getValue () { return (java.lang.String)get_Value(COLUMNNAME_Value); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java-gen\de\metas\fresh\model\X_C_Allotment.java
1