All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.sitebricks.example.Repeat Maven / Gradle / Ivy

The newest version!
package com.google.sitebricks.example;

import com.google.sitebricks.At;

import java.util.*;

/**
 * @author Dhanji R. Prasanna ([email protected])
 */
@At("/repeat")
public class Repeat {
    private static final List NAMES = Arrays.asList("Dhanji", "Josh", "Jody", "Iron Man");

    //property returns a list of names
    public List getNames() {
        return NAMES;
    }

    //try a set this time, returns movies (to demo nested repeat)
    public Set getMovies() {
        return new HashSet(Arrays.asList(new Movie(), new Movie(), new Movie()));
    }

    public static class Movie {

        //try a collection this time. same as property Repeat.getNames() from the outer class
        public Collection getActors() {
            return NAMES;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy