Skip to content

Commit

Permalink
Get getters from enriched
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto committed Jan 13, 2025
1 parent 48ff899 commit 3dd2354
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,14 @@ public GeneratedJavaFile generateFile() {
List<EnrichedObjectProperty> enrichedObjectProperties = new ArrayList<>();
if (selfInterface.isEmpty()) {
enrichedObjectProperties = objectTypeDeclaration.getProperties().stream()
.map(objectProperty -> {
EnrichedObjectProperty enrichedObjectProperty = EnrichedObjectProperty.of(
objectProperty,
false,
poetTypeNameMapper.convertToTypeName(true, objectProperty.getValueType()));
objectPropertyGetters.put(objectProperty, enrichedObjectProperty);
return enrichedObjectProperty;
})
.map(objectProperty -> EnrichedObjectProperty.of(
objectProperty,
false,
poetTypeNameMapper.convertToTypeName(true, objectProperty.getValueType())))
.collect(Collectors.toList());
for (EnrichedObjectProperty enrichedObjectProperty : enrichedObjectProperties) {
objectPropertyGetters.put(enrichedObjectProperty.objectProperty(), enrichedObjectProperty);
}
}
List<ImplementsInterface> implementsInterfaces = new ArrayList<>();
getUniqueAncestorsInLevelOrder().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public interface EnrichedObjectProperty {

Optional<Literal> literal();

ObjectProperty objectProperty();

@Value.Lazy
default Optional<FieldSpec> fieldSpec() {
if (literal().isPresent()) {
Expand Down Expand Up @@ -103,6 +105,7 @@ static EnrichedObjectProperty of(ObjectProperty objectProperty, boolean fromInte
.pascalCaseKey(name.getPascalCase().getSafeName())
.poetTypeName(poetTypeName)
.fromInterface(fromInterface)
.objectProperty(objectProperty)
.wireKey(objectProperty.getName().getWireValue())
.docs(objectProperty.getDocs())
.literal(maybeLiteral)
Expand Down

0 comments on commit 3dd2354

Please sign in to comment.