Interface AttributeManager

All Superinterfaces:
AttributeMutator
All Known Implementing Classes:
AttributeMap

public interface AttributeManager extends AttributeMutator
Describes a class that is able to receive and provide values for all of, or a defined subset of, the Attribute list.
Author:
Markus MÃ¥rtensson
  • Method Details

    • managesAttribute

      boolean managesAttribute(Attribute attribute)
      Determines if the given attribute is part of the subset managed by the class.
      Parameters:
      attribute - the attribute to test.
      Returns:
      true, if the attribute can be accessed and/or mutated by the class.
    • setAttribute

      AttributeManager setAttribute(Attribute attribute, Object value)
      Attribute mutator.
      Specified by:
      setAttribute in interface AttributeMutator
      Parameters:
      attribute - the attribute to set.
      value - the new value of the attribute.
      Returns:
      the manager, to allow method chaining.
    • getAttribute

      <T> T getAttribute(Attribute attribute)
      Attribute accessor.
      Type Parameters:
      T - the requested type for casting.
      Parameters:
      attribute - the attribute to get.
      Returns:
      the current value of the attribute, cast as requested.
      Throws:
      ClassCastException - if the value cannot be cast as requested.