aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/foo/zaaarf/routecompass/Route.java
blob: 2b61571c2f9d634cd2b7cdde0eb06590c3cf2fb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package foo.zaaarf.routecompass;

import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Internal representation of a REST route.
 */
public class Route {
   public final String classFqn;
   public final String route;
   public final String method;
   public final boolean deprecated;


   public Route(String classFqn, String route, RequestMethod[] methods, boolean deprecated) {
      this.classFqn = classFqn;
      this.route = route;
      StringBuilder methodStringBuilder = new StringBuilder("[");
      for(RequestMethod m : methods)
         methodStringBuilder
            .append(m.name())
            .append("|");
      methodStringBuilder
         .deleteCharAt(methodStringBuilder.length() - 1)
         .append("]");
      this.method = methodStringBuilder.toString();
      this.deprecated = deprecated;
   }
}