Class AotRepositoryFragmentMetadata

java.lang.Object
org.springframework.data.repository.aot.generate.AotRepositoryFragmentMetadata

public class AotRepositoryFragmentMetadata extends Object
Metadata for a repository fragment.
Since:
4.0
Author:
Christoph Strobl, Mark Paluch
  • Constructor Details

    • AotRepositoryFragmentMetadata

      public AotRepositoryFragmentMetadata()
  • Method Details

    • fieldNameOf

      public @Nullable String fieldNameOf(Class<?> type)
      Lookup a field name by exact type. Returns the first field that matches the type or null if no field with that type was found.
      Parameters:
      type -
      Returns:
    • addField

      public void addField(String fieldName, org.springframework.javapoet.TypeName type, Modifier... modifiers)
      Add a field to the repository fragment.
      Parameters:
      fieldName - name of the field to add. Must be unique.
      type - field type.
      modifiers - modifiers for the field, e.g. Modifier.PRIVATE, Modifier.FINAL, etc.
    • addField

      public void addField(org.springframework.javapoet.FieldSpec fieldSpec)
      Add a field to the repository fragment.
      Parameters:
      fieldSpec - the field specification to add.
    • getFields

      public Map<String, org.springframework.javapoet.FieldSpec> getFields()
      Returns the fields of the repository fragment.
      Returns:
      the fields of the repository fragment.
    • addConstructorArgument

      public void addConstructorArgument(String parameterName, org.springframework.javapoet.TypeName type, @Nullable String fieldName)
      Add a constructor argument to the repository fragment.
      Parameters:
      parameterName - name of the constructor parameter to add. Must be unique.
      type - type of the constructor parameter.
      fieldName - name of the field to bind the constructor parameter to, or null if no field should be created.
    • getConstructorArguments

      public Map<String, AotRepositoryFragmentMetadata.ConstructorArgument> getConstructorArguments()
      Returns the constructor arguments of the repository fragment.
      Returns:
      the constructor arguments of the repository fragment.