Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Default Value Provider #16

Open
sys1yagi opened this issue Jan 18, 2016 · 0 comments
Open

Default Value Provider #16

sys1yagi opened this issue Jan 18, 2016 · 0 comments
Milestone

Comments

@sys1yagi
Copy link
Owner

idea

@Args(defaultValueProvider=ShopDefaultValueProvider.class)
Shop shop;

interface

public interface DefaultValueProvider<T> {
  T get();
}

concrete class

public class ShopDefaultValueProvider<Shop> {
  Shop get() {
     Shop shop = new Shop();
     shop.setId(-1L);
     shop.setName("unknown");
     return shop;
  }
}
@sys1yagi sys1yagi added this to the 1.0.0 milestone Jan 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant