@Test public void all_fields() throws JSONException { givenTextComponent(FlexTextComponent.newBuilder("Hello, World!") .setFlex(2) .setAlign(FlexMessageComponent.Alignment.START) .setGravity(FlexMessageComponent.Gravity.CENTER) .setMargin(FlexMessageComponent.Margin.XL) .setMaxLines(3) .setWrap(true) .setSize(FlexMessageComponent.Size.XL) .setWeight(FlexMessageComponent.Weight.BOLD) .setColor("#0000ff") .setAction(new UriAction("https: messageShouldBe("{" + " \"type\": \"text\"," + " \"text\": \"Hello, World!\"," + " \"margin\": \"xl\"," + " \"size\": \"xl\"," + " \"align\": \"start\"," + " \"gravity\": \"center\"," + " \"wrap\": true," + " \"weight\": \"bold\"," + " \"color\": \"#0000ff\"," + " \"action\": {" + " \"type\": \"uri\"," + " \"label\": \"View details\"," + " \"uri\": \"https: " }," + " \"flex\": 2," + " \"maxLines\": 3" + "}"); }
public static Builder newBuilder(@NonNull String text) { return new Builder(text); }
FlexTextComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull String text) { return new Builder(text); } }
FlexTextComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull String text) { return new Builder(text); } private  FlexTextComponent(); private  FlexTextComponent(@NonNull Builder builder); }
FlexTextComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull String text) { return new Builder(text); } private  FlexTextComponent(); private  FlexTextComponent(@NonNull Builder builder); static Builder newBuilder(@NonNull String text); @NonNull @Override JSONObject toJsonObject(); }
FlexTextComponent extends FlexMessageComponent { public static Builder newBuilder(@NonNull String text) { return new Builder(text); } private  FlexTextComponent(); private  FlexTextComponent(@NonNull Builder builder); static Builder newBuilder(@NonNull String text); @NonNull @Override JSONObject toJsonObject();  }