Skip to content

Commit a02f806

Browse files
committed
add other types to the readme.
1 parent aef04b6 commit a02f806

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,35 @@ This library is intended to be used in server-side contexts and has not been eva
1414

1515
## Usage
1616

17-
There are a variety flag types that we offer, but `Boolean` provides the simplest introduction. We can use this SDK to determine if we should show our latest redesign or not.
17+
While `Boolean` provides the simplest introduction, we offer a variety of flag types.
1818

1919
```java
2020
class MyClass {
21-
// ...
22-
public void myFunction() {
21+
public UI booleanExample() {
22+
// Should we render the redesign? Or the default webpage?
2323
if (client.getBooleanValue("redesign_enabled", false)) {
2424
return render_redesign();
2525
}
2626
return render_normal();
2727
}
28-
// ...
28+
29+
public Template stringExample() {
30+
// Get the template to load for the custom new homepage
31+
String template = client.getStringValue("homepage_template", "default-homepage.html")
32+
return render_template(template);
33+
}
34+
35+
public List<Module> numberExample() {
36+
// How many modules should we be fetching?
37+
Integer count = client.getIntegerValue("module-fetch-count", 4);
38+
return fetch_modules(count);
39+
}
40+
41+
public Module structureExample() {
42+
// This deserializes into the Module structure for you.
43+
Module heroModule = client.getObjectValue("hero-module", myExampleModule);
44+
return heroModule;
45+
}
2946
}
3047
```
3148

0 commit comments

Comments
 (0)