PageRenderTime 65ms CodeModel.GetById 50ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/dhanji/sitebricks
Java | 140 lines | 110 code | 30 blank | 0 comment | 0 complexity | b068d9538f40892567439d7230b5ca84 MD5 | raw file
  1package com.google.sitebricks.example;
  2
  3
  4import com.google.sitebricks.At;
  5import com.google.sitebricks.http.Delete;
  6import com.google.sitebricks.http.Get;
  7import com.google.sitebricks.http.Patch;
  8import com.google.sitebricks.http.Post;
  9import com.google.sitebricks.http.Put;
 10import com.google.sitebricks.http.Select;
 11
 12import java.util.ArrayList;
 13import java.util.List;
 14
 15
 16@At("/select") @Select("event")
 17public class SelectRouting {
 18
 19  private List<String> data = new ArrayList<String>();
 20
 21  public SelectRouting() {
 22  }
 23
 24  public SelectRouting(List<String> data) {
 25    this.data = data;
 26  }
 27
 28  public List<String> getData() {
 29    return data;
 30  }
 31
 32  public void setData(List<String> data) {
 33    this.data = data;
 34  }
 35
 36  @Post
 37  public void defaultPost() {
 38    data.add("defaultPost");
 39  }
 40
 41  @Post("foo")
 42  public void fooPost() {
 43    data.add("fooPost");
 44  }
 45
 46  @Post("bar")
 47  public void barPost() {
 48    data.add("barPost");
 49  }
 50
 51  @Post("304")
 52  public Object redirectPost() {
 53    data.add("redirectPost");
 54    return new SelectRouting(data);
 55  }
 56
 57  @Get
 58  public void defaultGet() {
 59    data.add("defaultGet");
 60  }
 61
 62  @Get("foo")
 63  public void fooGet() {
 64    data.add("fooGet");
 65  }
 66
 67  @Get("bar")
 68  public void barGet() {
 69    data.add("barGet");
 70  }
 71
 72  @Get("304")
 73  public Object redirectGet() {
 74    data.add("redirectGet");
 75    return new SelectRouting(data);
 76  }
 77
 78  @Put
 79  public void defaultPut() {
 80    data.add("defaultPut");
 81  }
 82
 83  @Put("foo")
 84  public void fooPut() {
 85    data.add("fooPut");
 86  }
 87
 88  @Put("bar")
 89  public void barPut() {
 90    data.add("barPut");
 91  }
 92
 93  @Put("304")
 94  public Object redirectPut() {
 95    data.add("redirectPut");
 96    return new SelectRouting(data);
 97  }
 98
 99  @Patch
100  public void defaultPatch() {
101    data.add("defaultPatch");
102  }
103
104  @Patch("foo")
105  public void fooPatch() {
106    data.add("fooPath");
107  }
108
109  @Patch("bar")
110  public void barPatch() {
111    data.add("barPatch");
112  }
113
114  @Patch("304")
115  public Object redirectPatch() {
116    data.add("redirectPatch");
117    return new SelectRouting(data);
118  }
119
120  @Delete
121  public void defaultDelete() {
122    data.add("defaultDelete");
123  }
124
125  @Delete("foo")
126  public void fooDelete() {
127    data.add("fooDelete");
128  }
129
130  @Delete("bar")
131  public void barDelete() {
132    data.add("barDelete");
133  }
134
135  @Delete("304")
136  public Object redirectDelete() {
137    data.add("redirectDelete");
138    return new SelectRouting(data);
139  }
140}