boolean trail = TRAIL_DEFAULT;
List<Color> colors = COLORS_DEFAULT;
List<Color> fadeColors = FADE_COLORS_DEFAULT;
Type type = TYPE_DEFAULT;
JsonElement element;
element = json.get(FLICKER);
if (element != null)
{
flicker = element.getAsBoolean();
}
element = json.get(TRAIL);
if (element != null)
{
trail = element.getAsBoolean();
}
element = json.get(COLORS);
if (element != null)
{
colors = toColorCollection(element);
}
element = json.get(FADE_COLORS);
if (element != null)
{
fadeColors = toColorCollection(element);
}
element = json.get(TYPE);
if (element != null)
{
type = Type.valueOf(element.getAsString());
}
FireworkEffect ret = FireworkEffect.builder()
.flicker(flicker)
.trail(trail)