summaryrefslogtreecommitdiffstats
path: root/searchcommon
diff options
context:
space:
mode:
Diffstat (limited to 'searchcommon')
-rw-r--r--searchcommon/src/vespa/searchcommon/attribute/iattributevector.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h
index 22ba5c646ea..f8ab03fdabb 100644
--- a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h
+++ b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h
@@ -241,6 +241,18 @@ public:
**/
virtual bool findEnum(const char * value, EnumHandle & e) const = 0;
+ /**
+ * Given an enum handle, returns the string it refers to.
+ * This method will only have effect if @ref getBasicType() returns BasicType::STRING and
+ * @ref hasEnum() returns true.
+ *
+ * Effectively functions as the inverse of @ref findEnum(value, handle)
+ *
+ * @param e a valid enum handle
+ * @return enum string value, or nullptr if attribute type does
+ * not support enum handle lookups.
+ */
+ virtual const char * getStringFromEnum(EnumHandle e) const = 0;
/**
* Creates a context for searching this attribute with the given term.