Skip to content

Support interface property instead required implementation #77

@segabriel

Description

@segabriel

It will be nice to support an interface (without any implementation) as ObjectProperty, and use java8 interface features. For example, the next interface:

interface ObjectProperty {
 
    Integer testProperty();

    Optional<Integer> testOptionalProperty();

    default String testDefaultProperty() {
      return "DEFAULT";
    }

    default Optional<String> testOptionalDefaultProperty() {
      return Optional.of("DEFAULT");
    }
  }

and then with ConfigRegistry :

   ObjectConfigProperty<ObjectProperty> settings = config.objectProperty(mapping, ObjectProperty.class);

Note: mapping on interface method name

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions