You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "A. Soroka (JIRA)" <ji...@apache.org> on 2018/02/28 12:30:00 UTC

[jira] [Commented] (JENA-1495) Covariant return type for Model's PrefixMapping methods.

    [ https://issues.apache.org/jira/browse/JENA-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16380215#comment-16380215 ] 

A. Soroka commented on JENA-1495:
---------------------------------

This seems reasonable-- it would be easier to spot any potential problems looking at code. Can you possibly create a PR for this?

> Covariant return type for Model's PrefixMapping methods.
> --------------------------------------------------------
>
>                 Key: JENA-1495
>                 URL: https://issues.apache.org/jira/browse/JENA-1495
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: Jena 3.6.0
>            Reporter: Adam Jacobs
>            Priority: Trivial
>              Labels: easyfix
>
> The {{Model}} interface inherits several methods from {{PrefixMapping}} which return {{this}}.
>  The return type of these methods can be refined to allow call chaining with the {{Model}} object.
> There appear to be two concrete implementations of {{Model}} which override the {{PrefixMapping}} methods: {{ModelCom}} and {{SecuredModelImpl}}. Steps to add covariant return types for prefix mapping are as follows.
> Add these six methods to the Model interface.
>  # Model setNsPrefix( String prefix, String uri );
>  # Model removeNsPrefix( String prefix );
>  # Model clearNsPrefixMap();
>  # Model setNsPrefixes( PrefixMapping other );
>  # Model setNsPrefixes( Map<String, String> map );
>  # Model withDefaultMappings( PrefixMapping map );
> ...and update ModelCom accordingly.
> Add these six methods to the SecuredModel interface.
>  # SecuredModel setNsPrefix( String prefix, String uri );
>  # SecuredModel removeNsPrefix( String prefix ); // This method is already defined.
>  # SecuredModel clearNsPrefixMap();
>  # SecuredModel setNsPrefixes( PrefixMapping other );
>  # SecuredModel setNsPrefixes( Map<String, String> map );
>  # SecuredModel withDefaultMappings( PrefixMapping map );
> ...and update SecuredModelImpl accordingly.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)