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>. null values are not allowed in this attribute containers.
Author:
Philip Helger
  • Method Details

    • putIn

      @Nonnull default EChange putIn(@Nonnull KEYTYPE aName, boolean bValue)
      Set/overwrite an attribute value. This is a shortcut for putIn (aName, Boolean.valueOf (bValue));
      Parameters:
      aName - The name of the attribute. May not be null.
      bValue - The value of the attribute.
      Returns:
      EChange.CHANGED if something changed, EChange.UNCHANGED otherwise.
    • putIn

      @Nonnull default EChange putIn(@Nonnull KEYTYPE aName, int nValue)
      Set/overwrite an attribute value. This is a shortcut for putIn (aName, Integer.valueOf (nValue));
      Parameters:
      aName - The name of the attribute. May not be null.
      nValue - The value of the attribute.
      Returns:
      EChange.CHANGED if something changed, EChange.UNCHANGED otherwise.
    • putIn

      @Nonnull default EChange putIn(@Nonnull KEYTYPE aName, long nValue)
      Set/overwrite an attribute value. This is a shortcut for putIn (aName, Long.valueOf (nValue));
      Parameters:
      aName - The name of the attribute. May not be null.
      nValue - The value of the attribute.
      Returns:
      EChange.CHANGED if something changed, EChange.UNCHANGED otherwise.
    • putIn

      @Nonnull default EChange putIn(@Nonnull KEYTYPE aName, short nValue)
      Set/overwrite an attribute value. This is a shortcut for putIn (aName, Short.valueOf (nValue));
      Parameters:
      aName - The name of the attribute. May not be null.
      nValue - The value of the attribute.
      Returns:
      EChange.CHANGED if something changed, EChange.UNCHANGED otherwise.
    • putIn

      @Nonnull default EChange putIn(@Nonnull KEYTYPE aName, float fValue)
      Set/overwrite an attribute value. This is a shortcut for putIn (aName, Float.valueOf (fValue));
      Parameters:
      aName - The name of the attribute. May not be null.
      fValue - The value of the attribute.
      Returns:
      EChange.CHANGED if something changed, EChange.UNCHANGED otherwise.
    • putIn

      @Nonnull default EChange putIn(@Nonnull KEYTYPE aName, double dValue)
      Set/overwrite an attribute value. This is a shortcut for putIn (aName, Double.valueOf (dValue));
      Parameters:
      aName - The name of the attribute. May not be null.
      dValue - The value of the attribute.
      Returns:
      EChange.CHANGED if something changed, EChange.UNCHANGED otherwise.
    • getAndSetFlag

      default boolean getAndSetFlag(@Nonnull KEYTYPE aName)
      Atomic operation to set a flag to true if it was previously set to false (meaning not existing). There is no possibility to define a value for this flag. The value used is Boolean.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 false is returned, whereas if the flag was already present, true is returned. Any other than the first call for the same flag is always returning true.
    • getClone

      Specified by:
      getClone in interface IAttributeContainer<KEYTYPE,Object>
      Specified by:
      getClone in interface ICloneable<KEYTYPE>
      Returns:
      A 100% deep-copy of the implementing class.