@@ -17,9 +17,11 @@ This library is intended to be used in server-side contexts and has not been eva
17
17
18
18
## Usage
19
19
20
- While ` Boolean ` provides the simplest introduction, we offer a variety of flag types.
20
+ While ` Boolean ` provides the simplest introduction, we offer a variety of flag types.
21
21
22
22
``` java
23
+ import dev.openfeature.javasdk.Structure ;
24
+
23
25
class MyClass {
24
26
public UI booleanExample () {
25
27
// Should we render the redesign? Or the default webpage?
@@ -28,23 +30,25 @@ class MyClass {
28
30
}
29
31
return render_normal();
30
32
}
31
-
33
+
32
34
public Template stringExample () {
33
35
// Get the template to load for the custom new homepage
34
- String template = client. getStringValue(" homepage_template" , " default-homepage.html" )
36
+ String template = client. getStringValue(" homepage_template" , " default-homepage.html" );
35
37
return render_template(template);
36
38
}
37
-
38
- public List<Module > numberExample () {
39
+
40
+ public List<HomepageModule > numberExample () {
39
41
// How many modules should we be fetching?
40
42
Integer count = client. getIntegerValue(" module-fetch-count" , 4 );
41
43
return fetch_modules(count);
42
44
}
43
-
44
- public Module structureExample () {
45
- // This deserializes into the Module structure for you.
46
- Module heroModule = client. getObjectValue(" hero-module" , myExampleModule);
47
- return heroModule;
45
+
46
+ public HomepageModule structureExample () {
47
+ Structure obj = client. getObjectValue(" hero-module" , previouslyDefinedDefaultStructure);
48
+ return HomepageModule . builder()
49
+ .title(obj. getValue(" title" ))
50
+ .body(obj. getValue(" description" ))
51
+ .build();
48
52
}
49
53
}
50
54
```
@@ -109,7 +113,7 @@ We are also present on the `#openfeature` channel in the [CNCF slack](https://sl
109
113
Thanks so much to our contributors.
110
114
111
115
<a href =" https://github.com/open-feature/java-sdk/graphs/contributors " >
112
- <img src =" https://contrib.rocks/image?repo=open-feature/java-sdk " />
116
+ <img src =" https://contrib.rocks/image?repo=open-feature/java-sdk " alt = " Pictures of the folks who have contributed to the project " />
113
117
</a >
114
118
115
119
Made with [ contrib.rocks] ( https://contrib.rocks ) .
0 commit comments