本文整理汇总了Java中com.helger.commons.state.EChange.CHANGED属性的典型用法代码示例。如果您正苦于以下问题:Java EChange.CHANGED属性的具体用法?Java EChange.CHANGED怎么用?Java EChange.CHANGED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.helger.commons.state.EChange
的用法示例。
在下文中一共展示了EChange.CHANGED属性的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;
}
示例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;
}
示例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;
}
示例4: setDeletion
@Nonnull
public final EChange setDeletion (@Nonnull final LocalDateTime aDeletionDT,
@Nonnull @Nonempty final String sDeletionUserID)
{
ValueEnforcer.notNull (aDeletionDT, "DeletionDT");
ValueEnforcer.notEmpty (sDeletionUserID, "DeletionUserID");
if (m_aDeletionDT != null)
{
// Object is already deleted...
return EChange.UNCHANGED;
}
m_aDeletionDT = aDeletionDT;
m_sDeletionUserID = sDeletionUserID;
return EChange.CHANGED;
}
示例5: onInit
@Override
@Nonnull
protected EChange onInit ()
{
// Create default MPC
createMPC (new MPC (CAS4.DEFAULT_MPC_ID));
return EChange.CHANGED;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例10: addUniqueFunction
/**
* Add a new function.
*
* @param aName
* The qualified name of the function
* @param nArity
* The number of parameters of the function
* @param aFunction
* The function to be used. May not be <code>null</code>.
* @return {@link EChange}
*/
@Nonnull
public EChange addUniqueFunction (@Nonnull final QName aName,
@Nonnegative final int nArity,
@Nonnull final XPathFunction aFunction)
{
ValueEnforcer.notNull (aFunction, "Function");
final XPathFunctionKey aFunctionKey = new XPathFunctionKey (aName, nArity);
if (m_aMap.containsKey (aFunctionKey))
return EChange.UNCHANGED;
m_aMap.put (aFunctionKey, aFunction);
return EChange.CHANGED;
}
示例11: removeAllIncomingRelations
@Nonnull
public EChange removeAllIncomingRelations ()
{
if (!hasIncomingRelations ())
return EChange.UNCHANGED;
m_aIncoming = null;
return EChange.CHANGED;
}
示例12: addAllFrom
/**
* Add all functions from the other function resolver into this resolver.
*
* @param aOther
* The function resolver to import the functions from. May not be
* <code>null</code>.
* @param bOverwrite
* if <code>true</code> existing functions will be overwritten with the
* new functions, otherwise the old functions are kept.
* @return {@link EChange}
*/
@Nonnull
public EChange addAllFrom (@Nonnull final MapBasedXPathFunctionResolver aOther, final boolean bOverwrite)
{
ValueEnforcer.notNull (aOther, "Other");
EChange eChange = EChange.UNCHANGED;
for (final Map.Entry <XPathFunctionKey, XPathFunction> aEntry : aOther.m_aMap.entrySet ())
if (bOverwrite || !m_aMap.containsKey (aEntry.getKey ()))
{
m_aMap.put (aEntry.getKey (), aEntry.getValue ());
eChange = EChange.CHANGED;
}
return eChange;
}
示例13: set
@Nonnull
public EChange set (final int nValue)
{
if (m_nValue == nValue)
return EChange.UNCHANGED;
m_nValue = nValue;
onAfterChange ();
return EChange.CHANGED;
}
示例14: set
@Nonnull
public EChange set (final float fValue)
{
if (EqualsHelper.equals (fValue, m_fValue))
return EChange.UNCHANGED;
m_fValue = fValue;
onAfterChange ();
return EChange.CHANGED;
}
示例15: setNamespaceContext
/**
* Set the namespace context (prefix to namespace URL mapping) to be used.
*
* @param aNSContext
* The namespace context to be used. May be <code>null</code>.
* @return {@link EChange}
* @since 8.5.3
*/
@Nonnull
public EChange setNamespaceContext (@Nullable final INamespaceContext aNSContext)
{
if (EqualsHelper.equals (aNSContext, m_aNSContext))
return EChange.UNCHANGED;
m_aNSContext = aNSContext;
return EChange.CHANGED;
}