Class EntitySchemaReader

java.lang.Object
dev.hogwai.dynamodb.simplified.entity.EntitySchemaReader

public final class EntitySchemaReader extends Object
Reads @Entity and @KeyComponent annotations from a class and produces an EntitySchema.

Scans both methods and fields for @KeyComponent annotations and collects @KeyPrefix values.

  • Method Details

    • read

      public static <T> @NonNull EntitySchema<T> read(@NonNull Class<T> clazz)
      Reads the entity schema from an @Entity-annotated class.
      Type Parameters:
      T - the entity type
      Parameters:
      clazz - the entity class to scan
      Returns:
      the parsed entity schema
      Throws:
      IllegalArgumentException - if the class is not annotated with @Entity