T
- the intersection of the supertypes of the described classpublic class ClassSignature<T> extends java.lang.Object implements ParameterizedSignature<ClassSignature<T>>
ClassDefinition
object is instantiated. This means that the type can
be safely reasoned about before any class members are defined or any
implementation details are specified.
A class signature contains a number of method
signatures
. Some of these signatures may be implied by inheritance, and some
may be explicitly attached. When a class signature is declared, each of those
signatures is realized into a corresponding method
declaration
.
Modifier | Constructor and Description |
---|---|
protected |
ClassSignature() |
protected |
ClassSignature(java.lang.String packageName,
java.lang.String simpleName,
java.lang.String enclosingClassName,
java.lang.reflect.AnnotatedType superClass,
java.util.Set<java.lang.reflect.AnnotatedType> superInterfaces,
java.util.Set<ConstructorSignature> constructorSignatures,
java.util.Set<MethodSignature<?>> methodSignatures,
java.util.List<TypeVariableSignature> typeVariables,
java.util.Set<java.lang.annotation.Annotation> annotations,
Modifiers modifiers) |
Modifier and Type | Method and Description |
---|---|
ClassSignature<T> |
annotated(java.util.Collection<? extends java.lang.annotation.Annotation> annotations)
Derive a version of this declaration with the given annotations.
|
static ClassSignature<java.lang.Object> |
classSignature() |
static <T> ClassSignature<T> |
classSignature(java.lang.Class<T> clazz)
Create the class signature describing the given class.
|
ClassSignature<T> |
constructor(ConstructorSignature constructorSignature) |
ClassSignature<T> |
enclosingClassName(java.lang.String enclosingClassName) |
ClassSignature<?> |
extending(java.lang.reflect.AnnotatedType... superType) |
<U> ClassSignature<? extends U> |
extending(java.lang.Class<U> superType) |
ClassSignature<?> |
extending(java.util.Collection<? extends java.lang.reflect.AnnotatedType> superType) |
ClassSignature<?> |
extending(java.lang.reflect.Type... superType) |
<U> ClassSignature<? extends U> |
extending(TypeToken<? extends U>... superType) |
<U> ClassSignature<? extends U> |
extending(TypeToken<U> superType) |
java.util.stream.Stream<? extends java.lang.annotation.Annotation> |
getAnnotations() |
protected java.lang.String |
getClassName() |
java.util.stream.Stream<? extends ConstructorSignature> |
getConstructors() |
java.util.Optional<java.lang.String> |
getEnclosingClassName() |
java.util.stream.Stream<? extends MethodSignature<?>> |
getMethods() |
Modifiers |
getModifiers() |
protected java.util.Optional<java.lang.String> |
getPackageName() |
protected java.lang.String |
getSimpleName() |
protected java.util.Optional<? extends java.lang.reflect.AnnotatedType> |
getSuperClass() |
protected java.util.stream.Stream<? extends java.lang.reflect.AnnotatedType> |
getSuperInterfaces() |
java.util.stream.Stream<? extends TypeVariableSignature> |
getTypeVariables() |
ClassSignature<T> |
method(MethodSignature<?> methodSignature) |
ClassSignature<T> |
packageName(java.util.function.Function<java.lang.String,java.lang.String> packageNameTransformation) |
ClassSignature<T> |
packageName(java.lang.String packageName) |
ClassSignature<T> |
simpleName(java.util.function.Function<java.lang.String,java.lang.String> simpleNameTransformation) |
ClassSignature<T> |
simpleName(java.lang.String simpleName) |
ClassSignature<T> |
typeVariables(java.util.Collection<? extends TypeVariableSignature> typeVariables) |
protected ClassSignature<T> |
withModifiers(Modifiers modifiers) |
ClassSignature<T> |
withVisibility(Visibility visibility) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendTypeParametersTo, typeVariables, typeVariables
annotated
protected ClassSignature()
protected ClassSignature(java.lang.String packageName, java.lang.String simpleName, java.lang.String enclosingClassName, java.lang.reflect.AnnotatedType superClass, java.util.Set<java.lang.reflect.AnnotatedType> superInterfaces, java.util.Set<ConstructorSignature> constructorSignatures, java.util.Set<MethodSignature<?>> methodSignatures, java.util.List<TypeVariableSignature> typeVariables, java.util.Set<java.lang.annotation.Annotation> annotations, Modifiers modifiers)
public static ClassSignature<java.lang.Object> classSignature()
public static <T> ClassSignature<T> classSignature(java.lang.Class<T> clazz)
clazz
- the class whose signature we wish to createprotected java.lang.String getClassName()
protected java.util.Optional<java.lang.String> getPackageName()
public ClassSignature<T> packageName(java.lang.String packageName)
public ClassSignature<T> packageName(java.util.function.Function<java.lang.String,java.lang.String> packageNameTransformation)
protected java.lang.String getSimpleName()
public ClassSignature<T> simpleName(java.lang.String simpleName)
public ClassSignature<T> simpleName(java.util.function.Function<java.lang.String,java.lang.String> simpleNameTransformation)
public Modifiers getModifiers()
protected ClassSignature<T> withModifiers(Modifiers modifiers)
public ClassSignature<T> withVisibility(Visibility visibility)
public java.util.Optional<java.lang.String> getEnclosingClassName()
public ClassSignature<T> enclosingClassName(java.lang.String enclosingClassName)
protected java.util.Optional<? extends java.lang.reflect.AnnotatedType> getSuperClass()
protected java.util.stream.Stream<? extends java.lang.reflect.AnnotatedType> getSuperInterfaces()
public ClassSignature<?> extending(java.lang.reflect.Type... superType)
superType
- the supertype for the class signaturepublic ClassSignature<?> extending(java.lang.reflect.AnnotatedType... superType)
superType
- the supertype for the class signaturepublic <U> ClassSignature<? extends U> extending(java.lang.Class<U> superType)
U
- the supertype for the class signaturesuperType
- the supertype for the class signaturepublic <U> ClassSignature<? extends U> extending(TypeToken<U> superType)
U
- the supertype for the class signaturesuperType
- the supertype for the class signature@SafeVarargs public final <U> ClassSignature<? extends U> extending(TypeToken<? extends U>... superType)
U
- the supertype for the class signaturesuperType
- the supertype for the class signaturepublic ClassSignature<?> extending(java.util.Collection<? extends java.lang.reflect.AnnotatedType> superType)
superType
- the supertype for the class signaturepublic java.util.stream.Stream<? extends ConstructorSignature> getConstructors()
public ClassSignature<T> constructor(ConstructorSignature constructorSignature)
public java.util.stream.Stream<? extends MethodSignature<?>> getMethods()
public ClassSignature<T> method(MethodSignature<?> methodSignature)
public java.util.stream.Stream<? extends java.lang.annotation.Annotation> getAnnotations()
getAnnotations
in interface AnnotatedSignature<ClassSignature<T>>
public ClassSignature<T> annotated(java.util.Collection<? extends java.lang.annotation.Annotation> annotations)
AnnotatedSignature
Target
, as there is no validation of
applicability.
Annotations already present on the receiving declaration will be replaced rather than appended.
annotated
in interface AnnotatedSignature<ClassSignature<T>>
annotations
- the annotations with which to annotate this declarationpublic java.util.stream.Stream<? extends TypeVariableSignature> getTypeVariables()
getTypeVariables
in interface ParameterizedSignature<ClassSignature<T>>
public ClassSignature<T> typeVariables(java.util.Collection<? extends TypeVariableSignature> typeVariables)
typeVariables
in interface ParameterizedSignature<ClassSignature<T>>