Package hydra.go.syntax
Class AnnotatedDeclaration
- java.lang.Object
-
- hydra.go.syntax.AnnotatedDeclaration
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<AnnotatedDeclaration>
public class AnnotatedDeclaration extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<AnnotatedDeclaration>
A top-level Go declaration together with its preceding comment- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnnotatedDeclaration.BuilderA fluent builder forAnnotatedDeclaration.
-
Field Summary
Fields Modifier and Type Field Description java.lang.Stringcommentstatic NameCOMMENTName of thehydra.go.syntax.AnnotatedDeclaration.commentfield.TopLevelDecldeclarationstatic NameDECLARATIONName of thehydra.go.syntax.AnnotatedDeclaration.declarationfield.static NameTYPE_Name of thehydra.go.syntax.AnnotatedDeclarationtype.
-
Constructor Summary
Constructors Constructor Description AnnotatedDeclaration(java.lang.String comment, TopLevelDecl declaration)Constructs an immutableAnnotatedDeclaration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AnnotatedDeclaration.Builderbuilder()Creates a new fluent builder forAnnotatedDeclaration.intcompareTo(AnnotatedDeclaration other)booleanequals(java.lang.Object other)inthashCode()java.lang.StringtoString()AnnotatedDeclarationwithComment(java.lang.String comment)Returns a copy of thisAnnotatedDeclarationwithcommentreplaced.AnnotatedDeclarationwithDeclaration(TopLevelDecl declaration)Returns a copy of thisAnnotatedDeclarationwithdeclarationreplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.go.syntax.AnnotatedDeclarationtype.
-
COMMENT
public static final Name COMMENT
Name of thehydra.go.syntax.AnnotatedDeclaration.commentfield.
-
DECLARATION
public static final Name DECLARATION
Name of thehydra.go.syntax.AnnotatedDeclaration.declarationfield.
-
comment
public final java.lang.String comment
-
declaration
public final TopLevelDecl declaration
-
-
Constructor Detail
-
AnnotatedDeclaration
public AnnotatedDeclaration(java.lang.String comment, TopLevelDecl declaration)Constructs an immutableAnnotatedDeclaration.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(AnnotatedDeclaration other)
- Specified by:
compareToin interfacejava.lang.Comparable<AnnotatedDeclaration>
-
withComment
public AnnotatedDeclaration withComment(java.lang.String comment)
Returns a copy of thisAnnotatedDeclarationwithcommentreplaced.
-
withDeclaration
public AnnotatedDeclaration withDeclaration(TopLevelDecl declaration)
Returns a copy of thisAnnotatedDeclarationwithdeclarationreplaced.
-
builder
public static AnnotatedDeclaration.Builder builder()
Creates a new fluent builder forAnnotatedDeclaration.
-
-