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)

Reply via email to