From b527f22cbf0da26ce5703c1db0270e682d00473b Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 2 Nov 2017 14:44:23 +0000 Subject: [PATCH] JAL-2808 convenience method to get attribute as String --- src/jalview/datamodel/SequenceFeature.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/jalview/datamodel/SequenceFeature.java b/src/jalview/datamodel/SequenceFeature.java index 5029da5..ffbd497 100755 --- a/src/jalview/datamodel/SequenceFeature.java +++ b/src/jalview/datamodel/SequenceFeature.java @@ -393,6 +393,23 @@ public class SequenceFeature implements FeatureLocationI } /** + * Answers the value of the specified attribute as string, or null if no such + * value + * + * @param key + * @return + */ + public String getValueAsString(String key) + { + if (otherDetails == null) + { + return null; + } + Object value = otherDetails.get(key); + return value == null ? null : value.toString(); + } + + /** * Returns a property value for the given key if known, else the specified * default value * -- 1.7.10.2