Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support interface property instead required implementation #77

Open
segabriel opened this issue Jul 31, 2018 · 0 comments
Open

Support interface property instead required implementation #77

segabriel opened this issue Jul 31, 2018 · 0 comments

Comments

@segabriel
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant