本文整理汇总了Java中com.helger.commons.state.EChange.valueOf方法的典型用法代码示例。如果您正苦于以下问题:Java EChange.valueOf方法的具体用法?Java EChange.valueOf怎么用?Java EChange.valueOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.helger.commons.state.EChange
的用法示例。
在下文中一共展示了EChange.valueOf方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeRelation
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
public EChange removeRelation (@Nullable final IMutableGraphRelation aRelation)
{
if (aRelation == null || m_aRelations == null)
return EChange.UNCHANGED;
return EChange.valueOf (m_aRelations.remove (aRelation.getID ()) != null);
}
示例2: registerEventTarget
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
public EChange registerEventTarget (@Nonnull final EMicroEvent eEventType, @Nonnull final IMicroEventTarget aTarget)
{
ValueEnforcer.notNull (eEventType, "EventType");
ValueEnforcer.notNull (aTarget, "EventTarget");
if (m_aEventTargets == null)
m_aEventTargets = new CommonsEnumMap <> (EMicroEvent.class);
final CallbackList <IMicroEventTarget> aSet = m_aEventTargets.computeIfAbsent (eEventType,
k -> new CallbackList <> ());
return EChange.valueOf (aSet.add (aTarget));
}
示例3: removeHeader
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
public EChange removeHeader (@Nullable final String sName, @Nullable final String sValue)
{
final String sUnifiedName = getUnifiedName (sName);
final ICommonsList <String> aValues = m_aHeaders.get (sUnifiedName);
final boolean bRemoved = aValues != null && aValues.remove (sValue);
if (bRemoved && aValues.isEmpty ())
{
// If the last value was removed, remove the whole header
m_aHeaders.remove (sUnifiedName);
}
return EChange.valueOf (bRemoved);
}
示例4: deleteItem
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
default EChange deleteItem (@Nullable final String sID)
{
return EChange.valueOf (sID != null && getAndRemoveEntry (x -> x.getID ().equals (sID)) != null);
}
示例5: addExchangeRatio
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
public EChange addExchangeRatio (@Nonnull final ExchangeRatio aExchangeRatio)
{
ValueEnforcer.notNull (aExchangeRatio, "ExchangeRatio");
return EChange.valueOf (m_aList.add (aExchangeRatio));
}
示例6: mergeWith
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
@Nonnull
public EChange mergeWith (@Nonnull final ExchangeRatioList aList)
{
ValueEnforcer.notNull (aList, "List");
return EChange.valueOf (m_aList.addAll (aList.m_aList));
}
示例7: putSingle
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
* Add a single value into the container identified by the passed key.
*
* @param aKey
* The key to use. May not be <code>null</code>.
* @param aInnerKey
* The key for the inner map to use. May not be <code>null</code>.
* @param aValue
* The value to be added. May be <code>null</code>.
* @return {@link EChange}
*/
@Nonnull
default EChange putSingle (@Nonnull final KEYTYPE1 aKey,
@Nonnull final KEYTYPE2 aInnerKey,
@Nullable final VALUETYPE aValue)
{
return EChange.valueOf (getOrCreate (aKey).put (aInnerKey, aValue) != null);
}
示例8: removeObject
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
* Remove the object with the passed key from this map. <br>
* Note: this method returns {@link EChange#UNCHANGED} even if removal was
* successful if the value was <code>null</code>.
*
* @param aKey
* The key to be removed. May be <code>null</code>.
* @return {@link EChange#CHANGED} if the removal was successful,
* {@link EChange#UNCHANGED} if removal fails.
* @see #remove(Object)
*/
@Nonnull
default EChange removeObject (@Nullable final KEYTYPE aKey)
{
return EChange.valueOf (remove (aKey) != null);
}
示例9: addObject
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
* add the provided element to the collection using {@link #add(Object)} but
* returning a more structured return value.
*
* @param aElement
* The element to be add. May be <code>null</code>.
* @return {@link EChange#CHANGED} if the element was added successfully,
* {@link EChange#UNCHANGED} otherwise (e.g. because if is already
* contained).
* @see #add(Object)
*/
@Nonnull
default EChange addObject (@Nullable final ELEMENTTYPE aElement)
{
return EChange.valueOf (add (aElement));
}
示例10: removeObject
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
* Remove the provided element from the collection using
* {@link #remove(Object)} but returning a more structured return value.
*
* @param aElement
* The element to be removed. May be <code>null</code>.
* @return {@link EChange#CHANGED} if the element was removed successfully,
* {@link EChange#UNCHANGED} otherwise.
* @see #remove(Object)
*/
@Nonnull
default EChange removeObject (@Nullable final ELEMENTTYPE aElement)
{
return EChange.valueOf (remove (aElement));
}
示例11: removeRules
import com.helger.commons.state.EChange; //导入方法依赖的package包/类
/**
* Remove all rules matching the passed predicate.
*
* @param aFilter
* The predicate to apply for deletion. May not be <code>null</code>.
* @return {@link EChange#CHANGED} it at least one rule was removed,
* {@link EChange#UNCHANGED} otherwise.
* @since 5.0.0
*/
@Nonnull
public EChange removeRules (@Nonnull final Predicate <? super ICSSTopLevelRule> aFilter)
{
return EChange.valueOf (m_aRules.removeIf (aFilter));
}