本文整理汇总了Java中com.helger.commons.annotation.ReturnsMutableCopy类的典型用法代码示例。如果您正苦于以下问题:Java ReturnsMutableCopy类的具体用法?Java ReturnsMutableCopy怎么用?Java ReturnsMutableCopy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReturnsMutableCopy类属于com.helger.commons.annotation包,在下文中一共展示了ReturnsMutableCopy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: if
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
@Nonnull
@ReturnsMutableCopy
private static ICommonsList <Node> _getAllReferences (@Nullable final Node aUserMessage)
{
final ICommonsList <Node> aDSRefs = new CommonsArrayList <> ();
Node aNext = XMLHelper.getFirstChildElementOfName (aUserMessage, "Envelope");
aNext = XMLHelper.getFirstChildElementOfName (aNext, "Header");
aNext = XMLHelper.getFirstChildElementOfName (aNext, CAS4.WSSE_NS, "Security");
aNext = XMLHelper.getFirstChildElementOfName (aNext, CAS4.DS_NS, "Signature");
aNext = XMLHelper.getFirstChildElementOfName (aNext, CAS4.DS_NS, "SignedInfo");
if (aNext != null)
{
new ChildElementIterator (aNext).findAll (XMLHelper.filterElementWithNamespaceAndLocalName (CAS4.DS_NS,
"Reference"),
aDSRefs::add);
}
return aDSRefs;
}
开发者ID:phax,项目名称:ph-as4,代码行数:19,代码来源:ReceiptMessageCreator.java
示例2: stop
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Stop the indexer work queue immediately.
*
* @return The list of all remaining objects in the queue. Never
* <code>null</code>.
*/
@Nonnull
@ReturnsMutableCopy
public ICommonsList <IIndexerWorkItem> stop ()
{
// don't take any more actions
m_aImmediateCollector.stopQueuingNewObjects ();
// Get all remaining objects and save them for late reuse
final ICommonsList <IIndexerWorkItem> aRemainingItems = m_aImmediateCollector.drainQueue ();
// Shutdown the thread pool afterwards
ExecutorServiceHelper.shutdownAndWaitUntilAllTasksAreFinished (m_aSenderThreadPool);
return aRemainingItems;
}
开发者ID:phax,项目名称:peppol-directory,代码行数:22,代码来源:IndexerWorkItemQueue.java
示例3: getAndRemoveAllEntries
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
@Nonnull
@ReturnsMutableCopy
public ICommonsList <IReIndexWorkItem> getAndRemoveAllEntries (@Nonnull final Predicate <? super IReIndexWorkItem> aFilter)
{
ValueEnforcer.notNull (aFilter, "Filter");
final ICommonsList <IReIndexWorkItem> aCopyOfAll = getAll ();
final ICommonsList <IReIndexWorkItem> ret = new CommonsArrayList <> ();
m_aRWLock.writeLocked ( () -> {
// Operate on a copy for removal!
for (final IReIndexWorkItem aWorkItem : aCopyOfAll)
if (aFilter.test (aWorkItem))
{
ret.add (aWorkItem);
internalDeleteItem (aWorkItem.getID ());
}
});
return ret;
}
开发者ID:phax,项目名称:peppol-directory,代码行数:19,代码来源:ReIndexWorkItemList.java
示例4: getAllDocuments
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Get all {@link PDStoredDocument} objects matching the provided query. This
* is a specialization of {@link #searchAllDocuments(Query, Consumer)}.
*
* @param aQuery
* The query to be executed. May not be <code>null</code>.
* @return A non-<code>null</code> but maybe empty list of matching documents
* @see #searchAllDocuments(Query, Consumer)
*/
@Nonnull
@ReturnsMutableCopy
public ICommonsList <PDStoredDocument> getAllDocuments (@Nonnull final Query aQuery)
{
final ICommonsList <PDStoredDocument> aTargetList = new CommonsArrayList <> ();
try
{
searchAllDocuments (aQuery, aTargetList::add);
}
catch (final IOException ex)
{
s_aLogger.error ("Error searching for documents with query " + aQuery, ex);
}
return aTargetList;
}
开发者ID:phax,项目名称:peppol-directory,代码行数:25,代码来源:PDStorageManager.java
示例5: getAllContainedParticipantIDs
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
@Nonnull
@ReturnsMutableCopy
public ICommonsSortedSet <IParticipantIdentifier> getAllContainedParticipantIDs ()
{
final ICommonsSortedSet <IParticipantIdentifier> aTargetSet = new CommonsTreeSet <> ();
final Query aQuery = PDQueryManager.andNotDeleted (new MatchAllDocsQuery ());
try
{
final ObjIntConsumer <Document> aConsumer = (aDoc,
nDocID) -> aTargetSet.add (PDField.PARTICIPANT_ID.getDocValue (aDoc));
final Collector aCollector = new AllDocumentsCollector (m_aLucene, aConsumer);
searchAtomic (aQuery, aCollector);
}
catch (final IOException ex)
{
s_aLogger.error ("Error searching for documents with query " + aQuery, ex);
}
return aTargetSet;
}
开发者ID:phax,项目名称:peppol-directory,代码行数:20,代码来源:PDStorageManager.java
示例6: getAllExcept
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Get an array that contains all elements, except for the passed elements.
*
* @param <ELEMENTTYPE>
* Array element type
* @param aArray
* The source array. May be <code>null</code>.
* @param aElementsToRemove
* The elements to skip.
* @return <code>null</code> if the passed array is <code>null</code>. The
* original array, if no elements need to be skipped. A non-
* <code>null</code> copy of the array without the passed elements
* otherwise.
*/
@Nullable
@ReturnsMutableCopy
@SafeVarargs
public static <ELEMENTTYPE> ELEMENTTYPE [] getAllExcept (@Nullable final ELEMENTTYPE [] aArray,
@Nullable final ELEMENTTYPE... aElementsToRemove)
{
if (isEmpty (aArray) || isEmpty (aElementsToRemove))
return aArray;
final ELEMENTTYPE [] tmp = getCopy (aArray);
int nDst = 0;
for (int nSrc = 0; nSrc < tmp.length; ++nSrc)
if (!contains (aElementsToRemove, tmp[nSrc]))
tmp[nDst++] = tmp[nSrc];
return getCopy (tmp, 0, nDst);
}
开发者ID:phax,项目名称:ph-commons,代码行数:31,代码来源:ArrayHelper.java
示例7: getR
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Return the upper triangular factor
*
* @return R
*/
@Nonnull
@ReturnsMutableCopy
public Matrix getR ()
{
final Matrix aNewMatrix = new Matrix (m_nCols, m_nCols);
final double [] [] aNewArray = aNewMatrix.internalGetArray ();
for (int nRow = 0; nRow < m_nCols; nRow++)
{
final double [] aDstRow = aNewArray[nRow];
for (int j = 0; j < m_nCols; j++)
{
if (nRow < j)
aDstRow[j] = m_aQR[nRow][j];
else
if (nRow == j)
aDstRow[j] = m_aRdiag[nRow];
else
aDstRow[j] = 0.0;
}
}
return aNewMatrix;
}
开发者ID:phax,项目名称:ph-commons,代码行数:28,代码来源:QRDecomposition.java
示例8: getMatrix
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Get a submatrix.
*
* @param aRows
* Array of row indices.
* @param aCols
* Array of column indices.
* @return Matrix(aRows(:),aCols(:))
* @exception ArrayIndexOutOfBoundsException
* Submatrix indices
*/
@Nonnull
@ReturnsMutableCopy
public Matrix getMatrix (@Nonnull final int [] aRows, @Nonnull final int [] aCols)
{
final Matrix aNewMatrix = new Matrix (aRows.length, aCols.length);
final double [] [] aNewArray = aNewMatrix.internalGetArray ();
for (int nRow = 0; nRow < aRows.length; nRow++)
{
final int nRowIndex = aRows[nRow];
final double [] aSrcRow = m_aData[nRowIndex];
final double [] aDstRow = aNewArray[nRow];
for (int nCol = 0; nCol < aCols.length; nCol++)
aDstRow[nCol] = aSrcRow[aCols[nCol]];
}
return aNewMatrix;
}
开发者ID:phax,项目名称:ph-commons,代码行数:28,代码来源:Matrix.java
示例9: getConcatenated
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Get a new array that combines the passed two arrays, maintaining the order.
*
* @param aHeadArray
* The first array. May be <code>null</code>.
* @param aTailArray
* The second array. May be <code>null</code>.
* @return <code>null</code> if both array parameters are <code>null</code> -
* a non-<code>null</code> array with all elements in the correct
* order otherwise.
*/
@Nonnull
@ReturnsMutableCopy
public static boolean [] getConcatenated (@Nullable final boolean [] aHeadArray,
@Nullable final boolean... aTailArray)
{
// If first array is invalid, simply
if (isEmpty (aHeadArray))
return getCopy (aTailArray);
if (isEmpty (aTailArray))
return getCopy (aHeadArray);
// Start concatenating
final boolean [] ret = new boolean [aHeadArray.length + aTailArray.length];
System.arraycopy (aHeadArray, 0, ret, 0, aHeadArray.length);
System.arraycopy (aTailArray, 0, ret, aHeadArray.length, aTailArray.length);
return ret;
}
开发者ID:phax,项目名称:ph-commons,代码行数:29,代码来源:ArrayHelper.java
示例10: safeDecode
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Decode the string with the default encoding (US-ASCII is the preferred
* one).
*
* @param sEncoded
* The encoded string.
* @param nOptions
* Decoding options.
* @return <code>null</code> if decoding failed.
*/
@Nullable
@ReturnsMutableCopy
public static byte [] safeDecode (@Nullable final String sEncoded, final int nOptions)
{
if (sEncoded != null)
try
{
return decode (sEncoded, nOptions);
}
catch (final Exception ex)
{
// fall through
}
return null;
}
开发者ID:phax,项目名称:ph-commons,代码行数:26,代码来源:Base64.java
示例11: evictAllItemsBefore
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Delete all duplicate items that were created before the provided time.
*
* @param aRefDT
* The reference date time to compare to. May not be <code>null</code>.
* @return A non-<code>null</code> list of all evicted message IDs.
*/
@Nonnull
@ReturnsMutableCopy
public ICommonsList <String> evictAllItemsBefore (@Nonnull final LocalDateTime aRefDT)
{
final ICommonsList <String> aEvictItems = getAllMapped (x -> x.getDateTime ().isBefore (aRefDT),
IAS4DuplicateItem::getMessageID);
if (aEvictItems.isNotEmpty ())
m_aRWLock.writeLocked ( () -> {
for (final String sItemID : aEvictItems)
internalDeleteItem (sItemID);
});
return aEvictItems;
}
开发者ID:phax,项目名称:ph-as4,代码行数:21,代码来源:AS4DuplicateManager.java
示例12: if
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Try to match the Attachment Id. Otherwise, add all Attachments.
*
* @param sID
* Attachment ID to search
* @return Never <code>null</code>.
*/
@Nonnull
@ReturnsMutableCopy
private ICommonsList <Attachment> _getAttachmentsToAdd (@Nullable final String sID)
{
if (m_aAttachmentMap.containsKey (sID))
return new CommonsArrayList <> (m_aAttachmentMap.get (sID));
return new CommonsArrayList <> (m_aAttachmentMap.values ());
}
开发者ID:phax,项目名称:ph-as4,代码行数:17,代码来源:WSS4JAttachmentCallbackHandler.java
示例13:
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
@Nonnull
@ReturnsMutableCopy
public static Ebms3Description createEbms3Description (@Nonnull final Locale aLocale, @Nonnull final String sText)
{
ValueEnforcer.notNull (aLocale, "Locale");
ValueEnforcer.notNull (sText, "Text");
final Ebms3Description aDesc = new Ebms3Description ();
aDesc.setLang (aLocale.getLanguage ());
aDesc.setValue (sText);
return aDesc;
}
开发者ID:phax,项目名称:ph-as4,代码行数:13,代码来源:MessageHelperMethods.java
示例14: getAllAttrsWithLowercaseName
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* Get all attributes of the passed element as a map with a lowercase
* attribute name.
*
* @param aElement
* The source element to extract the attributes from. May not be
* <code>null</code>.
* @return A new map and never <code>null</code> but maybe empty.
*/
@Nonnull
@ReturnsMutableCopy
public static StringMap getAllAttrsWithLowercaseName (@Nonnull final IMicroElement aElement)
{
ValueEnforcer.notNull (aElement, "Element");
final StringMap ret = new StringMap ();
aElement.forAllAttributes ( (ns, name, value) -> ret.putIn (name.toLowerCase (Locale.US), value));
return ret;
}
开发者ID:phax,项目名称:ph-as4,代码行数:20,代码来源:AS4XMLHelper.java
示例15: getAllAttrsWithLowercaseNameWithRequired
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
@Nonnull
@ReturnsMutableCopy
public static StringMap getAllAttrsWithLowercaseNameWithRequired (@Nonnull final IMicroElement aElement,
@Nonnull final String... aRequiredAttributes)
{
final StringMap aAttributes = getAllAttrsWithLowercaseName (aElement);
for (final String sRequiredAttribute : aRequiredAttributes)
if (!aAttributes.containsKey (sRequiredAttribute))
throw new IllegalStateException (aElement.getTagName () +
" is missing required attribute '" +
sRequiredAttribute +
"'");
return aAttributes;
}
开发者ID:phax,项目名称:ph-as4,代码行数:15,代码来源:AS4XMLHelper.java
示例16: mapAttributeNodes
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* @param aNode
* Start node. May not be <code>null</code>.
* @param sNodeName
* The element name to be queried relative to the start node.
* @param sNodeKeyName
* The attribute name of the key.
* @param sNodeValueName
* The attribute name of the value.
* @return The non-<code>null</code> {@link Map}. @ In case a node is missing
* a key or value attribute.
*/
@Nonnull
@ReturnsMutableCopy
public static ICommonsOrderedMap <String, String> mapAttributeNodes (@Nonnull final IMicroElement aNode,
@Nonnull final String sNodeName,
@Nonnull final String sNodeKeyName,
@Nonnull final String sNodeValueName)
{
ValueEnforcer.notNull (aNode, "Node");
ValueEnforcer.notNull (sNodeName, "NodeName");
ValueEnforcer.notNull (sNodeKeyName, "NodeKeyName");
ValueEnforcer.notNull (sNodeValueName, "NodeValueName");
final ICommonsOrderedMap <String, String> ret = new CommonsLinkedHashMap <> ();
int nIndex = 0;
for (final IMicroElement eChild : aNode.getAllChildElements (sNodeName))
{
final String sName = eChild.getAttributeValue (sNodeKeyName);
if (sName == null)
throw new IllegalStateException (sNodeName +
"[" +
nIndex +
"] does not have key attribute '" +
sNodeKeyName +
"'");
final String sValue = eChild.getAttributeValue (sNodeValueName);
if (sValue == null)
throw new IllegalStateException (sNodeName +
"[" +
nIndex +
"] does not have value attribute '" +
sNodeValueName +
"'");
ret.put (sName, sValue);
++nIndex;
}
return ret;
}
开发者ID:phax,项目名称:ph-as4,代码行数:52,代码来源:AS4XMLHelper.java
示例17: PModePayloadProfile
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
@Nonnull
@ReturnsMutableCopy
private ICommonsOrderedMap <String, PModePayloadProfile> _generatePModePayloadProfile ()
{
final PModePayloadProfile aPModePayloadProfile = new PModePayloadProfile ("name",
new MimeType (EMimeContentType.EXAMPLE,
"example"),
"xsdfilename",
20001,
EMandatory.MANDATORY);
final ICommonsOrderedMap <String, PModePayloadProfile> aPModePayloadProfiles = new CommonsLinkedHashMap<> ();
aPModePayloadProfiles.put (aPModePayloadProfile.getName (), aPModePayloadProfile);
return aPModePayloadProfiles;
}
开发者ID:phax,项目名称:ph-as4,代码行数:15,代码来源:PModeMicroTypeConverterTest.java
示例18: PModeProperty
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
@Nonnull
@ReturnsMutableCopy
private ICommonsOrderedMap <String, PModeProperty> _generatePModeProperties ()
{
final PModeProperty aPModeProperty = new PModeProperty ("name",
"description",
PModeProperty.DATA_TYPE_STRING,
EMandatory.MANDATORY);
final ICommonsOrderedMap <String, PModeProperty> aPModeProperties = new CommonsLinkedHashMap<> ();
aPModeProperties.put (aPModeProperty.getName (), aPModeProperty);
return aPModeProperties;
}
开发者ID:phax,项目名称:ph-as4,代码行数:13,代码来源:PModeMicroTypeConverterTest.java
示例19: getAllProcessors
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* @return A list of all registered receiver handlers. Never <code>null</code>
* but maybe empty.
*/
@Nonnull
@ReturnsMutableCopy
public static ICommonsList <IAS4ServletPullRequestProcessorSPI> getAllProcessors ()
{
return s_aRWLock.readLocked ( () -> s_aProcessors.getClone ());
}
开发者ID:phax,项目名称:ph-as4,代码行数:11,代码来源:AS4ServletPullRequestProcessorManager.java
示例20: getAllProcessors
import com.helger.commons.annotation.ReturnsMutableCopy; //导入依赖的package包/类
/**
* @return A list of all registered receiver handlers. Never <code>null</code>
* but maybe empty.
*/
@Nonnull
@ReturnsMutableCopy
public static ICommonsList <IAS4ServletMessageProcessorSPI> getAllProcessors ()
{
return s_aRWLock.readLocked ( () -> s_aProcessors.getClone ());
}
开发者ID:phax,项目名称:ph-as4,代码行数:11,代码来源:AS4ServletMessageProcessorManager.java
注:本文中的com.helger.commons.annotation.ReturnsMutableCopy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论