summaryrefslogtreecommitdiff
path: root/src/main/java/foo/zaaarf/routecompass/Route.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/foo/zaaarf/routecompass/Route.java')
-rw-r--r--src/main/java/foo/zaaarf/routecompass/Route.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/foo/zaaarf/routecompass/Route.java b/src/main/java/foo/zaaarf/routecompass/Route.java
new file mode 100644
index 0000000..2b61571
--- /dev/null
+++ b/src/main/java/foo/zaaarf/routecompass/Route.java
@@ -0,0 +1,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;
+ }
+}