Skip to content

[Java] Invoke static methods without instantiating target object #1953

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

Conversation

mpkorstanje
Copy link
Contributor

Allows glue annotations to be used on static methods. This allows for
example @DataTableType to be used on the type it creates.


public class TestBean {
    private String stringOne;
    private String stringTwo;

    [...]

    @DataTableType
    public static TestBean makeTestBean(Map<String, String> row) {
        return new TestBean(
                row.get("ItemOne"),
                row.get("ItemTwo")
        );
    }
}

Fixes #1950

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Allows glue annotations to be used on static methods. This allows for
example `@DataTableType` to be used on the type it creates.

```

public class TestBean {
    private String stringOne;
    private String stringTwo;

    [...]

    @DataTableType
    public static TestBean makeTestBean(Map<String, String> row) {
        return new TestBean(
                row.get("ItemOne"),
                row.get("ItemTwo")
        );
    }
}
```

Fixes #1950
@mpkorstanje mpkorstanje merged commit 97c1162 into v6.x.x Apr 22, 2020
@mpkorstanje mpkorstanje deleted the java-invoke-static-methods-withouth-instantiating-target-object branch April 22, 2020 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant