Ċ package Ġorg . mybatis . generator . api . dom . java . render Ċ Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . mybatis . generator . api . dom . java . Field Ċ import Ġorg . mybatis . generator . api . dom . java . Fully Qualified Java Type Ċ import Ġorg . mybatis . generator . api . dom . java . Java Visibility Ċ Ċ class ĠField Renderer Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Basic Field () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġf Ġ= ĠField (" name ", ĠFull y Qualified Java Type . getString Instance ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( toString ( f )). isEqualTo (" String Ġname ; ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Basic Field With Initialization String () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġf Ġ= ĠField (" name ", ĠFull y Qualified Java Type . getString Instance ()) ĊĠĠĠĠĠĠĠ Ġf . set Initialization String (" """ F red """ ") ĊĠĠĠĠĠĠĠ ĠassertThat ( toString ( f )). isEqualTo (""" String Ġname Ġ= Ġ" F red "; """) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Private Field With Initialization String () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġf Ġ= ĠField (" name ", ĠFull y Qualified Java Type . getString Instance ()) ĊĠĠĠĠĠĠĠ Ġf . setVisibility ( Java Visibility . PRIVATE ) ĊĠĠĠĠĠĠĠ Ġf . set Initialization String (" """ F red """ ") ĊĠĠĠĠĠĠĠ ĠassertThat ( toString ( f )). isEqualTo (""" private ĠString Ġname Ġ= Ġ" F red "; """) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Private Static Field With Initialization String () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġf Ġ= ĠField (" name ", ĠFull y Qualified Java Type . getString Instance ()) ĊĠĠĠĠĠĠĠ Ġf . setVisibility ( Java Visibility . PRIVATE ) Ċ ĉ f . set Static ( true ) Ċ ĉ f . set Final ( true ) ĊĠĠĠĠĠĠĠ Ġf . set Initialization String (" """ F red """ ") ĊĠĠĠĠĠĠĠ ĠassertThat ( toString ( f )). isEqualTo (""" private Ġstatic Ġfinal ĠString Ġname Ġ= Ġ" F red "; """) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Private Transient Field With Initialization String () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġf Ġ= ĠField (" name ", ĠFull y Qualified Java Type . getString Instance ()) ĊĠĠĠĠĠĠĠ Ġf . setVisibility ( Java Visibility . PRIVATE ) Ċ ĉ f . set Transient ( true ) Ċ ĉ f . set Volatile ( true ) ĊĠĠĠĠĠĠĠ Ġf . set Initialization String (" """ F red """ ") ĊĠĠĠĠĠĠĠ ĠassertThat ( toString ( f )). isEqualTo (""" private Ġtransient Ġvolatile ĠString Ġname Ġ= Ġ" F red "; """) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Private Field With Initialization String Javadoc And Annotations () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġf Ġ= ĠField (" name ", ĠFull y Qualified Java Type . getString Instance ()) ĊĠĠĠĠĠĠĠ Ġf . setVisibility ( Java Visibility . PRIVATE ) ĊĠĠĠĠĠĠĠ Ġf . set Initialization String (" """ F red """ ") ĊĉĊ ĉ f . add Annotation ("@ Generated ") Ċ ĉ f . add Java Doc Line (" /** ") Ċ ĉ f . add Java Doc Line (" Ġ* ĠSome ĠJ avadoc ") Ċ ĉ f . add Java Doc Line (" Ġ*/ ") Ċĉĉ ĊĠĠĠĠĠĠĠ ĠassertThat ( toString ( f )). isEqualTo Normal izing New lines (""" ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ| /** ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ| Ġ* ĠSome ĠJ avadoc ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ| Ġ*/ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ| @ Generated ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ| private ĠString Ġname Ġ= Ġ" F red "; ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ""" . trim Margin ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠtoString ( f : ĠField ) Ġ= ĠField Renderer (). render ( f , Ġnull ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. join ToString ( System . getProperty (" line . separator ")) Ċ } Ċ