public Trait getTrait() {
        return trait;
    }
Gets the trait associated with the text.

@return Returns the trait if the text is associated with one. Otherwise, returns null.
smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java