Class Declarations
- java.lang.Object
-
- org.inferred.freebuilder.processor.Declarations
-
public class Declarations extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDeclarations.Declaration
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringUPCAST_COMMENT
-
Constructor Summary
Constructors Modifier Constructor Description privateDeclarations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Optional<Variable>freshBuilder(SourceBuilder code, Datatype datatype)Declares a fresh Builder to copy default property values from.static VariableupcastToGeneratedBuilder(SourceBuilder code, Datatype datatype, java.lang.String builder)Upcasts a Builder instance to the generated superclass, to allow access to private fields.
-
-
-
Field Detail
-
UPCAST_COMMENT
private static final java.lang.String UPCAST_COMMENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
upcastToGeneratedBuilder
public static Variable upcastToGeneratedBuilder(SourceBuilder code, Datatype datatype, java.lang.String builder)
Upcasts a Builder instance to the generated superclass, to allow access to private fields.Reuses an existing upcast instance if one was already declared in this scope.
- Parameters:
code- theSourceBuilderto add the declaration todatatype- metadata about the user type the builder is being generated forbuilder- the Builder instance to upcast
-
freshBuilder
public static java.util.Optional<Variable> freshBuilder(SourceBuilder code, Datatype datatype)
Declares a fresh Builder to copy default property values from.Reuses an existing fresh Builder instance if one was already declared in this scope.
-
-