Class Datatype
- java.lang.Object
-
- org.inferred.freebuilder.processor.Datatype
-
- Direct Known Subclasses:
Datatype_Builder.Rebuildable
public abstract class Datatype extends java.lang.ObjectMetadata about a user's datatype.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDatatype.BuilderBuilder forDatatype.static classDatatype.StandardMethodStandard Java methods that may be underridden.static classDatatype.UnderrideLevelHow compulsory the underride is.static classDatatype.Visibility
-
Constructor Summary
Constructors Constructor Description Datatype()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract TypegetBuilder()Returns the builder type that users will see.abstract java.util.Optional<BuilderFactory>getBuilderFactory()Returns the builder factory mechanism the user has exposed, if any.abstract NameAndVisibilitygetBuildMethod()Returns the build method to be generated.abstract NameAndVisibilitygetBuildPartialMethod()Returns the partial build method to be generated.abstract NameAndVisibilitygetClearMethod()Returns the clear method to be generated.abstract TypeClassgetGeneratedBuilder()Returns the builder class that should be generated.abstract com.google.common.collect.ImmutableList<Excerpt>getGeneratedBuilderAnnotations()Returns a list of annotations that should be applied to the generated builder class.abstract booleangetHasToBuilderMethod()Returns whether the value type has a toBuilder method that needs to be generated.abstract NameAndVisibilitygetMergeFromBuilderMethod()Returns the mergeFrom(Builder) method to be generated.abstract NameAndVisibilitygetMergeFromValueMethod()Returns the mergeFrom(Value) method to be generated.abstract com.google.common.collect.ImmutableList<Excerpt>getNestedClasses()Returns a list of nested classes that should be added to the generated builder class.abstract TypeClassgetPartialType()Returns the partial value class that should be generated.abstract TypeClassgetPropertyEnum()Returns the Property enum that may be generated.abstract java.util.Optional<TypeClass>getRebuildableType()Returns the Rebuildable interface that should be generated, if any.abstract com.google.common.collect.ImmutableMap<Datatype.StandardMethod,Datatype.UnderrideLevel>getStandardMethodUnderrides()abstract TypeClassgetType()Returns the type itself.abstract TypeClassgetValueType()Returns the value class that should be generated.abstract com.google.common.collect.ImmutableList<Excerpt>getValueTypeAnnotations()Returns a list of annotations that should be applied to the generated value class.abstract Datatype.VisibilitygetValueTypeVisibility()Returns the visibility of the generated value class.abstract booleanisBuilderSerializable()Returns whether the builder type should be serializable.abstract booleanisExtensible()Whether there is a package-visible, no-args constructor so we can subclass the Builder.abstract booleanisInterfaceType()Returns true if the type is an interface.Datatype.UnderrideLevelstandardMethodUnderride(Datatype.StandardMethod standardMethod)Datatype.BuildertoBuilder()
-
-
-
Method Detail
-
getType
public abstract TypeClass getType()
Returns the type itself.
-
isInterfaceType
public abstract boolean isInterfaceType()
Returns true if the type is an interface.
-
getBuilder
public abstract Type getBuilder()
Returns the builder type that users will see.
-
isExtensible
public abstract boolean isExtensible()
Whether there is a package-visible, no-args constructor so we can subclass the Builder.
-
getBuilderFactory
public abstract java.util.Optional<BuilderFactory> getBuilderFactory()
Returns the builder factory mechanism the user has exposed, if any.
-
getGeneratedBuilder
public abstract TypeClass getGeneratedBuilder()
Returns the builder class that should be generated.
-
getValueType
public abstract TypeClass getValueType()
Returns the value class that should be generated.
-
getPartialType
public abstract TypeClass getPartialType()
Returns the partial value class that should be generated.
-
getRebuildableType
public abstract java.util.Optional<TypeClass> getRebuildableType()
Returns the Rebuildable interface that should be generated, if any.
-
getPropertyEnum
public abstract TypeClass getPropertyEnum()
Returns the Property enum that may be generated.
-
standardMethodUnderride
public Datatype.UnderrideLevel standardMethodUnderride(Datatype.StandardMethod standardMethod)
-
getStandardMethodUnderrides
public abstract com.google.common.collect.ImmutableMap<Datatype.StandardMethod,Datatype.UnderrideLevel> getStandardMethodUnderrides()
-
isBuilderSerializable
public abstract boolean isBuilderSerializable()
Returns whether the builder type should be serializable.
-
getHasToBuilderMethod
public abstract boolean getHasToBuilderMethod()
Returns whether the value type has a toBuilder method that needs to be generated.
-
getBuildMethod
public abstract NameAndVisibility getBuildMethod()
Returns the build method to be generated.
-
getBuildPartialMethod
public abstract NameAndVisibility getBuildPartialMethod()
Returns the partial build method to be generated.
-
getClearMethod
public abstract NameAndVisibility getClearMethod()
Returns the clear method to be generated.
-
getMergeFromBuilderMethod
public abstract NameAndVisibility getMergeFromBuilderMethod()
Returns the mergeFrom(Builder) method to be generated.
-
getMergeFromValueMethod
public abstract NameAndVisibility getMergeFromValueMethod()
Returns the mergeFrom(Value) method to be generated.
-
getGeneratedBuilderAnnotations
public abstract com.google.common.collect.ImmutableList<Excerpt> getGeneratedBuilderAnnotations()
Returns a list of annotations that should be applied to the generated builder class.
-
getValueTypeAnnotations
public abstract com.google.common.collect.ImmutableList<Excerpt> getValueTypeAnnotations()
Returns a list of annotations that should be applied to the generated value class.
-
getValueTypeVisibility
public abstract Datatype.Visibility getValueTypeVisibility()
Returns the visibility of the generated value class.
-
getNestedClasses
public abstract com.google.common.collect.ImmutableList<Excerpt> getNestedClasses()
Returns a list of nested classes that should be added to the generated builder class.
-
toBuilder
public Datatype.Builder toBuilder()
-
-