You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2016/11/07 11:33:58 UTC

[jira] [Created] (JCR-4054) DavPropertySet should have type-safe method variants

Julian Reschke created JCR-4054:
-----------------------------------

             Summary: DavPropertySet should have type-safe method variants
                 Key: JCR-4054
                 URL: https://issues.apache.org/jira/browse/JCR-4054
             Project: Jackrabbit Content Repository
          Issue Type: Wish
          Components: jackrabbit-webdav
            Reporter: Julian Reschke
            Priority: Minor


For instance:

{noformat}
    public <T> DavProperty<T> get(DavPropertyName name, Class<T> typeKey) {
        DavProperty<?> p = map.get(name);
        if (! typeKey.isInstance(p.getValue())) {
            throw new IllegalArgumentException("value of " + name + " is " + p.getValue().getClass() + ", not " + typeKey);
        }
        return (DavProperty<T>)p;
    }
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)