• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EChange类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.helger.commons.state.EChange的典型用法代码示例。如果您正苦于以下问题:Java EChange类的具体用法?Java EChange怎么用?Java EChange使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EChange类属于com.helger.commons.state包,在下文中一共展示了EChange类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateMPC

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange updateMPC (@Nonnull final IMPC aMPC)
{
  ValueEnforcer.notNull (aMPC, "MPC");
  final MPC aRealMPC = getOfID (aMPC.getID ());
  if (aRealMPC == null)
  {
    AuditHelper.onAuditModifyFailure (MPC.OT, aMPC.getID (), "no-such-id");
    return EChange.UNCHANGED;
  }

  m_aRWLock.writeLock ().lock ();
  try
  {
    BusinessObjectHelper.setLastModificationNow (aRealMPC);
    internalUpdateItem (aRealMPC);
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }
  AuditHelper.onAuditModifySuccess (MPC.OT, "all", aRealMPC.getID ());

  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:26,代码来源:MPCManager.java


示例2: deleteMPC

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange deleteMPC (@Nullable final String sMPCID)
{
  final MPC aDeletedMPC = getOfID (sMPCID);
  if (aDeletedMPC == null)
  {
    AuditHelper.onAuditDeleteFailure (MPC.OT, "no-such-object-id", sMPCID);
    return EChange.UNCHANGED;
  }

  m_aRWLock.writeLock ().lock ();
  try
  {
    internalDeleteItem (sMPCID);
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }
  AuditHelper.onAuditDeleteSuccess (MPC.OT, sMPCID);

  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:24,代码来源:MPCManager.java


示例3: deletePMode

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange deletePMode (@Nullable final String sPModeID)
{
  final PMode aDeletedPMode = getOfID (sPModeID);
  if (aDeletedPMode == null)
  {
    AuditHelper.onAuditDeleteFailure (PMode.OT, "no-such-object-id", sPModeID);
    return EChange.UNCHANGED;
  }

  m_aRWLock.writeLock ().lock ();
  try
  {
    internalDeleteItem (sPModeID);
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }
  AuditHelper.onAuditDeleteSuccess (PMode.OT, sPModeID);

  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:24,代码来源:PModeManager.java


示例4: add

import com.helger.commons.state.EChange; //导入依赖的package包/类
/**
 * Add a new variable.
 *
 * @param sName
 *        The name of the variable. May neither be <code>null</code> nor
 *        empty.
 * @param sValue
 *        The value of the variable. May neither be <code>null</code> nor
 *        empty.
 * @return {@link EChange#UNCHANGED} if a variable with the same name is
 *         already present. Never <code>null</code>.
 */
@Nonnull
public EChange add (@Nonnull @Nonempty final String sName, @Nonnull @Nonempty final String sValue)
{
  ValueEnforcer.notEmpty (sName, "Name");
  ValueEnforcer.notEmpty (sValue, "Value");

  // Prepend the "$" prefix to the variable name
  final String sRealName = PSXPathQueryBinding.PARAM_VARIABLE_PREFIX + sName;
  if (m_aMap.containsKey (sRealName))
    return EChange.UNCHANGED;

  // Apply all existing variables to this variable value!
  // This ensures that all variables used in variables are resolved correctly
  // as long as the order of declaration is correct.
  // Additionally this means that the order of the variables in this class is
  // irrelevant
  final String sRealValue = getAppliedReplacement (sValue);
  m_aMap.put (sRealName, sRealValue);
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-schematron,代码行数:33,代码来源:PSXPathVariables.java


示例5: setUndeletion

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public final EChange setUndeletion (@Nonnull final LocalDateTime aUndeletionDT,
                                    @Nonnull @Nonempty final String sUndeletionUserID)
{
  ValueEnforcer.notNull (aUndeletionDT, "UndeletionDT");
  ValueEnforcer.notEmpty (sUndeletionUserID, "UndeletionUserID");

  if (m_aDeletionDT == null)
  {
    // Object is not deleted and can therefore not be undeleted
    return EChange.UNCHANGED;
  }

  m_aDeletionDT = null;
  m_sDeletionUserID = null;

  // Last modification AFTER deletion was reverted
  setLastModification (aUndeletionDT, sUndeletionUserID);
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:21,代码来源:AbstractBusinessObject.java


示例6: addAllMapped

import com.helger.commons.state.EChange; //导入依赖的package包/类
/**
 * Add all passed elements matching the provided filter after performing a
 * mapping using the provided function.
 *
 * @param aElements
 *        The elements to be added after mapping. May be <code>null</code>.
 * @param aMapper
 *        The mapping function to be executed for all provided elements. May
 *        not be <code>null</code>.
 * @param aFilter
 *        The filter to be applied on the mapped element. May be
 *        <code>null</code>.
 * @return {@link EChange#CHANGED} if at least one element was added,
 *         {@link EChange#UNCHANGED}. Never <code>null</code>.
 * @param <SRCTYPE>
 *        The source type to be mapped from
 * @since 8.5.2
 */
@Nonnull
default <SRCTYPE> EChange addAllMapped (@Nullable final SRCTYPE [] aElements,
                                        @Nonnull final Function <? super SRCTYPE, ? extends ELEMENTTYPE> aMapper,
                                        @Nullable final Predicate <? super ELEMENTTYPE> aFilter)
{
  ValueEnforcer.notNull (aMapper, "Mapper");

  if (aFilter == null)
    return addAllMapped (aElements, aMapper);

  EChange eChange = EChange.UNCHANGED;
  if (aElements != null)
    for (final SRCTYPE aValue : aElements)
    {
      final ELEMENTTYPE aMapped = aMapper.apply (aValue);
      if (aFilter.test (aMapped))
        eChange = eChange.or (add (aMapped));
    }
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:39,代码来源:ICommonsCollection.java


示例7: setAddress

import com.helger.commons.state.EChange; //导入依赖的package包/类
/**
 * Set the address part of the email address. Performs a validity check of the
 * email address.
 *
 * @param sAddress
 *        The address part to be set.
 * @return {@link EChange#CHANGED} if the address was valid and different from
 *         the existing one. Returns {@link EChange#UNCHANGED} if the email
 *         address was the same as before, or the email address itself was
 *         invalid.
 */
@Nonnull
public EChange setAddress (@Nullable final String sAddress)
{
  final String sRealAddress = EmailAddressHelper.getUnifiedEmailAddress (sAddress);
  if (EqualsHelper.equals (sRealAddress, m_sAddress))
    return EChange.UNCHANGED;

  // Check only without MX record check here, because this is a performance
  // bottleneck when having multiple customers
  if (sRealAddress != null && !EmailAddressHelper.isValid (sRealAddress))
  {
    s_aLogger.error ("Found an illegal email address: '" + sRealAddress + "'");
    return EChange.UNCHANGED;
  }
  m_sAddress = sRealAddress;
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:29,代码来源:ExtendedEmailAddress.java


示例8: removeIf

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
default EChange removeIf (@Nonnull final Predicate <? super Map.Entry <? extends KEYTYPE, ? extends VALUETYPE>> aFilter)
{
  ValueEnforcer.notNull (aFilter, "Filter");
  EChange ret = EChange.UNCHANGED;
  final Iterator <Map.Entry <KEYTYPE, VALUETYPE>> it = entrySet ().iterator ();
  while (it.hasNext ())
  {
    if (aFilter.test (it.next ()))
    {
      it.remove ();
      ret = EChange.CHANGED;
    }
  }
  return ret;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:17,代码来源:ICommonsMap.java


示例9: addNode

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange addNode (@Nonnull final IMutableDirectedGraphNode aNode)
{
  ValueEnforcer.notNull (aNode, "Node");

  if (!isChangingConnectedObjectsAllowed () && aNode.hasRelations ())
    throw new IllegalArgumentException ("The node to be added already has incoming and/or outgoing relations and this is not allowed!");

  final String sID = aNode.getID ();
  if (m_aNodes.containsKey (sID))
    return EChange.UNCHANGED;
  m_aNodes.put (sID, aNode);

  _invalidateCache ();
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:17,代码来源:DirectedGraph.java


示例10: onRead

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Override
@Nonnull
protected EChange onRead (@Nonnull final IMicroDocument aDoc)
{
  // Read all child elements independent of the name - soft migration
  final Class <IMPLTYPE> aDataTypeClass = getDataTypeClass ();
  final Wrapper <EChange> aChange = new Wrapper <> (EChange.UNCHANGED);

  aDoc.getDocumentElement ().forAllChildElements (m_aReadElementFilter, eItem -> {
    final IMPLTYPE aItem = MicroTypeConverter.convertToNative (eItem, aDataTypeClass);
    _addItem (aItem, EDAOActionType.CREATE);
    if (aItem instanceof IDAOReadChangeAware)
      if (((IDAOReadChangeAware) aItem).isReadChanged ())
      {
        // Remember that something was changed while reading
        aChange.set (EChange.CHANGED);
      }
  });
  return aChange.get ();
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:21,代码来源:AbstractMapBasedWALDAO.java


示例11: clearCachedSize

import com.helger.commons.state.EChange; //导入依赖的package包/类
/**
 * Remove a single resource from the cache.
 *
 * @param aRes
 *        The resource to be removed. May be <code>null</code>.
 * @return Never <code>null</code>.
 */
@Nonnull
public EChange clearCachedSize (@Nullable final IReadableResource aRes)
{
  if (aRes == null)
    return EChange.UNCHANGED;

  return m_aRWLock.writeLocked ( () -> {
    // Existing resource?
    if (m_aImageData.remove (aRes) != null)
      return EChange.CHANGED;

    // Non-existing resource?
    if (m_aNonExistingResources.remove (aRes))
      return EChange.CHANGED;

    return EChange.UNCHANGED;
  });
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:26,代码来源:ImageDataManager.java


示例12: onRemoveChildAtIndex

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Override
@Nonnull
protected final EChange onRemoveChildAtIndex (@Nonnegative final int nIndex)
{
  // Resolve index - may be invalid
  final IMicroNode aChildNode = getChildAtIndex (nIndex);
  if (aChildNode == null)
    return EChange.UNCHANGED;

  if (!aChildNode.hasParent ())
    throw new MicroException ("Internal inconsistency: the passed child node to be removed has no parent!");

  // Main removal
  if (m_aChildren.remove (nIndex) != aChildNode)
    throw new MicroException ("Internal inconsistency: remove resulted in an illegal object!");

  _afterRemoveChildOfThis (aChildNode);
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:20,代码来源:AbstractMicroNodeWithChildren.java


示例13: onInit

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Override
@Nonnull
protected EChange onInit ()
{
  // Create default MPC
  createMPC (new MPC (CAS4.DEFAULT_MPC_ID));
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:9,代码来源:MPCManager.java


示例14: markMPCDeleted

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange markMPCDeleted (@Nullable final String sMPCID)
{
  final MPC aDeletedMPC = getOfID (sMPCID);
  if (aDeletedMPC == null)
  {
    AuditHelper.onAuditDeleteFailure (MPC.OT, "no-such-object-id", sMPCID);
    return EChange.UNCHANGED;
  }

  m_aRWLock.writeLock ().lock ();
  try
  {
    if (BusinessObjectHelper.setDeletionNow (aDeletedMPC).isUnchanged ())
    {
      AuditHelper.onAuditDeleteFailure (MPC.OT, "already-deleted", sMPCID);
      return EChange.UNCHANGED;
    }
    internalMarkItemDeleted (aDeletedMPC);
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }
  AuditHelper.onAuditDeleteSuccess (MPC.OT, sMPCID);

  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:29,代码来源:MPCManager.java


示例15: updatePMode

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange updatePMode (@Nonnull final IPMode aPMode)
{
  ValueEnforcer.notNull (aPMode, "PMode");
  final PMode aRealPMode = getOfID (aPMode.getID ());
  if (aRealPMode == null)
  {
    AuditHelper.onAuditModifyFailure (PMode.OT, aPMode.getID (), "no-such-id");
    return EChange.UNCHANGED;
  }

  m_aRWLock.writeLock ().lock ();
  try
  {
    aRealPMode.setInitiator (aPMode.getInitiator ());
    aRealPMode.setResponder (aPMode.getResponder ());
    aRealPMode.setAgreement (aPMode.getAgreement ());
    aRealPMode.setMEP (aPMode.getMEP ());
    aRealPMode.setMEPBinding (aPMode.getMEPBinding ());
    aRealPMode.setLeg1 (aPMode.getLeg1 ());
    aRealPMode.setLeg2 (aPMode.getLeg2 ());
    aRealPMode.setPayloadService (aPMode.getPayloadService ());
    aRealPMode.setReceptionAwareness (aPMode.getReceptionAwareness ());

    BusinessObjectHelper.setLastModificationNow (aRealPMode);
    internalUpdateItem (aRealPMode);
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }
  AuditHelper.onAuditModifySuccess (PMode.OT, "all", aRealPMode.getID ());
  s_aLogger.info ("Updated PMode with ID '" + aPMode.getID () + "'");

  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:37,代码来源:PModeManager.java


示例16: markPModeDeleted

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange markPModeDeleted (@Nullable final String sPModeID)
{
  final PMode aDeletedPMode = getOfID (sPModeID);
  if (aDeletedPMode == null)
  {
    AuditHelper.onAuditDeleteFailure (PMode.OT, "no-such-object-id", sPModeID);
    return EChange.UNCHANGED;
  }

  m_aRWLock.writeLock ().lock ();
  try
  {
    if (BusinessObjectHelper.setDeletionNow (aDeletedPMode).isUnchanged ())
    {
      AuditHelper.onAuditDeleteFailure (PMode.OT, "already-deleted", sPModeID);
      return EChange.UNCHANGED;
    }
    internalMarkItemDeleted (aDeletedPMode);
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }
  AuditHelper.onAuditDeleteSuccess (PMode.OT, sPModeID);
  s_aLogger.info ("Marked PMode with ID '" + aDeletedPMode.getID () + "' as deleted");

  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-as4,代码行数:30,代码来源:PModeManager.java


示例17: _queueUniqueWorkItem

import com.helger.commons.state.EChange; //导入依赖的package包/类
/**
 * Queue a single work item of any type. If the item is already in the queue,
 * it is ignored.
 *
 * @param aWorkItem
 *        Work item to be queued. May not be <code>null</code>.
 * @return {@link EChange#CHANGED} if it was queued
 */
@Nonnull
private EChange _queueUniqueWorkItem (@Nonnull final IIndexerWorkItem aWorkItem)
{
  ValueEnforcer.notNull (aWorkItem, "WorkItem");

  // Check for duplicate
  m_aRWLock.writeLock ().lock ();
  try
  {
    if (!m_aUniqueItems.add (aWorkItem))
    {
      s_aLogger.info ("Ignoring work item " +
                      aWorkItem.getLogText () +
                      " because it is already in the queue/re-index list!");
      return EChange.UNCHANGED;
    }
  }
  finally
  {
    m_aRWLock.writeLock ().unlock ();
  }

  // Queue it
  m_aIndexerWorkQueue.queueObject (aWorkItem);
  s_aLogger.info ("Queued work item " + aWorkItem.getLogText ());

  // Remove the entry from the dead list to avoid spamming the dead list
  if (m_aDeadList.getAndRemoveEntry (x -> x.getWorkItem ().equals (aWorkItem)) != null)
    s_aLogger.info ("Removed the new work item " + aWorkItem.getLogText () + " from the dead list");

  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:peppol-directory,代码行数:41,代码来源:PDIndexerManager.java


示例18: setState

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange setState (@Nullable final String sState, @Nonnull final Locale aSortLocale)
{
  final String sRealState = PostalAddressHelper.getUnifiedState (sState, aSortLocale);
  if (EqualsHelper.equals (m_sState, sRealState))
    return EChange.UNCHANGED;
  m_sState = sRealState;
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:10,代码来源:PostalAddress.java


示例19: setCity

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange setCity (@Nullable final String sCity, @Nonnull final Locale aSortLocale)
{
  final String sRealCity = PostalAddressHelper.getUnifiedCity (sCity, aSortLocale);
  if (EqualsHelper.equals (m_sCity, sRealCity))
    return EChange.UNCHANGED;
  m_sCity = sRealCity;
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:10,代码来源:PostalAddress.java


示例20: setType

import com.helger.commons.state.EChange; //导入依赖的package包/类
@Nonnull
public EChange setType (@Nullable final IEmailAddressType aAddressType)
{
  if (EqualsHelper.equals (aAddressType, m_aAddressType))
    return EChange.UNCHANGED;
  m_aAddressType = aAddressType;
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:9,代码来源:ExtendedEmailAddress.java



注:本文中的com.helger.commons.state.EChange类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NodeTypes类代码示例发布时间:2022-05-22
下一篇:
Java Checkbox类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap