summaryrefslogtreecommitdiff
path: root/src/main/java/foo/zaaarf/routecompass/Route.java
diff options
context:
space:
mode:
author zaaarf <me@zaaarf.foo>2024-01-19 14:29:20 +0100
committer zaaarf <me@zaaarf.foo>2024-01-19 14:29:20 +0100
commit4da7e5990d6d932539d35082a4859a5d10d46bc6 (patch)
tree6f7279f81d48ac2c5a871aaa22e76c990169eb4f /src/main/java/foo/zaaarf/routecompass/Route.java
initial commit
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;
+ }
+}