Class ShapeLink
- java.lang.Object
-
- software.amazon.smithy.codegen.core.trace.ShapeLink
-
- All Implemented Interfaces:
ToNode
,ToSmithyBuilder<ShapeLink>
public final class ShapeLink extends java.lang.Object implements ToNode, ToSmithyBuilder<ShapeLink>
Class that defines a link between the SmithyShape
and the artifact that it produced.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShapeLink.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ShapeLink.Builder
builder()
static ShapeLink
fromNode(Node value)
Instantiates ShapeLink instance variables by extracting data from an ObjectNode.java.util.Optional<java.lang.Integer>
getColumn()
Gets this ShapeLink's column number in an optional container.java.util.Optional<java.lang.String>
getFile()
Gets this ShapeLink's file in an optional container.java.lang.String
getId()
Gets this ShapeLink's id.java.util.Optional<java.lang.Integer>
getLine()
Gets this ShapeLink's line number in an optional container.java.util.List<java.lang.String>
getTags()
Gets this ShapeLink's tags list.java.lang.String
getType()
Gets this ShapeLink's type.ShapeLink.Builder
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.ObjectNode
toNode()
Converts instance variables into an ObjectNode for writing out a ShapeLink.
-
-
-
Field Detail
-
TYPE_TEXT
public static final java.lang.String TYPE_TEXT
- See Also:
- Constant Field Values
-
ID_TEXT
public static final java.lang.String ID_TEXT
- See Also:
- Constant Field Values
-
TAGS_TEXT
public static final java.lang.String TAGS_TEXT
- See Also:
- Constant Field Values
-
FILE_TEXT
public static final java.lang.String FILE_TEXT
- See Also:
- Constant Field Values
-
LINE_TEXT
public static final java.lang.String LINE_TEXT
- See Also:
- Constant Field Values
-
COLUMN_TEXT
public static final java.lang.String COLUMN_TEXT
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromNode
public static ShapeLink fromNode(Node value)
Instantiates ShapeLink instance variables by extracting data from an ObjectNode.- Parameters:
value
- an ObjectNode that represents the a single ShapeLink- Returns:
- a ShapeLink created from the ObjectNode
-
builder
public static ShapeLink.Builder builder()
-
toNode
public ObjectNode toNode()
Converts instance variables into an ObjectNode for writing out a ShapeLink.
-
getType
public java.lang.String getType()
Gets this ShapeLink's type. The type is the type of the artifact component. This value MUST correspond to one of the types defined in the /definitions/types property of the trace file.- Returns:
- this ShapeLink's type
-
getId
public java.lang.String getId()
Gets this ShapeLink's id. Id is the artifact-specific identifier for the artifact component. For example, in Java a valid id would be the fully-qualified name of a class, method, or field as defined in Documentation Comment Specification for the Standard Doclet- Returns:
- this ShapeLink's id
-
getTags
public java.util.List<java.lang.String> getTags()
Gets this ShapeLink's tags list. Tags defines a list of tags to apply to the trace link. Each tag MUST correspond to a tag defined in the /definitions/tags property of the trace file.- Returns:
- This ShapeLink's list of tags
-
getFile
public java.util.Optional<java.lang.String> getFile()
Gets this ShapeLink's file in an optional container. File is a URI that defines the location of the artifact component. Files MUST use the "file" URI scheme, and SHOULD be relative.- Returns:
- Optional container holding this ShapeLink's file
-
getLine
public java.util.Optional<java.lang.Integer> getLine()
Gets this ShapeLink's line number in an optional container. Line is the line number in the file that contains the artifact component.- Returns:
- Optional container holding this ShapeLink's line number
-
getColumn
public java.util.Optional<java.lang.Integer> getColumn()
Gets this ShapeLink's column number in an optional container. Column is the column number in the file that contains the artifact component.- Returns:
- Optional container holding this ShapeLink's column number
-
toBuilder
public ShapeLink.Builder toBuilder()
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToSmithyBuilder<ShapeLink>
- Returns:
- a builder for type T
-
-