From: gmungoc Date: Thu, 2 Nov 2017 14:44:23 +0000 (+0000) Subject: JAL-2808 convenience method to get attribute as String X-Git-Tag: Release_2_11_0~160 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b527f22cbf0da26ce5703c1db0270e682d00473b;p=jalview.git JAL-2808 convenience method to get attribute as String --- 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 *