Interface IAttributeContainer<KEYTYPE,VALUETYPE>
- Type Parameters:
KEYTYPE- Key typeVALUETYPE- Value type
- All Superinterfaces:
ICloneable<ICommonsMap<KEYTYPE,,VALUETYPE>> ICommonsMap<KEYTYPE,,VALUETYPE> IGetterByKeyTrait<KEYTYPE>,Map<KEYTYPE,VALUETYPE>
- All Known Subinterfaces:
IAttributeContainerAny<KEYTYPE>,IStringMap
- All Known Implementing Classes:
AttributeContainer,AttributeContainerAny,AttributeContainerAnyConcurrent,AttributeContainerConcurrent,StringMap
public interface IAttributeContainer<KEYTYPE,VALUETYPE>
extends ICommonsMap<KEYTYPE,VALUETYPE>, IGetterByKeyTrait<KEYTYPE>
Base interface for a generic read-only attribute container. It maps keys to
values.
Note: don't implement
Note: don't implement
Iterable<Map.Entry<...>>
because this would make the object ambiguous to e.g.
HashCodeGenerator- Author:
- Philip Helger
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptiondefault booleangetAsBoolean(KEYTYPE aName) Get the attribute value associated to the given attribute name.
Avoid throwing TypeConverterException by providing a default value.default doublegetAsDouble(KEYTYPE aName) Get the attribute value associated to the given attribute name.default floatgetAsFloat(KEYTYPE aName) Get the attribute value associated to the given attribute name.
Avoid throwing TypeConverterException by providing a default value.default intGet the attribute value associated to the given attribute name.
Avoid throwing TypeConverterException by providing a default value.default longGet the attribute value associated to the given attribute name.
Avoid throwing TypeConverterException by providing a default value.getClone()default VALUETYPEGet the attribute value associated to the given attribute name.default EChangedefault EChangeSet/overwrite an attribute value including before and after callbacks.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, setAllMethods 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, onSafeCastErrorMethods 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 Details
-
getValue
Get the attribute value associated to the given attribute name.- Specified by:
getValuein interfaceIGetterByKeyTrait<KEYTYPE>- Parameters:
aName- the attribute name- Returns:
nullif no such value exists
-
getAsInt
Get the attribute value associated to the given attribute name.
Avoid throwing TypeConverterException by providing a default value.- Specified by:
getAsIntin interfaceIGetterByKeyTrait<KEYTYPE>- Parameters:
aName- the attribute name- Returns:
- The attribute value or
CGlobal.ILLEGAL_UINTif no such attribute exists
-
getAsLong
Get the attribute value associated to the given attribute name.
Avoid throwing TypeConverterException by providing a default value.- Specified by:
getAsLongin interfaceIGetterByKeyTrait<KEYTYPE>- Parameters:
aName- the attribute name- Returns:
- The attribute value or
CGlobal.ILLEGAL_ULONGif no such attribute exists
-
getAsFloat
Get the attribute value associated to the given attribute name.
Avoid throwing TypeConverterException by providing a default value.- Specified by:
getAsFloatin interfaceIGetterByKeyTrait<KEYTYPE>- Parameters:
aName- the attribute name- Returns:
- The attribute value or
CGlobal.ILLEGAL_UINTif no such attribute exists
-
getAsDouble
Get the attribute value associated to the given attribute name.- Specified by:
getAsDoublein interfaceIGetterByKeyTrait<KEYTYPE>- Parameters:
aName- the attribute name- Returns:
- The attribute value or
CGlobal.ILLEGAL_UINTif no such attribute exists
-
getAsBoolean
Get the attribute value associated to the given attribute name.
Avoid throwing TypeConverterException by providing a default value.- Specified by:
getAsBooleanin interfaceIGetterByKeyTrait<KEYTYPE>- Parameters:
aName- the attribute name- Returns:
- The attribute value or
falseif no such attribute exists
-
beforeSetValueCallbacks
@Nonnull @ReturnsMutableObject CallbackList<IAttributeContainer.IBeforeSetValueCallback<KEYTYPE,VALUETYPE>> beforeSetValueCallbacks()- Returns:
- Callbacks to be invoked before values are set. May not be
null.
-
afterSetValueCallbacks
@Nonnull @ReturnsMutableObject CallbackList<IAttributeContainer.IAfterSetValueCallback<KEYTYPE,VALUETYPE>> afterSetValueCallbacks()- Returns:
- Callbacks to be invoked after values are set. May not be
null.
-
putIn
Set/overwrite an attribute value including before and after callbacks.- Parameters:
aName- The name of the attribute. May not benull.aNewValue- The new value of the attribute. May benull.- Returns:
EChange.CHANGEDif something changed,EChange.UNCHANGEDotherwise.- See Also:
-
putAllIn
-
getClone
- Specified by:
getClonein interfaceICloneable<KEYTYPE>- Returns:
- A 100% deep-copy of the implementing class.
-