metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kasper Sørensen (JIRA) <j...@apache.org>
Subject [jira] [Commented] (METAMODEL-145) A Column subinterface with type arguments
Date Mon, 01 Jun 2015 10:50:17 GMT

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

Kasper Sørensen commented on METAMODEL-145:
-------------------------------------------

That's actually something else in my opinion. I would like to decouple the two discussions
around 1) Stronger typing and 2) Object mapping. This story is only about the stronger typing
aspect in my opinion.

> A Column subinterface with type arguments
> -----------------------------------------
>
>                 Key: METAMODEL-145
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-145
>             Project: Apache MetaModel
>          Issue Type: New Feature
>            Reporter: Kasper Sørensen
>
> I propose to introduce a new interface to extend the Column interface. This interface
should have a type parameter, representing the value type of the column. My suggested name
would be TypedColumn<E>.
> To take advantage of this type information I propose a few changes:
> DataSet: Add a getValue(TypedColumn) method. When you have a typed column you can then
get values from DataSets that do not need casting:
> {code}
> TypedColumn<Boolean> c1 = ...
> TypedColumn<String> c2 = ...
> DataSet ds = ...
> Boolean value1 = ds.getValue(c1);
> Boolean value2 = ds.getValue(c2);
> {code}
> Table: Change the return type of getNumberColumns() to return TypedColumn<? extends
Number>[] instead of just Column[]. Apply same principle to other such methods (getBooleanColumns,
getLiteralColumns etc.).



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

Mime
View raw message