Class Reference


  • public class Reference
    extends Object
    Encapsulates a reference string in OpenAPI/AsyncAPI schema, for easier manipulation and parsing.
    • Constructor Detail

      • Reference

        public Reference​(String ref)
        Parameters:
        ref - Encapsulated reference string. MUST NOT be null.
    • Method Detail

      • getRef

        public String getRef()
        Returns:
        the original/full reference string.
      • getAbsPart

        public String getAbsPart()
      • getRelPart

        public String getRelPart()
      • isRelative

        public boolean isRelative()
      • getName

        public String getName()
        Returns:
        a `name` of the referenced component, as parsed from the reference string.
        Throws:
        RuntimeException - if the reference does not contain relative part
      • withAbsoluteFrom

        public Reference withAbsoluteFrom​(Reference that)
        Parameters:
        that - other reference
        Returns:
        a new reference with the absolute part copied form the other one, and relative from this one
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object