1 /**
2 * Copyright © DiamondMVC 2019
3 * License: MIT (https://github.com/DiamondMVC/Diamond/blob/master/LICENSE)
4 * Author: Jacob Jensen (bausshf)
5 */
6 module diamond.controllers.rest.routepart;
7 
8 import diamond.core.apptype;
9 
10 static if (isWeb)
11 {
12   import diamond.controllers.rest.routetype;
13   import diamond.controllers.rest.routedatatype;
14 
15   package (diamond.controllers):
16 
17   /// A route part.
18   final class RoutePart
19   {
20     package(diamond.controllers.rest)
21     {
22       /// The route type.
23       RouteType _routeType;
24 
25       /// The identifier.
26       string _identifier;
27 
28       /// The type.
29       RouteDataType _type;
30 
31       /// Creates a new route part.
32       final this() { }
33 
34       @property
35       {
36         /// Sets the route type.
37         final void routeType(RouteType newRouteType)
38         {
39           _routeType = newRouteType;
40         }
41 
42         /// Sets the identifier.
43         final void identifier(string newIdentifier)
44         {
45           _identifier = newIdentifier;
46         }
47 
48         /// Sets the type.
49         final void type(RouteDataType newType)
50         {
51           _type = newType;
52         }
53       }
54     }
55 
56     final:
57     @property
58     {
59       /// Gets the route type.
60       RouteType routeType() { return _routeType; }
61 
62       /// Gets the identifier.
63       string identifier() { return _identifier; }
64 
65       /// Gets the type.
66       RouteDataType type() { return _type; }
67     }
68   }
69 }