polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niclas Hedhman (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (ZEST-141) UseDefaults annotation with value
Date Fri, 10 Jun 2016 06:31:20 GMT

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

Niclas Hedhman edited comment on ZEST-141 at 6/10/16 6:30 AM:
--------------------------------------------------------------

OOPS; didn't see that I made this comment already...

Well, as described this is not possible, since you can not have generics on the annotations
and the value must be of some specific types (java.lang.Object is not allowed).

But we can make it into a String type, and use deserialization to any other type if the property
is not a String. I think that is a reasonable compromise.


was (Author: niclas):
Well, as described this is not possible, since you can not have generics on the annotations
and the value must be of some specific types (java.lang.Object is not allowed).

But we can make it into a String type, and use deserialization to any other type if the property
is not a String. I think that is a reasonable compromise.

> UseDefaults annotation with value
> ---------------------------------
>
>                 Key: ZEST-141
>                 URL: https://issues.apache.org/jira/browse/ZEST-141
>             Project: Zest
>          Issue Type: Improvement
>    Affects Versions: 2.1
>            Reporter: Mingzhou Zhuang
>            Priority: Minor
>              Labels: features
>
> Define default value where I declare the Property, such as:
> {code}
> public interface ABC {
>    @UseDefaults(value="127.0.0.1")
>    Property<String> hostname();
>    @UseDefaults(value=8080)
>    Property<Integer> port();
> }
> {code}



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

Mime
View raw message