PageRenderTime 133ms CodeModel.GetById 126ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/sitebricks-acceptance-tests/src/main/java/com/google/sitebricks/example/Repeat.java

http://github.com/dhanji/sitebricks
Java | 31 lines | 18 code | 7 blank | 6 comment | 0 complexity | 95dcec895383506da65e636873d1bb4e MD5 | raw file
 1package com.google.sitebricks.example;
 2
 3import com.google.sitebricks.At;
 4
 5import java.util.*;
 6
 7/**
 8 * @author Dhanji R. Prasanna (dhanji@gmail.com)
 9 */
10@At("/repeat")
11public class Repeat {
12    private static final List<String> NAMES = Arrays.asList("Dhanji", "Josh", "Jody", "Iron Man");
13
14    //property returns a list of names
15    public List<String> getNames() {
16        return NAMES;
17    }
18
19    //try a set this time, returns movies (to demo nested repeat)
20    public Set<Movie> getMovies() {
21        return new HashSet<Movie>(Arrays.asList(new Movie(), new Movie(), new Movie()));
22    }
23
24    public static class Movie {
25
26        //try a collection this time. same as property Repeat.getNames() from the outer class
27        public Collection<String> getActors() {
28            return NAMES;
29        }
30    }
31}