Top Description Fields Constructors Methods
org.snakeyaml.engine.v2.comments

public Class CommentLine

extends Object
Class Inheritance
Imports
java.util.Objects, .Optional, org.snakeyaml.engine.v2.events.CommentEvent, org.snakeyaml.engine.v2.exceptions.Mark

A comment line. Maybe a block comment, blank line, or inline comment.

Field Summary

Modifier and TypeField and Description
private final CommentType
private final Optional<Mark>
private final Optional<Mark>
private final String

Constructor Summary

AccessConstructor and Description
public
CommentLine(CommentEvent
- the source
event
)

Create

public
CommentLine(Optional<Mark>
- start
startMark
,
Optional<Mark>
- end
endMark
,
String
- the comment
value
,
CommentType
- the type
commentType
)

Create

Method Summary

Modifier and TypeMethod and Description
public CommentType

Returns:

type of it
getCommentType
()

getter

public Optional<Mark>

Returns:

end position
getEndMark
()

getter

public Optional<Mark>

Returns:

start position
getStartMark
()

getter

public String

Returns:

comment's value.
getValue
()

Value of this comment.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

commentTypeback to summary
private final CommentType commentType
endMarkback to summary
private final Optional<Mark> endMark
startMarkback to summary
private final Optional<Mark> startMark
valueback to summary
private final String value

Constructor Detail

CommentLineback to summary
public CommentLine(CommentEvent event)

Create

Parameters
event:CommentEvent

- the source

CommentLineback to summary
public CommentLine(Optional<Mark> startMark, Optional<Mark> endMark, String value, CommentType commentType)

Create

Parameters
startMark:Optional<Mark>

- start

endMark:Optional<Mark>

- end

value:String

- the comment

commentType:CommentType

- the type

Method Detail

getCommentTypeback to summary
public CommentType getCommentType()

getter

Returns:CommentType

type of it

getEndMarkback to summary
public Optional<Mark> getEndMark()

getter

Returns:Optional<Mark>

end position

getStartMarkback to summary
public Optional<Mark> getStartMark()

getter

Returns:Optional<Mark>

start position

getValueback to summary
public String getValue()

Value of this comment.

Returns:String

comment's value.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.