Attribute Encoders: @Nullable or @NonNull
Rod Widdowson
rdw at steadingsoftware.com
Thu May 2 09:20:53 EDT 2013
This is probably for Scott or Brent who will have an idea about what the
Assertion creation code will do..
The Interface "AttributeEncoder<EncodedType>" contains a method with this
footprint
@Nonnull public EncodedType encode([...])
But the implementations all have this footprint
@Nullable public AttributeType encode([...])
Obviously I have to fix one of these, but which?
My feeling is that the Interface implementation is correct. By the time an
Attribute exits the filter stage it will either be not present in the result
set or it have at least one value, hence an encoder will only not be able to
do anything (and thus either return null or throw an exception) if there is
the Attribute Values are of a type which do not lend themselves to being
encoded (so a StringValue being passed to a XmlObjectEncoder), and this is a
configuration issue, not a glitch in normal running.
But I thought I should check with others with more experience in the
field...
/Rod
More information about the dev
mailing list