Re: Cast a Run object to an AbstractBuild<?,?> Object

11 views
Skip to first unread message

Stephen Connolly

unread,
Jun 27, 2012, 7:51:15 AM6/27/12
to jenkin...@googlegroups.com
If the run is an abstractbuild instance (and there is the possibility
that it may not) then you can cast away

i.e.

if (run instanceof AbstractBuild)
list.add(AbstractBuild.class.cast(run)); else // help I am stuck

and you really are stuck at that point, if you have a project type
which produces Run instances that are not abstract builds.... for
99.999% of users that will be an edge case, but you *should* but some
error handling into your code to handle/warn the user in such edge
cases.

-Stephen

On 27 June 2012 10:43, MaxiTrompe <mtro...@gmail.com> wrote:
> Hello,
>
> I am trying to add features to the existing promoted builds plugin.
> I am stuck at a point where I want to add a Run object to an
> AbstractBuild<?,?> list.
>
> I was wondering if their was any way to do so, like casting a run into an
> abstractbuild.
>
> It would be great if someone knew how to do so,
>
> Thank you
Reply all
Reply to author
Forward
0 new messages