当前位置: 首页>>代码示例>>Java>>正文


Java EChange.UNCHANGED属性代码示例

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


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

示例1: updateMPC

@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,代码行数:25,代码来源:MPCManager.java

示例2: deleteMPC

@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,代码行数:23,代码来源:MPCManager.java

示例3: deletePMode

@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,代码行数:23,代码来源:PModeManager.java

示例4: add

/**
 * 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,代码行数:32,代码来源:PSXPathVariables.java

示例5: addNode

@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,代码行数:16,代码来源:DirectedGraph.java

示例6: markMPCDeleted

@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,代码行数:28,代码来源:MPCManager.java

示例7: updatePMode

@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,代码行数:36,代码来源:PModeManager.java

示例8: markPModeDeleted

@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,代码行数:29,代码来源:PModeManager.java

示例9: _queueUniqueWorkItem

/**
 * 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,代码行数:40,代码来源:PDIndexerManager.java

示例10: addAll

/**
 * Add all elements of the passed enumeration to this collection.
 *
 * @param aEnum
 *        The enumeration to be iterated and the elements to be added. May be
 *        <code>null</code>.
 * @return {@link EChange#CHANGED} if at least one element was added,
 *         {@link EChange#UNCHANGED}. Never <code>null</code>.
 */
@Nonnull
default EChange addAll (@Nullable final Enumeration <? extends ELEMENTTYPE> aEnum)
{
  EChange eChange = EChange.UNCHANGED;
  if (aEnum != null)
    while (aEnum.hasMoreElements ())
      eChange = eChange.or (add (aEnum.nextElement ()));
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:18,代码来源:ICommonsCollection.java

示例11: setAreaCode

@Nonnull
public EChange setAreaCode (@Nullable final String sAreaCode)
{
  final String sRealAreaCode = sAreaCode;
  if (EqualsHelper.equals (m_sAreaCode, sRealAreaCode))
    return EChange.UNCHANGED;
  m_sAreaCode = sRealAreaCode;
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:9,代码来源:TelephoneNumber.java

示例12: putAllIn

/**
 * Add all values into the container identified by the passed key-value-map.
 *
 * @param aMap
 *        The key-value-map to use. May not be <code>null</code>.
 * @return {@link EChange}
 */
@Nonnull
default EChange putAllIn (@Nonnull final Map <? extends KEYTYPE, ? extends VALUETYPE> aMap)
{
  EChange eChange = EChange.UNCHANGED;
  for (final Map.Entry <? extends KEYTYPE, ? extends VALUETYPE> aEntry : aMap.entrySet ())
    eChange = eChange.or (putSingle (aEntry.getKey (), aEntry.getValue ()));
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:15,代码来源:IMultiMap.java

示例13: putAllIn

/**
 * Add all values into the container identified by the passed key-value-map.
 *
 * @param aMap
 *        The key-value-map to use. May not be <code>null</code>.
 * @return {@link EChange}
 */
@Nonnull
default EChange putAllIn (@Nonnull final Map <? extends KEYTYPE1, ? extends Map <KEYTYPE2, VALUETYPE>> aMap)
{
  EChange eChange = EChange.UNCHANGED;
  for (final Map.Entry <? extends KEYTYPE1, ? extends Map <KEYTYPE2, VALUETYPE>> aEntry : aMap.entrySet ())
    for (final Map.Entry <KEYTYPE2, VALUETYPE> aEntry2 : aEntry.getValue ().entrySet ())
      eChange = eChange.or (putSingle (aEntry.getKey (), aEntry2.getKey (), aEntry2.getValue ()));
  return eChange;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:16,代码来源:IMultiMapMapBased.java

示例14: replaceChild

/**
 * Replace the passed old child with the new child.
 *
 * @param aOldChild
 *        The child to be removed. May not be <code>null</code>.
 * @param aNewChild
 *        The child to be inserted instead. May not be <code>null</code>.
 * @return {@link EChange#CHANGED} if the child was successfully replaced,
 *         {@link EChange#UNCHANGED} if old child and new child are identical.
 */
@Nonnull
default EChange replaceChild (@Nonnull final IMicroNode aOldChild, @Nonnull final IMicroNode aNewChild)
{
  ValueEnforcer.notNull (aOldChild, "OldChild");
  ValueEnforcer.notNull (aNewChild, "NewChild");

  if (aOldChild.equals (aNewChild))
    return EChange.UNCHANGED;
  insertBefore (aNewChild, aOldChild);
  removeChild (aOldChild);
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-commons,代码行数:22,代码来源:IMicroNode.java

示例15: setAddress

@Nonnull
public EChange setAddress (@Nullable final PersonAddress aAddress)
{
  if (EqualsHelper.equals (m_aAddress, aAddress))
    return EChange.UNCHANGED;
  m_aAddress = aAddress;
  return EChange.CHANGED;
}
 
开发者ID:phax,项目名称:ph-masterdata,代码行数:8,代码来源:Person.java


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