]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5271: Initial placeholder draft of UriBuilder class.
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 7 Jun 2012 03:13:09 +0000 (20:13 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 7 Jun 2012 03:13:09 +0000 (20:13 -0700)
services/common/src/main/java/org/collectionspace/services/common/UriBuilder.java [new file with mode: 0644]

diff --git a/services/common/src/main/java/org/collectionspace/services/common/UriBuilder.java b/services/common/src/main/java/org/collectionspace/services/common/UriBuilder.java
new file mode 100644 (file)
index 0000000..237cd45
--- /dev/null
@@ -0,0 +1,65 @@
+/**\r
+ * This document is a part of the source code and related artifacts for\r
+ * CollectionSpace, an open source collections management system for museums and\r
+ * related institutions:\r
+ *\r
+ * http://www.collectionspace.org http://wiki.collectionspace.org\r
+ *\r
+ * Copyright 2009-2012 University of California, Berkeley\r
+ *\r
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may\r
+ * not use this file except in compliance with this License.\r
+ *\r
+ * You may obtain a copy of the ECL 2.0 License at\r
+ *\r
+ * https://source.collectionspace.org/collection-space/LICENSE.txt\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
+ * License for the specific language governing permissions and limitations under\r
+ * the License.\r
+ */\r
+package org.collectionspace.services.common;\r
+\r
+// import org.jboss.resteasy.spi.touri;\r
+\r
+public class UriBuilder {\r
+\r
+    UriBuilderType uriBuilderType = null;\r
+\r
+    public UriBuilder(UriBuilderType type) {\r
+        this.uriBuilderType = type;\r
+    }\r
+\r
+    public UriBuilderType getType() {\r
+        return this.uriBuilderType;\r
+    }\r
+\r
+    @Override\r
+    public String toString() {\r
+        return "URI Builder of type " + getType().toString();\r
+    }\r
+    // Placeholder\r
+    String uriTemplate = "replace with true URITemplate object";\r
+\r
+    public String getURITemplate() {\r
+        switch (uriBuilderType) {\r
+            case RESOURCE:\r
+                return uriTemplate;\r
+\r
+            case ITEM:\r
+                return uriTemplate;\r
+\r
+            case CONTACT:\r
+                return uriTemplate;\r
+\r
+            default:\r
+                return uriTemplate;\r
+        }\r
+    }\r
+\r
+    public enum UriBuilderType {\r
+        RESOURCE, ITEM, CONTACT\r
+    };\r
+}
\ No newline at end of file