@@ -86,18 +86,110 @@ public JSONObject toJson()
86
86
.put ("instance" , instance );
87
87
}
88
88
89
- //const char* details; /* max 128 bytes */
90
- //int64_t startTimestamp;
91
- //int64_t endTimestamp;
92
- //const char* largeImageKey; /* max 32 bytes */
93
- //const char* largeImageText; /* max 128 bytes */
94
- //const char* smallImageKey; /* max 32 bytes */
95
- //const char* smallImageText; /* max 128 bytes */
96
- //const char* partyId; /* max 128 bytes */
97
- //int partySize;
98
- //int partyMax;
99
- //const char* matchSecret; /* max 128 bytes */
100
- //const char* joinSecret; /* max 128 bytes */
101
- //const char* spectateSecret; /* max 128 bytes */
102
- //int8_t instance;
89
+ public static class Builder
90
+ {
91
+ private String state ;
92
+ private String details ;
93
+ private OffsetDateTime startTimestamp ;
94
+ private OffsetDateTime endTimestamp ;
95
+ private String largeImageKey ;
96
+ private String largeImageText ;
97
+ private String smallImageKey ;
98
+ private String smallImageText ;
99
+ private String partyId ;
100
+ private int partySize ;
101
+ private int partyMax ;
102
+ private String matchSecret ;
103
+ private String joinSecret ;
104
+ private String spectateSecret ;
105
+ private boolean instance ;
106
+
107
+ public RichPresence build ()
108
+ {
109
+ return new RichPresence (state , details , startTimestamp , endTimestamp ,
110
+ largeImageKey , largeImageText , smallImageKey , smallImageText ,
111
+ partyId , partySize , partyMax , matchSecret , joinSecret ,
112
+ spectateSecret , instance );
113
+ }
114
+
115
+ public Builder setState (String state )
116
+ {
117
+ this .state = state ;
118
+ return this ;
119
+ }
120
+
121
+ public Builder setDetails (String details )
122
+ {
123
+ this .details = details ;
124
+ return this ;
125
+ }
126
+
127
+ public Builder setStartTimestamp (OffsetDateTime startTimestamp )
128
+ {
129
+ this .startTimestamp = startTimestamp ;
130
+ return this ;
131
+ }
132
+
133
+ public Builder setEndTimestamp (OffsetDateTime endTimestamp )
134
+ {
135
+ this .endTimestamp = endTimestamp ;
136
+ return this ;
137
+ }
138
+
139
+ public Builder setLargeImage (String largeImageKey , String largeImageText )
140
+ {
141
+ this .largeImageKey = largeImageKey ;
142
+ this .largeImageText = largeImageText ;
143
+ return this ;
144
+ }
145
+
146
+ public Builder setLargeImage (String largeImageKey )
147
+ {
148
+ return setLargeImage (largeImageKey , null );
149
+ }
150
+
151
+ public Builder setSmallImage (String smallImageKey , String smallImageText )
152
+ {
153
+ this .smallImageKey = smallImageKey ;
154
+ this .smallImageText = smallImageText ;
155
+ return this ;
156
+ }
157
+
158
+ public Builder setSmallImage (String smallImageKey )
159
+ {
160
+ return setSmallImage (smallImageKey , null );
161
+ }
162
+
163
+ public Builder setParty (String partyId , int partySize , int partyMax )
164
+ {
165
+ this .partyId = partyId ;
166
+ this .partySize = partySize ;
167
+ this .partyMax = partyMax ;
168
+ return this ;
169
+ }
170
+
171
+ public Builder setMatchSecret (String matchSecret )
172
+ {
173
+ this .matchSecret = matchSecret ;
174
+ return this ;
175
+ }
176
+
177
+ public Builder setJoinSecret (String joinSecret )
178
+ {
179
+ this .joinSecret = joinSecret ;
180
+ return this ;
181
+ }
182
+
183
+ public Builder setSpectateSecret (String spectateSecret )
184
+ {
185
+ this .spectateSecret = spectateSecret ;
186
+ return this ;
187
+ }
188
+
189
+ public Builder setInstance (boolean instance )
190
+ {
191
+ this .instance = instance ;
192
+ return this ;
193
+ }
194
+ }
103
195
}
0 commit comments