Interface IAttributeContainerAny<KEYTYPE>
-
- Type Parameters:
KEYTYPE- Key type
- All Superinterfaces:
IAttributeContainer<KEYTYPE,Object>,ICloneable<ICommonsMap<KEYTYPE,Object>>,ICommonsMap<KEYTYPE,Object>,IGetterByKeyTrait<KEYTYPE>,Map<KEYTYPE,Object>
- All Known Implementing Classes:
AttributeContainerAny,AttributeContainerAnyConcurrent
public interface IAttributeContainerAny<KEYTYPE> extends IAttributeContainer<KEYTYPE,Object>
This is the writable extension of the<String, Object>.nullvalues are not allowed in this attribute containers.- Author:
- Philip Helger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.helger.commons.collection.attr.IAttributeContainer
IAttributeContainer.IAfterSetValueCallback<KEYTYPE,VALUETYPE>, IAttributeContainer.IBeforeSetValueCallback<KEYTYPE,VALUETYPE>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleangetAndSetFlag(KEYTYPE aName)Atomic operation to set a flag totrueif it was previously set tofalse(meaning not existing).IAttributeContainerAny<KEYTYPE>getClone()default EChangeputIn(KEYTYPE aName, boolean bValue)Set/overwrite an attribute value.default EChangeputIn(KEYTYPE aName, double dValue)Set/overwrite an attribute value.default EChangeputIn(KEYTYPE aName, float fValue)Set/overwrite an attribute value.default EChangeputIn(KEYTYPE aName, int nValue)Set/overwrite an attribute value.default EChangeputIn(KEYTYPE aName, long nValue)Set/overwrite an attribute value.default EChangeputIn(KEYTYPE aName, short nValue)Set/overwrite an attribute value.-
Methods inherited from interface com.helger.commons.collection.attr.IAttributeContainer
afterSetValueCallbacks, beforeSetValueCallbacks, getAsBoolean, getAsDouble, getAsFloat, getAsInt, getAsLong, getValue, putAllIn, putIn
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsMap
addAll, containsAnyEntry, containsAnyKey, containsAnyValue, copyOfEntrySet, copyOfKeySet, copyOfKeySet, copyOfValues, copyOfValues, copyOfValuesMapped, copyOfValuesMapped, createInstance, findFirstEntry, findFirstKey, findFirstValue, forEach, forEachKey, forEachKey, forEachValue, forEachValue, getAsUnmodifiable, getFirstEntry, getFirstEntry, getFirstKey, getFirstKey, getFirstValue, getFirstValue, getSortedByKey, getSortedByValue, getSwappedKeyValues, isNotEmpty, put, putAll, putAll, putAllMapped, putAllMapped, putAllMapped, putIf, putIfNotNull, removeAll, removeIf, removeIfKey, removeIfValue, removeObject, setAll
-
Methods inherited from interface com.helger.commons.traits.IGetterByKeyTrait
containsNonNullValue, containsNullValue, getAsBigDecimal, getAsBigDecimal, getAsBigInteger, getAsBigInteger, getAsBoolean, getAsBooleanObj, getAsByte, getAsByte, getAsByteArray, getAsByteObj, getAsChar, getAsChar, getAsCharArray, getAsCharArray, getAsCharObj, getAsDouble, getAsDoubleObj, getAsFloat, getAsFloatObj, getAsInt, getAsIntObj, getAsLocalDate, getAsLocalDate, getAsLocalDate, getAsLocalDateTime, getAsLocalDateTime, getAsLocalDateTime, getAsLocalTime, getAsLocalTime, getAsLocalTime, getAsLong, getAsLongObj, getAsShort, getAsShort, getAsShortObj, getAsSqlBlob, getAsSqlClob, getAsSqlDate, getAsSqlNClob, getAsSqlRowId, getAsSqlTime, getAsSqlTimestamp, getAsString, getAsString, getAsStringList, getAsStringList, getAsStringSet, getAsStringSet, getCastedValue, getCastedValue, getCastedValue, getCastedValue, getConvertedValue, getConvertedValue, getSafeCastedValue, getSafeCastedValue, getValueClass, hasStringValue, hasStringValue, onSafeCastError
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
putIn
@Nonnull default EChange putIn(@Nonnull KEYTYPE aName, boolean bValue)
Set/overwrite an attribute value. This is a shortcut forputIn (aName, Boolean.valueOf (bValue));- Parameters:
aName- The name of the attribute. May not benull.bValue- The value of the attribute.- Returns:
EChange.CHANGEDif something changed,EChange.UNCHANGEDotherwise.
-
putIn
@Nonnull default EChange putIn(@Nonnull KEYTYPE aName, int nValue)
Set/overwrite an attribute value. This is a shortcut forputIn (aName, Integer.valueOf (nValue));- Parameters:
aName- The name of the attribute. May not benull.nValue- The value of the attribute.- Returns:
EChange.CHANGEDif something changed,EChange.UNCHANGEDotherwise.
-
putIn
@Nonnull default EChange putIn(@Nonnull KEYTYPE aName, long nValue)
Set/overwrite an attribute value. This is a shortcut forputIn (aName, Long.valueOf (nValue));- Parameters:
aName- The name of the attribute. May not benull.nValue- The value of the attribute.- Returns:
EChange.CHANGEDif something changed,EChange.UNCHANGEDotherwise.
-
putIn
@Nonnull default EChange putIn(@Nonnull KEYTYPE aName, short nValue)
Set/overwrite an attribute value. This is a shortcut forputIn (aName, Short.valueOf (nValue));- Parameters:
aName- The name of the attribute. May not benull.nValue- The value of the attribute.- Returns:
EChange.CHANGEDif something changed,EChange.UNCHANGEDotherwise.
-
putIn
@Nonnull default EChange putIn(@Nonnull KEYTYPE aName, float fValue)
Set/overwrite an attribute value. This is a shortcut forputIn (aName, Float.valueOf (fValue));- Parameters:
aName- The name of the attribute. May not benull.fValue- The value of the attribute.- Returns:
EChange.CHANGEDif something changed,EChange.UNCHANGEDotherwise.
-
putIn
@Nonnull default EChange putIn(@Nonnull KEYTYPE aName, double dValue)
Set/overwrite an attribute value. This is a shortcut forputIn (aName, Double.valueOf (dValue));- Parameters:
aName- The name of the attribute. May not benull.dValue- The value of the attribute.- Returns:
EChange.CHANGEDif something changed,EChange.UNCHANGEDotherwise.
-
getAndSetFlag
default boolean getAndSetFlag(@Nonnull KEYTYPE aName)
Atomic operation to set a flag totrueif it was previously set tofalse(meaning not existing). There is no possibility to define a value for this flag. The value used isBoolean.TRUE.Map.containsKey(Object)can be used to check if the attribute is already present.- Parameters:
aName- The name of the flag to set.- Returns:
- The old value of the flag. If the flag was not present previously,
than
falseis returned, whereas if the flag was already present,trueis returned. Any other than the first call for the same flag is always returningtrue.
-
getClone
@Nonnull @ReturnsMutableCopy IAttributeContainerAny<KEYTYPE> getClone()
- Specified by:
getClonein interfaceIAttributeContainer<KEYTYPE,Object>- Specified by:
getClonein interfaceICloneable<KEYTYPE>- Returns:
- A 100% deep-copy of the implementing class.
-
-