@Test public void all_fields() throws JSONException { component = FlexBoxComponent.newBuilder(FlexMessageComponent.Layout.HORIZONTAL, contents) .setFlex(1) .setMargin(FlexMessageComponent.Margin.MD) .setSpacing(FlexMessageComponent.Margin.MD) .setAction(new UriAction("https: .build(); messageShouldBe("{" + " \"type\": \"box\"," + " \"layout\": \"horizontal\"," + " \"contents\": [" + " {" + " \"type\": \"text\"," + " \"text\": \"Hello, World!\"" + " }," + " {" + " \"type\": \"image\"," + " \"url\": \"https: " }" + " ]," + " \"spacing\": \"md\"," + " \"margin\": \"md\"," + " \"action\": {" + " \"type\": \"uri\"," + " \"label\": \"View details\"," + " \"uri\": \"https: " }," + " \"flex\": 1" + "}"); }
public static Builder newBuilder(@NonNull Layout layout, @NonNull List<FlexMessageComponent> contents) { return new Builder(layout, contents); }
FlexBoxComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull Layout layout, @NonNull List<FlexMessageComponent> contents) { return new Builder(layout, contents); } }
FlexBoxComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull Layout layout, @NonNull List<FlexMessageComponent> contents) { return new Builder(layout, contents); } private  FlexBoxComponent(); private  FlexBoxComponent(@NonNull Builder builder); }
FlexBoxComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull Layout layout, @NonNull List<FlexMessageComponent> contents) { return new Builder(layout, contents); } private  FlexBoxComponent(); private  FlexBoxComponent(@NonNull Builder builder); static Builder newBuilder(@NonNull Layout layout,
                                     @NonNull List<FlexMessageComponent> contents); @NonNull @Override JSONObject toJsonObject(); }
FlexBoxComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull Layout layout, @NonNull List<FlexMessageComponent> contents) { return new Builder(layout, contents); } private  FlexBoxComponent(); private  FlexBoxComponent(@NonNull Builder builder); static Builder newBuilder(@NonNull Layout layout,
                                     @NonNull List<FlexMessageComponent> contents); @NonNull @Override JSONObject toJsonObject();  }