javamoney
  1. javamoney
  2. JAVAMONEY-17

Define Attributable Feature for Extended Use Cases

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8
    • Component/s: API, Spec: Specification
    • Labels:
      None

      Description

      Discussions have shown that many use cases that can not be covered by this JSR. This requires to add some more flexibility to some of the artifacts (value types) defined. It was basically agreed that this features should be minimized and modeled as type safe as possible:

      • this feature is modelled by an interface called javax.money.util.AttributeProvider.
      • attributes can be accessed by <T> T getAttribute(String key, Class<T> type).
      • the current defined keys can be accessed by Enumeration<String> getAttributeKeys().
        • It was decided to use an Enumeration since it is commonly used within the JDK and also matches better to the use case since Iterator#remove() is not supported.
      • The attribute type for a key can be accessed by Class<?> getAttributeType(String key), if no such key is available null is returned.

      Since adding attributes is not simple, it may be required that creating attributable instances may require using a 'builder pattern'.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            atsticks
            Reporter:
            atsticks
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: