diff options
author | Matt Windsor <mattwindsor@btinternet.com> | 2011-03-19 14:12:44 +0000 |
---|---|---|
committer | Matt Windsor <mattwindsor@btinternet.com> | 2011-03-19 14:12:44 +0000 |
commit | 410219d08abdb859315c4d6d0e0375287d64a88b (patch) | |
tree | 3d4610f6cc671147a0aec7bca573a38d6c98b58e /src/uk/org/ury/server/protocol/Directive.java | |
parent | 2efb758e7c2bd85801c76305161d9d8fa6d2be4b (diff) |
Converted protocol to JSON. Now passes its first ever unit test\!
Diffstat (limited to 'src/uk/org/ury/server/protocol/Directive.java')
-rw-r--r-- | src/uk/org/ury/server/protocol/Directive.java | 59 |
1 files changed, 4 insertions, 55 deletions
diff --git a/src/uk/org/ury/server/protocol/Directive.java b/src/uk/org/ury/server/protocol/Directive.java index 0d7a162..ce1b8b9 100644 --- a/src/uk/org/ury/server/protocol/Directive.java +++ b/src/uk/org/ury/server/protocol/Directive.java @@ -11,59 +11,8 @@ package uk.org.ury.server.protocol; public enum Directive { - // ID String representation Singleton? - - /** Directive marking the start of an item block. */ - ITEM_START ("ITEM-START" , false), - - /** Directive marking a property inside an item block. */ - ITEM_PROPERTY ("PROP" , false), - - /** Directive marking the end of an item block. */ - ITEM_END ("ITEM-END" , false); - - - - private String strRep; // String representation - private boolean isSingleton; // Is a singleton? - - - /** - * Construct a new Directive. - * - * @param strRep The string representation of the Directive. - * - * @param isSingleton If true, then the Directive accepts no - * properties. If false, then the Directive - * must be provided with at least one. - */ - - private - Directive (String strRep, boolean isSingleton) - { - this.strRep = strRep; - this.isSingleton = isSingleton; - } - - - /** - * @return the string representation. - */ - - public String - toString () - { - return strRep; - } - - - /** - * @return true if the directive has no properties. - */ - - public Boolean - isSingleton () - { - return isSingleton; - } + INFO, // Information string (can usually be ignored) + ITEMS, // Item + STATUS, // Status code (from the enum Status) + REASON; // Error reason } |