Package io.apicurio.datamodels.refs
Class Reference
- java.lang.Object
-
- io.apicurio.datamodels.refs.Reference
-
public class Reference extends Object
Encapsulates a reference string in OpenAPI/AsyncAPI schema, for easier manipulation and parsing.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetAbsPart()StringgetName()StringgetRef()StringgetRelPart()inthashCode()booleanisRelative()StringtoString()ReferencewithAbsoluteFrom(Reference that)
-
-
-
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
-
-